1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
{# Tabler-style pagination. Expects: current_page, pagecount, has_prev, has_next, prev_url, next_url; optional: total_pages, page_links (list of (page_num, url) for numbered links). #}
<nav aria-label="Pagination" class="d-flex justify-content-between align-items-center mt-3">
<div class="text-secondary small">
Page {{ current_page }}{% if total_pages is defined and total_pages is not none %} of {{ total_pages }}{% endif %}
<span class="ms-2">({{ pagecount }} per page)</span>
</div>
<ul class="pagination mb-0">
<li class="page-item{% if not has_prev %} disabled{% endif %}">
{% if has_prev %}
<a class="page-link" href="{{ prev_url }}" aria-label="Previous">
<span aria-hidden="true">«</span>
</a>
{% else %}
<span class="page-link" aria-label="Previous" aria-disabled="true">
<span aria-hidden="true">«</span>
</span>
{% endif %}
</li>
{% if page_links is defined and page_links %}
{% for p, u in page_links %}
<li class="page-item{% if p == current_page %} active{% endif %}{% if not u %} disabled{% endif %}">
{% if u %}
<a class="page-link" href="{{ u }}">{{ p }}</a>
{% else %}
<span class="page-link">…</span>
{% endif %}
</li>
{% endfor %}
{% else %}
<li class="page-item active"><span class="page-link">{{ current_page }}</span></li>
{% endif %}
<li class="page-item{% if not has_next %} disabled{% endif %}">
{% if has_next %}
<a class="page-link" href="{{ next_url }}" aria-label="Next">
<span aria-hidden="true">»</span>
</a>
{% else %}
<span class="page-link" aria-label="Next" aria-disabled="true">
<span aria-hidden="true">»</span>
</span>
{% endif %}
</li>
</ul>
</nav>