-
Notifications
You must be signed in to change notification settings - Fork 0
/
pagination.html
38 lines (35 loc) · 1.54 KB
/
pagination.html
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
{% if page_count > 1 %}
<nav aria-label="page navigation" class="my-5 mx-auto">
<ul class="pagination">
{% if page == 1 %}
<li class="page-item disabled">
<a class="page-link" href="" tabindex="-1" aria-disabled="true">Previous</a>
</li>
{% else %}
<li class="page-item">
<a class="page-link" href="?p={{ page - 1 }}{% if q %}&q={{ q }}{% endif %}" tabindex="-1" aria-disabled="true">Previous</a>
</li>
{% endif %}
{% for p in page_range_view %}
{% if p < page %}
<li class="page-item"><a class="page-link" href="?p={{ p }}{% if q %}&q={{ q }}{% endif %}">{{ p }}</a></li>
{% elif p == page %}
<li class="page-item active" aria-current="page">
<a class="page-link" href="#">{{ page }} <span class="sr-only">(current)</span></a>
</li>
{% else %}
<li class="page-item"><a class="page-link" href="?p={{ p }}{% if q %}&q={{ q }}{% endif %}">{{ p }}</a></li>
{% endif %}
{% endfor %}
{% if page == page_count %}
<li class="page-item disabled">
<a class="page-link" href="#">Next</a>
</li>
{% else %}
<li class="page-item">
<a class="page-link" href="?p={{ page + 1 }}{% if q %}&q={{ q }}{% endif %}">Next</a>
</li>
{% endif %}
</ul>
</nav>
{% endif %}