mirror of https://github.com/snachodog/mybuddy.git
Limit paginator links to next and previous two pages.
This commit is contained in:
parent
ab1b9ee7a8
commit
8f9a756fa2
|
@ -12,9 +12,11 @@
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
{% for num in page_obj.paginator.page_range %}
|
{% for num in page_obj.paginator.page_range %}
|
||||||
<li class="page-item{% if num == page_obj.number %} active{% endif %}">
|
{% if num > page_obj.number|add:"-3" and num < page_obj.number|add:"3" %}
|
||||||
<a class="page-link" href="?page={{ num }}">{{ num }}</a>
|
<li class="page-item{% if num == page_obj.number %} active{% endif %}">
|
||||||
</li>
|
<a class="page-link" href="?page={{ num }}">{{ num }}</a>
|
||||||
|
</li>
|
||||||
|
{% endif %}
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
|
|
||||||
{% if page_obj.has_next %}
|
{% if page_obj.has_next %}
|
||||||
|
|
Loading…
Reference in New Issue