home-erp

git clone git://archive.git.mtrnord.blog/MTRNord/home-erp.git
Log | Files | Refs | README

bootstrap.blade.php (3195B)


      1 @php
      2 if (! isset($scrollTo)) {
      3     $scrollTo = 'body';
      4 }
      5 
      6 $scrollIntoViewJsSnippet = ($scrollTo !== false)
      7     ? <<<JS
      8        (\$el.closest('{$scrollTo}') || document.querySelector('{$scrollTo}')).scrollIntoView()
      9     JS
     10     : '';
     11 @endphp
     12 
     13 <div>
     14     @if ($paginator->hasPages())
     15         <nav>
     16             <ul class="pagination">
     17                 {{-- Previous Page Link --}}
     18                 @if ($paginator->onFirstPage())
     19                     <li class="page-item disabled" aria-disabled="true" aria-label="@lang('pagination.previous')">
     20                         <span class="page-link" aria-hidden="true">&lsaquo;</span>
     21                     </li>
     22                 @else
     23                     <li class="page-item">
     24                         <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" aria-label="@lang('pagination.previous')">&lsaquo;</button>
     25                     </li>
     26                 @endif
     27 
     28                 {{-- Pagination Elements --}}
     29                 @foreach ($elements as $element)
     30                     {{-- "Three Dots" Separator --}}
     31                     @if (is_string($element))
     32                         <li class="page-item disabled" aria-disabled="true"><span class="page-link">{{ $element }}</span></li>
     33                     @endif
     34 
     35                     {{-- Array Of Links --}}
     36                     @if (is_array($element))
     37                         @foreach ($element as $page => $url)
     38                             @if ($page == $paginator->currentPage())
     39                                 <li class="page-item active" wire:key="paginator-{{ $paginator->getPageName() }}-page-{{ $page }}" aria-current="page"><span class="page-link">{{ $page }}</span></li>
     40                             @else
     41                                 <li class="page-item" wire:key="paginator-{{ $paginator->getPageName() }}-page-{{ $page }}"><button type="button" class="page-link" wire:click="gotoPage({{ $page }}, '{{ $paginator->getPageName() }}')" x-on:click="{{ $scrollIntoViewJsSnippet }}">{{ $page }}</button></li>
     42                             @endif
     43                         @endforeach
     44                     @endif
     45                 @endforeach
     46 
     47                 {{-- Next Page Link --}}
     48                 @if ($paginator->hasMorePages())
     49                     <li class="page-item">
     50                         <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" aria-label="@lang('pagination.next')">&rsaquo;</button>
     51                     </li>
     52                 @else
     53                     <li class="page-item disabled" aria-disabled="true" aria-label="@lang('pagination.next')">
     54                         <span class="page-link" aria-hidden="true">&rsaquo;</span>
     55                     </li>
     56                 @endif
     57             </ul>
     58         </nav>
     59     @endif
     60 </div>