feat: add pagination controls to admin post list
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
parent
82feccf64a
commit
d7a5d425b8
2 changed files with 27 additions and 0 deletions
|
|
@ -62,4 +62,22 @@
|
|||
{{ end }}
|
||||
</div>
|
||||
{{ end }}
|
||||
|
||||
{{ if gt .pageInfo.TotalPages 1 }}
|
||||
<nav aria-label="Page navigation" class="my-4">
|
||||
<ul class="pagination justify-content-center">
|
||||
<li class="page-item{{ if not .pageInfo.HasPrevious }} disabled{{ end }}">
|
||||
<a class="page-link" href="?page={{ .pageInfo.PreviousPage }}{{ if .req.Filter }}&filter={{ .req.Filter }}{{ end }}">Previous</a>
|
||||
</li>
|
||||
{{ range $p := .pageInfo.Pages }}
|
||||
<li class="page-item{{ if eq $p $.pageInfo.CurrentPage }} active{{ end }}">
|
||||
<a class="page-link" href="?page={{ $p }}{{ if $.req.Filter }}&filter={{ $.req.Filter }}{{ end }}">{{ $p }}</a>
|
||||
</li>
|
||||
{{ end }}
|
||||
<li class="page-item{{ if not .pageInfo.HasNext }} disabled{{ end }}">
|
||||
<a class="page-link" href="?page={{ .pageInfo.NextPage }}{{ if .req.Filter }}&filter={{ .req.Filter }}{{ end }}">Next</a>
|
||||
</li>
|
||||
</ul>
|
||||
</nav>
|
||||
{{ end }}
|
||||
</main>
|
||||
Loading…
Add table
Add a link
Reference in a new issue