rpiwebapp-public/templates/pagination.html
Matthew Welch 2cd339f731 Added pagination.
Pagination has been added so that the amount of items on each page is a reasonable amount.
2019-07-25 00:08:58 -07:00

19 lines
754 B
HTML

{% with page_count=(item_count/max_items)|round(method="ceil")|int %}
{% if page_count > 1 %}
<nav aria-label="Page navigation example" style="display: inline-block; margin: 5px">
<form method="get" action="">
{% for key in request.args.keys() %}
{% if key != "page" %}<input type="hidden" name="{{ key }}" value="{{ request.args.get(key) }}">{% endif %}
{% endfor %}
<ul class="pagination">
{% for i in range(1, page_count+1) %}
<li class="page-item{% if page == i %} active{% endif %}">
<button name="page" value="{{ i }}" class="page-link">{{ i }}</button>
</li>
{% endfor %}
</ul>
</form>
</nav>
{% endif %}
{% endwith %}