スマートフォン向けの簡易なページャーを用意

This commit is contained in:
shibafu 2019-02-16 20:50:22 +09:00
parent 852f1ac88c
commit 72e9d4e3e8
2 changed files with 19 additions and 18 deletions

View File

@ -87,23 +87,7 @@
</li>
@endforelse
</ul>
<ul class="pagination mt-4 justify-content-center">
<li class="page-item {{ $ejaculations->currentPage() === 1 ? 'disabled' : '' }}">
<a class="page-link" href="{{ $ejaculations->previousPageUrl() }}" aria-label="Previous">
<span aria-hidden="true">&laquo;</span>
<span class="sr-only">Previous</span>
</a>
</li>
@for ($i = 1; $i <= $ejaculations->lastPage(); $i++)
<li class="page-item {{ $i === $ejaculations->currentPage() ? 'active' : '' }}"><a href="{{ $ejaculations->url($i) }}" class="page-link">{{ $i }}</a></li>
@endfor
<li class="page-item {{ $ejaculations->currentPage() === $ejaculations->lastPage() ? 'disabled' : '' }}">
<a class="page-link" href="{{ $ejaculations->nextPageUrl() }}" aria-label="Next">
<span aria-hidden="true">&raquo;</span>
<span class="sr-only">Next</span>
</a>
</li>
</ul>
{{ $ejaculations->links(null, ['className' => 'mt-4 justify-content-center']) }}
@endif
@component('components.modal', ['id' => 'deleteCheckinModal'])

View File

@ -1,5 +1,6 @@
@if ($paginator->hasPages())
<ul class="pagination">
{{-- for PC : >= lg --}}
<ul class="pagination d-none d-lg-flex {{ $className ?? '' }}">
{{-- Previous Page Link --}}
@if ($paginator->onFirstPage())
<li class="page-item disabled"><span class="page-link">&laquo;</span></li>
@ -33,4 +34,20 @@
<li class="page-item disabled"><span class="page-link">&raquo;</span></li>
@endif
</ul>
{{-- for Phone : <= md --}}
<ul class="pagination d-flex d-lg-none {{ $className ?? '' }}">
@if ($paginator->onFirstPage())
<li class="page-item w-25 text-center disabled"><span class="page-link">&laquo;</span></li>
@else
<li class="page-item w-25 text-center"><a class="page-link" href="{{ $paginator->previousPageUrl() }}" rel="prev">&laquo;</a></li>
@endif
<li class="page-item w-25 text-center"><span class="page-link">{{ $paginator->currentPage() }}</span></li>
@if ($paginator->hasMorePages())
<li class="page-item w-25 text-center"><a class="page-link" href="{{ $paginator->nextPageUrl() }}" rel="next">&raquo;</a></li>
@else
<li class="page-item w-25 text-center disabled"><span class="page-link">&raquo;</span></li>
@endif
</ul>
@endif