|
1 | 1 | <div class="mt-4 flex justify-between items-center"> |
2 | | - <span class="text-sm text-gray-600"> |
3 | | - {{ __('datatable::datatables.page') }} {{ $rows->currentPage() }} van {{ $rows->lastPage() }} - {{ $rows->total() }} {{ __('datatable::datatables.results') }} |
4 | | - </span> |
| 2 | + <span class="text-sm text-gray-600"> |
| 3 | + {{ __('datatable::datatables.page') }} {{ $currentPage }} {{ __('datatable::datatables.of') }} {{ $rows->lastPage() }} - {{ $rows->total() }} {{ __('datatable::datatables.results') }} |
| 4 | + </span> |
5 | 5 |
|
6 | 6 | <div class="flex gap-2"> |
7 | 7 | <button wire:click="previousPage" |
8 | | - class="px-4 py-2 rounded {{ $rows->onFirstPage() ? 'bg-gray-200 text-gray-400 cursor-not-allowed' : 'bg-gray-100 hover:bg-gray-200 text-gray-700' }}" |
9 | | - {{ $rows->onFirstPage() ? 'disabled' : '' }}> |
| 8 | + class="px-4 py-2 rounded {{ $currentPage === 1 ? 'bg-gray-200 text-gray-400 cursor-not-allowed' : 'bg-gray-100 hover:bg-gray-200 text-gray-700' }}" |
| 9 | + {{ $currentPage === 1 ? 'disabled' : '' }}> |
10 | 10 | {{ __('datatable::datatables.previous') }} |
11 | 11 | </button> |
12 | 12 |
|
13 | 13 | @if ($rows->lastPage() <= 10) |
14 | 14 | @for ($page = 1; $page <= $rows->lastPage(); $page++) |
15 | 15 | <button wire:click="gotoPage({{ $page }})" |
16 | | - class="px-4 py-2 rounded {{ $rows->currentPage() == $page ? 'bg-blue-500 text-white' : 'bg-gray-100 hover:bg-gray-200 text-gray-700' }}"> |
| 16 | + class="px-4 py-2 rounded {{ $currentPage == $page ? 'bg-blue-500 text-white' : 'bg-gray-100 hover:bg-gray-200 text-gray-700' }}"> |
17 | 17 | {{ $page }} |
18 | 18 | </button> |
19 | 19 | @endfor |
20 | 20 | @else |
21 | | - |
22 | 21 | <select wire:change="gotoPage($event.target.value)" |
23 | 22 | class="border border-gray-300 rounded px-3 py-1 text-sm w-16"> |
24 | 23 | @for ($page = 1; $page <= $rows->lastPage(); $page++) |
25 | | - <option value="{{ $page }}" {{ $rows->currentPage() == $page ? 'selected' : '' }}> |
| 24 | + <option value="{{ $page }}" {{ $currentPage == $page ? 'selected' : '' }}> |
26 | 25 | {{ $page }} |
27 | 26 | </option> |
28 | 27 | @endfor |
29 | 28 | </select> |
30 | 29 | @endif |
31 | 30 |
|
32 | | - {{-- Volgende knop --}} |
33 | 31 | <button wire:click="nextPage" |
34 | | - class="px-4 py-2 rounded {{ $rows->hasMorePages() ? 'bg-gray-100 hover:bg-gray-200 text-gray-700' : 'bg-gray-200 text-gray-400 cursor-not-allowed' }}" |
35 | | - {{ $rows->hasMorePages() ? '' : 'disabled' }}> |
| 32 | + class="px-4 py-2 rounded {{ $currentPage === $rows->lastPage() ? 'bg-gray-200 text-gray-400 cursor-not-allowed' : 'bg-gray-100 hover:bg-gray-200 text-gray-700' }}" |
| 33 | + {{ $currentPage === $rows->lastPage() ? 'disabled' : '' }}> |
36 | 34 | {{ __('datatable::datatables.next') }} |
37 | 35 | </button> |
38 | 36 | </div> |
|
0 commit comments