mailwolt/resources/views/vendor/livewire/tailwind.blade.php

65 lines
2.9 KiB
PHP
Raw Blame History

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

@if ($paginator->hasPages())
@php
$current = $paginator->currentPage();
$last = $paginator->lastPage();
$window = 2; // Seiten links/rechts von aktueller
$start = max(1, $current - $window);
$end = min($last, $current + $window);
@endphp
<div class="mq-pagination">
<span class="mq-pag-info">
{{ $paginator->firstItem() }}{{ $paginator->lastItem() }} von {{ $paginator->total() }}
</span>
<div class="mq-pag-btns">
{{-- Zurück --}}
@if ($paginator->onFirstPage())
<button class="mq-pag-btn" disabled>
<svg width="12" height="12" viewBox="0 0 12 12" fill="none"><path d="M7.5 2L3.5 6l4 4" stroke="currentColor" stroke-width="1.3" stroke-linecap="round" stroke-linejoin="round"/></svg>
</button>
@else
<button type="button" wire:click="previousPage('{{ $paginator->getPageName() }}')" wire:loading.attr="disabled" class="mq-pag-btn">
<svg width="12" height="12" viewBox="0 0 12 12" fill="none"><path d="M7.5 2L3.5 6l4 4" stroke="currentColor" stroke-width="1.3" stroke-linecap="round" stroke-linejoin="round"/></svg>
</button>
@endif
{{-- Erste Seite + --}}
@if ($start > 1)
<button type="button" wire:click="gotoPage(1, '{{ $paginator->getPageName() }}')" class="mq-pag-btn">1</button>
@if ($start > 2)
<button class="mq-pag-btn" disabled></button>
@endif
@endif
{{-- Seitenfenster --}}
@for ($p = $start; $p <= $end; $p++)
@if ($p == $current)
<button class="mq-pag-btn active">{{ $p }}</button>
@else
<button type="button" wire:click="gotoPage({{ $p }}, '{{ $paginator->getPageName() }}')" class="mq-pag-btn">{{ $p }}</button>
@endif
@endfor
{{-- + Letzte Seite --}}
@if ($end < $last)
@if ($end < $last - 1)
<button class="mq-pag-btn" disabled></button>
@endif
<button type="button" wire:click="gotoPage({{ $last }}, '{{ $paginator->getPageName() }}')" class="mq-pag-btn">{{ $last }}</button>
@endif
{{-- Vor --}}
@if ($paginator->hasMorePages())
<button type="button" wire:click="nextPage('{{ $paginator->getPageName() }}')" wire:loading.attr="disabled" class="mq-pag-btn">
<svg width="12" height="12" viewBox="0 0 12 12" fill="none"><path d="M4.5 2L8.5 6l-4 4" stroke="currentColor" stroke-width="1.3" stroke-linecap="round" stroke-linejoin="round"/></svg>
</button>
@else
<button class="mq-pag-btn" disabled>
<svg width="12" height="12" viewBox="0 0 12 12" fill="none"><path d="M4.5 2L8.5 6l-4 4" stroke="currentColor" stroke-width="1.3" stroke-linecap="round" stroke-linejoin="round"/></svg>
</button>
@endif
</div>
</div>
@endif