1
0
mirror of https://github.com/invoiceninja/invoiceninja.git synced 2024-11-12 06:02:39 +01:00
invoiceninja/resources/views/vendor/livewire/simple-bootstrap.blade.php

54 lines
3.0 KiB
PHP
Raw Normal View History

2023-12-13 17:52:49 +01:00
@php
if (! isset($scrollTo)) {
$scrollTo = 'body';
}
$scrollIntoViewJsSnippet = ($scrollTo !== false)
? <<<JS
(\$el.closest('{$scrollTo}') || document.querySelector('{$scrollTo}')).scrollIntoView()
JS
: '';
@endphp
2021-07-20 13:26:24 +02:00
<div>
@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
2022-02-26 23:17:47 +01:00
@if(method_exists($paginator,'getCursorName'))
<li class="page-item">
2023-12-13 17:52:49 +01:00
<button dusk="previousPage" type="button" class="page-link" wire:key="cursor-{{ $paginator->getCursorName() }}-{{ $paginator->previousCursor()->encode() }}" wire:click="setPage('{{$paginator->previousCursor()->encode()}}','{{ $paginator->getCursorName() }}')" x-on:click="{{ $scrollIntoViewJsSnippet }}" wire:loading.attr="disabled" rel="prev">@lang('pagination.previous')</button>
2022-02-26 23:17:47 +01:00
</li>
@else
<li class="page-item">
2023-12-13 17:52:49 +01:00
<button type="button" dusk="previousPage{{ $paginator->getPageName() == 'page' ? '' : '.' . $paginator->getPageName() }}" class="page-link" wire:click="previousPage('{{ $paginator->getPageName() }}')" x-on:click="{{ $scrollIntoViewJsSnippet }}" wire:loading.attr="disabled" rel="prev">@lang('pagination.previous')</button>
2022-02-26 23:17:47 +01:00
</li>
@endif
2021-07-20 13:26:24 +02:00
@endif
{{-- Next Page Link --}}
@if ($paginator->hasMorePages())
2022-02-26 23:17:47 +01:00
@if(method_exists($paginator,'getCursorName'))
<li class="page-item">
2023-12-13 17:52:49 +01:00
<button dusk="nextPage" type="button" class="page-link" wire:key="cursor-{{ $paginator->getCursorName() }}-{{ $paginator->nextCursor()->encode() }}" wire:click="setPage('{{$paginator->nextCursor()->encode()}}','{{ $paginator->getCursorName() }}')" x-on:click="{{ $scrollIntoViewJsSnippet }}" wire:loading.attr="disabled" rel="next">@lang('pagination.next')</button>
2022-02-26 23:17:47 +01:00
</li>
@else
<li class="page-item">
2023-12-13 17:52:49 +01:00
<button type="button" dusk="nextPage{{ $paginator->getPageName() == 'page' ? '' : '.' . $paginator->getPageName() }}" class="page-link" wire:click="nextPage('{{ $paginator->getPageName() }}')" x-on:click="{{ $scrollIntoViewJsSnippet }}" wire:loading.attr="disabled" rel="next">@lang('pagination.next')</button>
2022-02-26 23:17:47 +01:00
</li>
@endif
2021-07-20 13:26:24 +02:00
@else
<li class="page-item disabled" aria-disabled="true">
<span class="page-link">@lang('pagination.next')</span>
</li>
@endif
</ul>
</nav>
@endif
</div>