Firefly III: a personal finances manager
PHP accountingbudgetbudgetingbudgetscash-flowcashflowcredit-carddockerexpensesfinancefinancesfinanciallinuxmoneypaycheckpersonal-financephpphp7
Fix pagination.
James Colebe33f6c987f2
diff --git a/app/Helpers/Collector/GroupCollector.php b/app/Helpers/Collector/GroupCollector.phpindex aba9652544..99378123c8 100644--- a/app/Helpers/Collector/GroupCollector.php+++ b/app/Helpers/Collector/GroupCollector.php@@ -165,6 +165,16 @@ class GroupCollector implements GroupCollectorInterface*/public function getGroups(): Collection{+ $filterQuery = false;++ // now filter the query according to the page and the limit (if necessary)+ if ($filterQuery) {+ if (null !== $this->limit && null !== $this->page) {+ $offset = ($this->page - 1) * $this->limit;+ $this->query->take($this->limit)->skip($offset);+ }+ }+/** @var Collection $result */$result = $this->query->get($this->fields);@@ -173,10 +183,12 @@ class GroupCollector implements GroupCollectorInterface$this->total = $collection->count();// now filter the array according to the page and the limit (if necessary)- if (null !== $this->limit && null !== $this->page) {- $offset = ($this->page - 1) * $this->limit;+ if (!$filterQuery) {+ if (null !== $this->limit && null !== $this->page) {+ $offset = ($this->page - 1) * $this->limit;- return $collection->slice($offset, $this->limit);+ return $collection->slice($offset, $this->limit);+ }}return $collection;@@ -190,9 +202,10 @@ class GroupCollector implements GroupCollectorInterfacepublic function getPaginatedGroups(): LengthAwarePaginator{$set = $this->getGroups();- if(0===$this->limit) {+ if (0 === $this->limit) {$this->setLimit(50);}+return new LengthAwarePaginator($set, $this->total, $this->limit, $this->page);}@@ -422,6 +435,7 @@ class GroupCollector implements GroupCollectorInterface$this->startQuery();}+return $this;}@@ -466,7 +480,7 @@ class GroupCollector implements GroupCollectorInterfaceprivate function convertToInteger(array $array): array{foreach ($this->integerFields as $field) {- $array[$field] = array_key_exists($field, $array) ? (int) $array[$field] : null;+ $array[$field] = array_key_exists($field, $array) ? (int)$array[$field] : null;}return $array;@@ -498,7 +512,7 @@ class GroupCollector implements GroupCollectorInterface->where(static function (EloquentBuilder $q1) {$q1->where('attachments.attachable_type', TransactionJournal::class);- $q1->where('attachments.uploaded',1);+ $q1->where('attachments.uploaded', 1);$q1->orWhereNull('attachments.attachable_type');});@@ -515,7 +529,7 @@ class GroupCollector implements GroupCollectorInterface{$newArray = $newJournal->toArray();if (array_key_exists('attachment_id', $newArray)) {- $attachmentId = (int) $newJournal['tag_id'];+ $attachmentId = (int)$newJournal['tag_id'];$existingJournal['attachments'][$attachmentId] = ['id' => $attachmentId,];@@ -534,7 +548,7 @@ class GroupCollector implements GroupCollectorInterface{$newArray = $newJournal->toArray();if (array_key_exists('tag_id', $newArray)) { // assume the other fields are present as well.- $tagId = (int) $newJournal['tag_id'];+ $tagId = (int)$newJournal['tag_id'];$tagDate = null;try {@@ -544,7 +558,7 @@ class GroupCollector implements GroupCollectorInterface}$existingJournal['tags'][$tagId] = [- 'id' => (int) $newArray['tag_id'],+ 'id' => (int)$newArray['tag_id'],'name' => $newArray['tag_name'],'date' => $tagDate,'description' => $newArray['tag_description'],@@ -570,21 +584,21 @@ class GroupCollector implements GroupCollectorInterface// make new array$parsedGroup = $this->parseAugmentedJournal($augumentedJournal);$groupArray = [- 'id' => (int) $augumentedJournal->transaction_group_id,- 'user_id' => (int) $augumentedJournal->user_id,+ 'id' => (int)$augumentedJournal->transaction_group_id,+ 'user_id' => (int)$augumentedJournal->user_id,'title' => $augumentedJournal->transaction_group_title,'transaction_type' => $parsedGroup['transaction_type_type'],'count' => 1,'sums' => [],'transactions' => [],];- $journalId = (int) $augumentedJournal->transaction_journal_id;+ $journalId = (int)$augumentedJournal->transaction_journal_id;$groupArray['transactions'][$journalId] = $parsedGroup;$groups[$groupId] = $groupArray;continue;}// or parse the rest.- $journalId = (int) $augumentedJournal->transaction_journal_id;+ $journalId = (int)$augumentedJournal->transaction_journal_id;if (array_key_exists($journalId, $groups[$groupId]['transactions'])) {@@ -631,9 +645,9 @@ class GroupCollector implements GroupCollectorInterface// convert values to integers:$result = $this->convertToInteger($result);- $result['reconciled'] = 1 === (int) $result['reconciled'];+ $result['reconciled'] = 1 === (int)$result['reconciled'];if (isset($augumentedJournal['tag_id'])) { // assume the other fields are present as well.- $tagId = (int) $augumentedJournal['tag_id'];+ $tagId = (int)$augumentedJournal['tag_id'];$tagDate = null;try {$tagDate = Carbon::parse($augumentedJournal['tag_date']);@@ -642,7 +656,7 @@ class GroupCollector implements GroupCollectorInterface}$result['tags'][$tagId] = [- 'id' => (int) $result['tag_id'],+ 'id' => (int)$result['tag_id'],'name' => $result['tag_name'],'date' => $tagDate,'description' => $result['tag_description'],@@ -651,7 +665,7 @@ class GroupCollector implements GroupCollectorInterface// also merge attachments:if (isset($augumentedJournal['attachment_id'])) {- $attachmentId = (int) $augumentedJournal['attachment_id'];+ $attachmentId = (int)$augumentedJournal['attachment_id'];$result['attachments'][$attachmentId] = ['id' => $attachmentId,];@@ -674,7 +688,7 @@ class GroupCollector implements GroupCollectorInterfaceforeach ($groups as $groudId => $group) {/** @var array $transaction */foreach ($group['transactions'] as $transaction) {- $currencyId = (int) $transaction['currency_id'];+ $currencyId = (int)$transaction['currency_id'];// set default:if (!isset($groups[$groudId]['sums'][$currencyId])) {@@ -687,7 +701,7 @@ class GroupCollector implements GroupCollectorInterface$groups[$groudId]['sums'][$currencyId]['amount'] = bcadd($groups[$groudId]['sums'][$currencyId]['amount'], $transaction['amount'] ?? '0');if (null !== $transaction['foreign_amount'] && null !== $transaction['foreign_currency_id']) {- $currencyId = (int) $transaction['foreign_currency_id'];+ $currencyId = (int)$transaction['foreign_currency_id'];// set default:if (!isset($groups[$groudId]['sums'][$currencyId])) {diff --git a/app/Http/Controllers/Account/ShowController.php b/app/Http/Controllers/Account/ShowController.phpindex fee7b826b0..b5bb85941d 100644--- a/app/Http/Controllers/Account/ShowController.php+++ b/app/Http/Controllers/Account/ShowController.php@@ -125,6 +125,7 @@ class ShowController extends Controller->setPage($page)->withAccountInformation()->withCategoryInformation()->setRange($start, $end);$groups = $collector->getPaginatedGroups();+$groups->setPath(route('accounts.show', [$account->id, $start->format('Y-m-d'), $end->format('Y-m-d')]));$showAll = false;$balance = app('steam')->balance($account, $end);diff --git a/resources/views/v1/currencies/index.twig b/resources/views/v1/currencies/index.twigindex 09ee3ad63b..3f56d1a294 100644--- a/resources/views/v1/currencies/index.twig+++ b/resources/views/v1/currencies/index.twig@@ -21,7 +21,7 @@</p>{% if currencies|length > 0 %}<div style="padding-left:8px;">- {{ currencies.render()|raw }}+ {{ currencies.links('pagination.bootstrap-4')|raw }}</div><table class="table table-hover"><thead>@@ -87,7 +87,7 @@</tbody></table><div style="padding-left:8px;">- {{ currencies.render()|raw }}+ {{ currencies.links('pagination.bootstrap-4')|raw }}</div>{% endif %}</div>diff --git a/resources/views/v1/list/accounts.twig b/resources/views/v1/list/accounts.twigindex 32e486fb56..0d0482e6eb 100644--- a/resources/views/v1/list/accounts.twig+++ b/resources/views/v1/list/accounts.twig@@ -1,5 +1,5 @@<div style="padding-left:8px;">- {{ accounts.render()|raw }}+ {{ accounts.links('pagination.bootstrap-4')|raw }}</div><table class="table table-responsive table-hover" id="sortable-table"><thead>@@ -104,5 +104,5 @@</tbody></table><div style="padding-left:8px;">- {{ accounts.render()|raw }}+ {{ accounts.links('pagination.bootstrap-4')|raw }}</div>diff --git a/resources/views/v1/list/bills.twig b/resources/views/v1/list/bills.twigindex 2f59864bd0..d8c0c386b4 100644--- a/resources/views/v1/list/bills.twig+++ b/resources/views/v1/list/bills.twig@@ -1,5 +1,5 @@<div style="padding-left:8px;">- {{ paginator.render()|raw }}+ {{ paginator.links('pagination.bootstrap-4')|raw }}</div><table class="table table-responsive table-hover" id="bill-sortable"><thead>@@ -206,5 +206,5 @@</table><div style="padding-left:8px;">- {{ paginator.render()|raw }}+ {{ paginator.links('pagination.bootstrap-4')|raw }}</div>diff --git a/resources/views/v1/list/categories.twig b/resources/views/v1/list/categories.twigindex a11ec8efc8..96a6ad827d 100644--- a/resources/views/v1/list/categories.twig+++ b/resources/views/v1/list/categories.twig@@ -1,5 +1,5 @@<div style="padding-left:8px;">- {{ categories.render()|raw }}+ {{ categories.links('pagination.bootstrap-4')|raw }}</div><table class="table table-hover sortable"><thead>@@ -43,5 +43,5 @@</tbody></table><div style="padding-left:8px;">- {{ categories.render()|raw }}+ {{ categories.links('pagination.bootstrap-4')|raw }}</div>diff --git a/resources/views/v1/list/groups.twig b/resources/views/v1/list/groups.twigindex 2663cb406d..c3a39a591d 100644--- a/resources/views/v1/list/groups.twig+++ b/resources/views/v1/list/groups.twig@@ -2,9 +2,9 @@<thead><tr>{% if showCategory or showBudget %}- <td colspan="7" class="no-margin-pagination">{{ groups.render()|raw }}</td>+ <td colspan="7" class="no-margin-pagination">{{ groups.links('pagination.bootstrap-4')|raw }}</td>{% else %}- <td colspan="6" class="no-margin-pagination">{{ groups.render()|raw }}</td>+ <td colspan="6" class="no-margin-pagination">{{ groups.links('pagination.bootstrap-4')|raw }}</td>{% endif %}<td colspan="1" class="hidden-xs"><!-- Single button -->@@ -279,9 +279,9 @@</tr><tr>{% if showCategory or showBudget %}- <td colspan="9" class="no-margin-pagination">{{ groups.render()|raw }}</td>+ <td colspan="9" class="no-margin-pagination">{{ groups.links('pagination.bootstrap-4')|raw }}</td>{% else %}- <td colspan="8" class="no-margin-pagination">{{ groups.render()|raw }}</td>+ <td colspan="8" class="no-margin-pagination">{{ groups.links('pagination.bootstrap-4')|raw }}</td>{% endif %}</tr></tfoot>diff --git a/resources/views/v1/pagination/bootstrap-4.blade.php b/resources/views/v1/pagination/bootstrap-4.blade.phpnew file mode 100644index 0000000000..63c6f56b59--- /dev/null+++ b/resources/views/v1/pagination/bootstrap-4.blade.php@@ -0,0 +1,46 @@+@if ($paginator->hasPages())+ <nav>+ <ul class="pagination">+ {{-- Previous Page Link --}}+ @if ($paginator->onFirstPage())+ <li class="page-item disabled" aria-disabled="true" aria-label="@lang('pagination.previous')">+ <span class="page-link" aria-hidden="true">‹</span>+ </li>+ @else+ <li class="page-item">+ <a class="page-link" href="{{ $paginator->previousPageUrl() }}" rel="prev" aria-label="@lang('pagination.previous')">‹</a>+ </li>+ @endif++ {{-- Pagination Elements --}}+ @foreach ($elements as $element)+ {{-- "Three Dots" Separator --}}+ @if (is_string($element))+ <li class="page-item disabled" aria-disabled="true"><span class="page-link">{{ $element }}</span></li>+ @endif++ {{-- Array Of Links --}}+ @if (is_array($element))+ @foreach ($element as $page => $url)+ @if ($page == $paginator->currentPage())+ <li class="page-item active" aria-current="page"><span class="page-link">{{ $page }}</span></li>+ @else+ <li class="page-item"><a class="page-link" href="{{ $url }}">{{ $page }}</a></li>+ @endif+ @endforeach+ @endif+ @endforeach++ {{-- Next Page Link --}}+ @if ($paginator->hasMorePages())+ <li class="page-item">+ <a class="page-link" href="{{ $paginator->nextPageUrl() }}" rel="next" aria-label="@lang('pagination.next')">›</a>+ </li>+ @else+ <li class="page-item disabled" aria-disabled="true" aria-label="@lang('pagination.next')">+ <span class="page-link" aria-hidden="true">›</span>+ </li>+ @endif+ </ul>+ </nav>+@endifdiff --git a/resources/views/v1/pagination/default.blade.php b/resources/views/v1/pagination/default.blade.phpnew file mode 100644index 0000000000..0db70b5627--- /dev/null+++ b/resources/views/v1/pagination/default.blade.php@@ -0,0 +1,46 @@+@if ($paginator->hasPages())+ <nav>+ <ul class="pagination">+ {{-- Previous Page Link --}}+ @if ($paginator->onFirstPage())+ <li class="disabled" aria-disabled="true" aria-label="@lang('pagination.previous')">+ <span aria-hidden="true">‹</span>+ </li>+ @else+ <li>+ <a href="{{ $paginator->previousPageUrl() }}" rel="prev" aria-label="@lang('pagination.previous')">‹</a>+ </li>+ @endif++ {{-- Pagination Elements --}}+ @foreach ($elements as $element)+ {{-- "Three Dots" Separator --}}+ @if (is_string($element))+ <li class="disabled" aria-disabled="true"><span>{{ $element }}</span></li>+ @endif++ {{-- Array Of Links --}}+ @if (is_array($element))+ @foreach ($element as $page => $url)+ @if ($page == $paginator->currentPage())+ <li class="active" aria-current="page"><span>{{ $page }}</span></li>+ @else+ <li><a href="{{ $url }}">{{ $page }}</a></li>+ @endif+ @endforeach+ @endif+ @endforeach++ {{-- Next Page Link --}}+ @if ($paginator->hasMorePages())+ <li>+ <a href="{{ $paginator->nextPageUrl() }}" rel="next" aria-label="@lang('pagination.next')">›</a>+ </li>+ @else+ <li class="disabled" aria-disabled="true" aria-label="@lang('pagination.next')">+ <span aria-hidden="true">›</span>+ </li>+ @endif+ </ul>+ </nav>+@endifdiff --git a/resources/views/v1/pagination/semantic-ui.blade.php b/resources/views/v1/pagination/semantic-ui.blade.phpnew file mode 100644index 0000000000..ef0dbb184c--- /dev/null+++ b/resources/views/v1/pagination/semantic-ui.blade.php@@ -0,0 +1,36 @@+@if ($paginator->hasPages())+ <div class="ui pagination menu" role="navigation">+ {{-- Previous Page Link --}}+ @if ($paginator->onFirstPage())+ <a class="icon item disabled" aria-disabled="true" aria-label="@lang('pagination.previous')"> <i class="left chevron icon"></i> </a>+ @else+ <a class="icon item" href="{{ $paginator->previousPageUrl() }}" rel="prev" aria-label="@lang('pagination.previous')"> <i class="left chevron icon"></i> </a>+ @endif++ {{-- Pagination Elements --}}+ @foreach ($elements as $element)+ {{-- "Three Dots" Separator --}}+ @if (is_string($element))+ <a class="icon item disabled" aria-disabled="true">{{ $element }}</a>+ @endif++ {{-- Array Of Links --}}+ @if (is_array($element))+ @foreach ($element as $page => $url)+ @if ($page == $paginator->currentPage())+ <a class="item active" href="{{ $url }}" aria-current="page">{{ $page }}</a>+ @else+ <a class="item" href="{{ $url }}">{{ $page }}</a>+ @endif+ @endforeach+ @endif+ @endforeach++ {{-- Next Page Link --}}+ @if ($paginator->hasMorePages())+ <a class="icon item" href="{{ $paginator->nextPageUrl() }}" rel="next" aria-label="@lang('pagination.next')"> <i class="right chevron icon"></i> </a>+ @else+ <a class="icon item disabled" aria-disabled="true" aria-label="@lang('pagination.next')"> <i class="right chevron icon"></i> </a>+ @endif+ </div>+@endifdiff --git a/resources/views/v1/pagination/simple-bootstrap-4.blade.php b/resources/views/v1/pagination/simple-bootstrap-4.blade.phpnew file mode 100644index 0000000000..4bb491742a--- /dev/null+++ b/resources/views/v1/pagination/simple-bootstrap-4.blade.php@@ -0,0 +1,27 @@+@if ($paginator->hasPages())+ <nav>+ <ul class="pagination">+ {{-- Previous Page Link --}}+ @if ($paginator->onFirstPage())+ <li class="page-item disabled" aria-disabled="true">+ <span class="page-link">@lang('pagination.previous')</span>+ </li>+ @else+ <li class="page-item">+ <a class="page-link" href="{{ $paginator->previousPageUrl() }}" rel="prev">@lang('pagination.previous')</a>+ </li>+ @endif++ {{-- Next Page Link --}}+ @if ($paginator->hasMorePages())+ <li class="page-item">+ <a class="page-link" href="{{ $paginator->nextPageUrl() }}" rel="next">@lang('pagination.next')</a>+ </li>+ @else+ <li class="page-item disabled" aria-disabled="true">+ <span class="page-link">@lang('pagination.next')</span>+ </li>+ @endif+ </ul>+ </nav>+@endifdiff --git a/resources/views/v1/pagination/simple-default.blade.php b/resources/views/v1/pagination/simple-default.blade.phpnew file mode 100644index 0000000000..36bdbc18c6--- /dev/null+++ b/resources/views/v1/pagination/simple-default.blade.php@@ -0,0 +1,19 @@+@if ($paginator->hasPages())+ <nav>+ <ul class="pagination">+ {{-- Previous Page Link --}}+ @if ($paginator->onFirstPage())+ <li class="disabled" aria-disabled="true"><span>@lang('pagination.previous')</span></li>+ @else+ <li><a href="{{ $paginator->previousPageUrl() }}" rel="prev">@lang('pagination.previous')</a></li>+ @endif++ {{-- Next Page Link --}}+ @if ($paginator->hasMorePages())+ <li><a href="{{ $paginator->nextPageUrl() }}" rel="next">@lang('pagination.next')</a></li>+ @else+ <li class="disabled" aria-disabled="true"><span>@lang('pagination.next')</span></li>+ @endif+ </ul>+ </nav>+@endifdiff --git a/resources/views/v1/pagination/simple-tailwind.blade.php b/resources/views/v1/pagination/simple-tailwind.blade.phpnew file mode 100644index 0000000000..6872cca360--- /dev/null+++ b/resources/views/v1/pagination/simple-tailwind.blade.php@@ -0,0 +1,25 @@+@if ($paginator->hasPages())+ <nav role="navigation" aria-label="Pagination Navigation" class="flex justify-between">+ {{-- Previous Page Link --}}+ @if ($paginator->onFirstPage())+ <span class="relative inline-flex items-center px-4 py-2 text-sm font-medium text-gray-500 bg-white border border-gray-300 cursor-default leading-5 rounded-md">+ {!! __('pagination.previous') !!}+ </span>+ @else+ <a href="{{ $paginator->previousPageUrl() }}" rel="prev" class="relative inline-flex items-center px-4 py-2 text-sm font-medium text-gray-700 bg-white border border-gray-300 leading-5 rounded-md hover:text-gray-500 focus:outline-none focus:ring ring-gray-300 focus:border-blue-300 active:bg-gray-100 active:text-gray-700 transition ease-in-out duration-150">+ {!! __('pagination.previous') !!}+ </a>+ @endif++ {{-- Next Page Link --}}+ @if ($paginator->hasMorePages())+ <a href="{{ $paginator->nextPageUrl() }}" rel="next" class="relative inline-flex items-center px-4 py-2 text-sm font-medium text-gray-700 bg-white border border-gray-300 leading-5 rounded-md hover:text-gray-500 focus:outline-none focus:ring ring-gray-300 focus:border-blue-300 active:bg-gray-100 active:text-gray-700 transition ease-in-out duration-150">+ {!! __('pagination.next') !!}+ </a>+ @else+ <span class="relative inline-flex items-center px-4 py-2 text-sm font-medium text-gray-500 bg-white border border-gray-300 cursor-default leading-5 rounded-md">+ {!! __('pagination.next') !!}+ </span>+ @endif+ </nav>+@endifdiff --git a/resources/views/v1/pagination/tailwind.blade.php b/resources/views/v1/pagination/tailwind.blade.phpnew file mode 100644index 0000000000..2dd4d0ef33--- /dev/null+++ b/resources/views/v1/pagination/tailwind.blade.php@@ -0,0 +1,102 @@+@if ($paginator->hasPages())+ <nav role="navigation" aria-label="{{ __('Pagination Navigation') }}" class="flex items-center justify-between">+ <div class="flex justify-between flex-1 sm:hidden">+ @if ($paginator->onFirstPage())+ <span class="relative inline-flex items-center px-4 py-2 text-sm font-medium text-gray-500 bg-white border border-gray-300 cursor-default leading-5 rounded-md">+ {!! __('pagination.previous') !!}+ </span>+ @else+ <a href="{{ $paginator->previousPageUrl() }}" class="relative inline-flex items-center px-4 py-2 text-sm font-medium text-gray-700 bg-white border border-gray-300 leading-5 rounded-md hover:text-gray-500 focus:outline-none focus:ring ring-gray-300 focus:border-blue-300 active:bg-gray-100 active:text-gray-700 transition ease-in-out duration-150">+ {!! __('pagination.previous') !!}+ </a>+ @endif++ @if ($paginator->hasMorePages())+ <a href="{{ $paginator->nextPageUrl() }}" class="relative inline-flex items-center px-4 py-2 ml-3 text-sm font-medium text-gray-700 bg-white border border-gray-300 leading-5 rounded-md hover:text-gray-500 focus:outline-none focus:ring ring-gray-300 focus:border-blue-300 active:bg-gray-100 active:text-gray-700 transition ease-in-out duration-150">+ {!! __('pagination.next') !!}+ </a>+ @else+ <span class="relative inline-flex items-center px-4 py-2 ml-3 text-sm font-medium text-gray-500 bg-white border border-gray-300 cursor-default leading-5 rounded-md">+ {!! __('pagination.next') !!}+ </span>+ @endif+ </div>++ <div class="hidden sm:flex-1 sm:flex sm:items-center sm:justify-between">+ <div>+ <p class="text-sm text-gray-700 leading-5">+ {!! __('Showing') !!}+ <span class="font-medium">{{ $paginator->firstItem() }}</span>+ {!! __('to') !!}+ <span class="font-medium">{{ $paginator->lastItem() }}</span>+ {!! __('of') !!}+ <span class="font-medium">{{ $paginator->total() }}</span>+ {!! __('results') !!}+ </p>+ </div>++ <div>+ <span class="relative z-0 inline-flex shadow-sm rounded-md">+ {{-- Previous Page Link --}}+ @if ($paginator->onFirstPage())+ <span aria-disabled="true" aria-label="{{ __('pagination.previous') }}">+ <span class="relative inline-flex items-center px-2 py-2 text-sm font-medium text-gray-500 bg-white border border-gray-300 cursor-default rounded-l-md leading-5" aria-hidden="true">+ <svg class="w-5 h-5" fill="currentColor" viewBox="0 0 20 20">+ <path fill-rule="evenodd" d="M12.707 5.293a1 1 0 010 1.414L9.414 10l3.293 3.293a1 1 0 01-1.414 1.414l-4-4a1 1 0 010-1.414l4-4a1 1 0 011.414 0z" clip-rule="evenodd" />+ </svg>+ </span>+ </span>+ @else+ <a href="{{ $paginator->previousPageUrl() }}" rel="prev" class="relative inline-flex items-center px-2 py-2 text-sm font-medium text-gray-500 bg-white border border-gray-300 rounded-l-md leading-5 hover:text-gray-400 focus:z-10 focus:outline-none focus:ring ring-gray-300 focus:border-blue-300 active:bg-gray-100 active:text-gray-500 transition ease-in-out duration-150" aria-label="{{ __('pagination.previous') }}">+ <svg class="w-5 h-5" fill="currentColor" viewBox="0 0 20 20">+ <path fill-rule="evenodd" d="M12.707 5.293a1 1 0 010 1.414L9.414 10l3.293 3.293a1 1 0 01-1.414 1.414l-4-4a1 1 0 010-1.414l4-4a1 1 0 011.414 0z" clip-rule="evenodd" />+ </svg>+ </a>+ @endif++ {{-- Pagination Elements --}}+ @foreach ($elements as $element)+ {{-- "Three Dots" Separator --}}+ @if (is_string($element))+ <span aria-disabled="true">+ <span class="relative inline-flex items-center px-4 py-2 -ml-px text-sm font-medium text-gray-700 bg-white border border-gray-300 cursor-default leading-5">{{ $element }}</span>+ </span>+ @endif++ {{-- Array Of Links --}}+ @if (is_array($element))+ @foreach ($element as $page => $url)+ @if ($page == $paginator->currentPage())+ <span aria-current="page">+ <span class="relative inline-flex items-center px-4 py-2 -ml-px text-sm font-medium text-gray-500 bg-white border border-gray-300 cursor-default leading-5">{{ $page }}</span>+ </span>+ @else+ <a href="{{ $url }}" class="relative inline-flex items-center px-4 py-2 -ml-px text-sm font-medium text-gray-700 bg-white border border-gray-300 leading-5 hover:text-gray-500 focus:z-10 focus:outline-none focus:ring ring-gray-300 focus:border-blue-300 active:bg-gray-100 active:text-gray-700 transition ease-in-out duration-150" aria-label="{{ __('Go to page :page', ['page' => $page]) }}">+ {{ $page }}+ </a>+ @endif+ @endforeach+ @endif+ @endforeach++ {{-- Next Page Link --}}+ @if ($paginator->hasMorePages())+ <a href="{{ $paginator->nextPageUrl() }}" rel="next" class="relative inline-flex items-center px-2 py-2 -ml-px text-sm font-medium text-gray-500 bg-white border border-gray-300 rounded-r-md leading-5 hover:text-gray-400 focus:z-10 focus:outline-none focus:ring ring-gray-300 focus:border-blue-300 active:bg-gray-100 active:text-gray-500 transition ease-in-out duration-150" aria-label="{{ __('pagination.next') }}">+ <svg class="w-5 h-5" fill="currentColor" viewBox="0 0 20 20">+ <path fill-rule="evenodd" d="M7.293 14.707a1 1 0 010-1.414L10.586 10 7.293 6.707a1 1 0 011.414-1.414l4 4a1 1 0 010 1.414l-4 4a1 1 0 01-1.414 0z" clip-rule="evenodd" />+ </svg>+ </a>+ @else+ <span aria-disabled="true" aria-label="{{ __('pagination.next') }}">+ <span class="relative inline-flex items-center px-2 py-2 -ml-px text-sm font-medium text-gray-500 bg-white border border-gray-300 cursor-default rounded-r-md leading-5" aria-hidden="true">+ <svg class="w-5 h-5" fill="currentColor" viewBox="0 0 20 20">+ <path fill-rule="evenodd" d="M7.293 14.707a1 1 0 010-1.414L10.586 10 7.293 6.707a1 1 0 011.414-1.414l4 4a1 1 0 010 1.414l-4 4a1 1 0 01-1.414 0z" clip-rule="evenodd" />+ </svg>+ </span>+ </span>+ @endif+ </span>+ </div>+ </div>+ </nav>+@endifdiff --git a/resources/views/v1/recurring/index.twig b/resources/views/v1/recurring/index.twigindex e4ad78183d..b59f02b817 100644--- a/resources/views/v1/recurring/index.twig+++ b/resources/views/v1/recurring/index.twig@@ -32,7 +32,7 @@<!-- list of recurring here --><div style="padding-left:8px;">- {{ paginator.render()|raw }}+ {{ paginator.links('pagination.bootstrap-4')|raw }}</div><table class="table table-responsive table-hover sortable"><thead>@@ -140,7 +140,7 @@</tbody></table><div style="padding-left:8px;">- {{ paginator.render()|raw }}+ {{ paginator.links('pagination.bootstrap-4')|raw }}</div></div><div class="box-footer">