mirror of
https://github.com/r4sas/py-i2phosts
synced 2025-02-02 01:44:40 +00:00
Simplify pagination in browse.html
Our old pagination is incompatible with new class-based generic views, so switch to internal django pagination for some time.
This commit is contained in:
parent
76ee7dbd0e
commit
84836a5079
@ -16,7 +16,20 @@
|
|||||||
</table>
|
</table>
|
||||||
|
|
||||||
{% if is_paginated %}
|
{% if is_paginated %}
|
||||||
{% load paginator %}{% paginator 3 %}
|
<div class="pager">
|
||||||
|
{% if page_obj.has_previous %}
|
||||||
|
<span class="page">
|
||||||
|
<a href="?page={{ page_obj.previous_page_number }}">< Prev</a>
|
||||||
|
</span>
|
||||||
|
{% endif %}
|
||||||
|
|
||||||
|
<span class="current">Page {{ page_obj.number }} of {{ paginator.num_pages }}</span>
|
||||||
|
|
||||||
|
{% if page_obj.has_next %}
|
||||||
|
<span class="page"><a href="?page={{ page_obj.next_page_number }}">Next ></a></span>
|
||||||
|
{% endif %}
|
||||||
|
{{ paginator.count }} {% trans "hosts total" %}
|
||||||
|
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user