diff options
| author | Arne Rief <riearn@proton.me> | 2025-08-16 22:42:03 +0200 |
|---|---|---|
| committer | Arne Rief <riearn@proton.me> | 2025-08-16 22:42:03 +0200 |
| commit | f0506acd6f70da636b8fdb23439c85bbf2392b40 (patch) | |
| tree | d9c4082aafa3e20a37174beecadcab54286f9cd9 /layouts/partials/list/pagination.html | |
| parent | 1bf4d8aca6f81f2dddd0262e74b278cd9985b53d (diff) | |
HTML templates done
Diffstat (limited to 'layouts/partials/list/pagination.html')
| -rw-r--r-- | layouts/partials/list/pagination.html | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/layouts/partials/list/pagination.html b/layouts/partials/list/pagination.html new file mode 100644 index 0000000..47d90ff --- /dev/null +++ b/layouts/partials/list/pagination.html @@ -0,0 +1,28 @@ +{{- $paginator := . }} +{{- if gt $paginator.TotalPages 1 }} +<nav class="pagination" aria-label="{{ lang.Translate "pagination.label" | default "Page navigation" }}"> + {{- if $paginator.HasPrev }} + <a href="{{ $paginator.Prev.URL }}" + class="pagination__link" + rel="prev" + aria-label="{{ lang.Translate "pagination.previous_page" | default "Previous page" }}" + > + ← {{ lang.Translate "common.previous" | default "Previous" }} + </a> + {{- end }} + + <p class="pagination__current"> + {{ lang.Translate "pagination.position" $paginator.PageNumber $paginator.TotalPages | default (printf "Page %d of %d" $paginator.PageNumber $paginator.TotalPages) }} + </p> + + {{- if $paginator.HasNext }} + <a href="{{ $paginator.Next.URL }}" + class="pagination__link" + rel="next" + aria-label="{{ lang.Translate "pagination.next_page" | default "Next page" }}" + > + {{ lang.Translate "common.next" | default "Next" }} → + </a> + {{- end }} +</nav> +{{- end }} |
