I was over thinking that

This commit is contained in:
Tom Bernens 2020-06-01 17:47:54 -07:00
parent a85223e7a5
commit 9461705591

View File

@ -47,13 +47,12 @@
<li class="disabled"><span>&laquo;&laquo;</span></li> <li class="disabled"><span>&laquo;&laquo;</span></li>
<li class="disabled"><span>&laquo;</span></li> <li class="disabled"><span>&laquo;</span></li>
{% endif %} {% endif %}
<!-- Page - 5 to page + 5 controls --> <!-- other pages, set thresh to the number to show before and after active -->
{% with ''|center:11 as range %} {% with 5 as thresh %}
{% for _ in range %} {% for i in ticket_list.paginator.page_range %}
{% with ticket_list.number|add:forloop.counter|add:"-5" as i %}
{% if ticket_list.number == i %} {% if ticket_list.number == i %}
<li class="active"><span>{{ i }} <span class="sr-only">(current)</span></span></li> <li class="active"><span>{{ i }} <span class="sr-only">(current)</span></span></li>
{% else if i in ticket_list.paginator.page_range %} {% else if i <= ticket_list.number|add:5 and i >= ticket_list.number|-5 %}
<li><a href="?{{ page_var }}={{ i }}">{{ i }}</a></li> <li><a href="?{{ page_var }}={{ i }}">{{ i }}</a></li>
{% endif %} {% endif %}
{% endfor %} {% endfor %}