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 %}
|
||||
|
||||
{% for num in page_obj.paginator.page_range %}
|
||||
<li class="page-item{% if num == page_obj.number %} active{% endif %}">
|
||||
<a class="page-link" href="?page={{ num }}">{{ num }}</a>
|
||||
</li>
|
||||
{% if num > page_obj.number|add:"-3" and num < page_obj.number|add:"3" %}
|
||||
<li class="page-item{% if num == page_obj.number %} active{% endif %}">
|
||||
<a class="page-link" href="?page={{ num }}">{{ num }}</a>
|
||||
</li>
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
|
||||
{% if page_obj.has_next %}
|
||||
|
|
Loading…
Reference in New Issue