Skip to content

Commit

Permalink
fixing tailwind pagination display options
Browse files Browse the repository at this point in the history
1) Eliminated the if block that wrapped the whole view because the view script should display its contents regardless of whether pagination is enabled or not. This is because it's also responsible for displaying the result count.

2) Fixed the links() logic to check $showPagination and not $showPerPage. Show Per Page's effect should be isolated to the per page select element, not whether the pagination links should be displayed.
  • Loading branch information
bdelamatre authored May 14, 2021
1 parent afbff0c commit 4bbf22e
Showing 1 changed file with 11 additions and 13 deletions.
24 changes: 11 additions & 13 deletions resources/views/tailwind/includes/pagination.blade.php
Original file line number Diff line number Diff line change
@@ -1,13 +1,11 @@
@if ($showPagination)
<div class="p-6 md:p-0">
@if ($paginationEnabled && $showPerPage && $rows->lastPage() > 1)
{{ $rows->links() }}
@else
<p class="text-sm text-gray-700 leading-5">
@lang('Showing')
<span class="font-medium">{{ $rows->count() }}</span>
@lang('results')
</p>
@endif
</div>
@endif
<div class="p-6 md:p-0">
@if ($paginationEnabled && $showPagination && $rows->lastPage() > 1)
{{ $rows->links() }}
@else
<p class="text-sm text-gray-700 leading-5">
@lang('Showing')
<span class="font-medium">{{ $rows->count() }}</span>
@lang('results')
</p>
@endif
</div>

0 comments on commit 4bbf22e

Please sign in to comment.