49 lines
2.1 KiB
PHP
49 lines
2.1 KiB
PHP
@if ($paginator->hasPages())
|
|
<nav role="navigation" aria-label="Pagination" style="display:flex; justify-content:space-between; align-items:center; gap:10px; flex-wrap:wrap;">
|
|
<div class="a-muted" style="font-size:12px;">
|
|
@php
|
|
$from = ($paginator->currentPage() - 1) * $paginator->perPage() + 1;
|
|
$to = min($paginator->total(), $paginator->currentPage() * $paginator->perPage());
|
|
@endphp
|
|
@if($paginator->total() > 0)
|
|
{{ $from }}-{{ $to }} / 총 {{ $paginator->total() }}
|
|
@else
|
|
0 / 총 0
|
|
@endif
|
|
</div>
|
|
|
|
<div style="display:flex; gap:6px; align-items:center; flex-wrap:wrap;">
|
|
{{-- Prev --}}
|
|
@if ($paginator->onFirstPage())
|
|
<span class="lbtn lbtn--ghost" style="opacity:.45; pointer-events:none;">이전</span>
|
|
@else
|
|
<a class="lbtn lbtn--ghost" href="{{ $paginator->previousPageUrl() }}" rel="prev">이전</a>
|
|
@endif
|
|
|
|
{{-- Pages --}}
|
|
@foreach ($elements as $element)
|
|
@if (is_string($element))
|
|
<span class="lbtn lbtn--ghost" style="opacity:.55; pointer-events:none;">{{ $element }}</span>
|
|
@endif
|
|
|
|
@if (is_array($element))
|
|
@foreach ($element as $page => $url)
|
|
@if ($page == $paginator->currentPage())
|
|
<span class="lbtn lbtn--primary" style="pointer-events:none;">{{ $page }}</span>
|
|
@else
|
|
<a class="lbtn" href="{{ $url }}">{{ $page }}</a>
|
|
@endif
|
|
@endforeach
|
|
@endif
|
|
@endforeach
|
|
|
|
{{-- Next --}}
|
|
@if ($paginator->hasMorePages())
|
|
<a class="lbtn lbtn--ghost" href="{{ $paginator->nextPageUrl() }}" rel="next">다음</a>
|
|
@else
|
|
<span class="lbtn lbtn--ghost" style="opacity:.45; pointer-events:none;">다음</span>
|
|
@endif
|
|
</div>
|
|
</nav>
|
|
@endif
|