only create the control if the page number is in the paginator range

This commit is contained in:
Tom Bernens 2020-06-01 17:20:11 -07:00
parent c854ff764a
commit a85223e7a5

View File

@ -53,7 +53,7 @@
{% with ticket_list.number|add:forloop.counter|add:"-5" as i %} {% 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 ticket_list.pages%} {% else if i in ticket_list.paginator.page_range %}
<li><a href="?{{ page_var }}={{ i }}">{{ i }}</a></li> <li><a href="?{{ page_var }}={{ i }}">{{ i }}</a></li>
{% endif %} {% endif %}
{% endfor %} {% endfor %}