diff --git a/helpdesk/templates/helpdesk/include/tickets.html b/helpdesk/templates/helpdesk/include/tickets.html
index 1afa835a..b0fadca9 100644
--- a/helpdesk/templates/helpdesk/include/tickets.html
+++ b/helpdesk/templates/helpdesk/include/tickets.html
@@ -47,13 +47,12 @@
««
«
{% endif %}
-
- {% with ''|center:11 as range %}
- {% for _ in range %}
- {% with ticket_list.number|add:forloop.counter|add:"-5" as i %}
+
+ {% with 5 as thresh %}
+ {% for i in ticket_list.paginator.page_range %}
{% if ticket_list.number == i %}
{{ i }} (current)
- {% else if i in ticket_list.paginator.page_range %}
+ {% else if i <= ticket_list.number|add:5 and i >= ticket_list.number|-5 %}
{{ i }}
{% endif %}
{% endfor %}