feat: add page-number navigation to paginated views

This commit is contained in:
2026-05-08 13:20:06 +02:00
parent f226071cbd
commit bd571b3b51
4 changed files with 50 additions and 7 deletions

View File

@@ -42,10 +42,17 @@
</div>
<nav class="pagination">
{% if current_offset > 0 %}
<a href="/?offset={{ current_offset - limit }}">&larr; Prev</a>
<a href="/?offset={{ current_offset - limit }}" class="page-nav">&larr; Prev</a>
{% endif %}
{% for p in (0..total_pages) %}
{% if p == current_page %}
<span class="page-num current">{{ p + 1 }}</span>
{% else %}
<a href="/?offset={{ p * limit }}" class="page-num">{{ p + 1 }}</a>
{% endif %}
{% endfor %}
{% if has_more %}
<a href="/?offset={{ current_offset + limit }}">Next &rarr;</a>
<a href="/?offset={{ current_offset + limit }}" class="page-nav">Next &rarr;</a>
{% endif %}
</nav>
{% endblock %}