diff --git a/netbox/templates/generic/object_list.html b/netbox/templates/generic/object_list.html index 8cc23637b..e94236ee9 100644 --- a/netbox/templates/generic/object_list.html +++ b/netbox/templates/generic/object_list.html @@ -40,56 +40,53 @@
{% with bulk_edit_url=content_type.model_class|validated_viewname:"bulk_edit" bulk_delete_url=content_type.model_class|validated_viewname:"bulk_delete" %} - {% if permissions.change or permissions.delete %} -
- {% csrf_token %} - - {% if table.paginator.num_pages > 1 %} - + {% if permissions.change or permissions.delete %} + + {% csrf_token %} + + {% if table.paginator.num_pages > 1 %} +
{% include 'inc/paginator.html' with paginator=table.paginator page=table.page %}
diff --git a/netbox/templates/inc/paginator.html b/netbox/templates/inc/paginator.html index 10fc238cd..22a6a5420 100644 --- a/netbox/templates/inc/paginator.html +++ b/netbox/templates/inc/paginator.html @@ -2,25 +2,31 @@
{% if paginator.num_pages > 1 %} - +
+ {% if page.has_previous %} + + + {% endif %} -
+ {% for p in page.smart_pages %} + {% if p %} + + {{ p }} + + {% else %} + + {% endif %} + {% endfor %} + {% if page.has_next %} + + + + {% endif %} +
+ {% endif %} + {% for k, v_list in request.GET.lists %} {% if k != 'per_page' %} {% for v in v_list %} @@ -28,7 +34,7 @@ {% endfor %} {% endif %} {% endfor %} -
+
- {% comment %} per page {% endcomment %} {% if page %} -
- Showing {{ page.start_index }}-{{ page.end_index }} of {{ page.paginator.count }} -
+ + Showing {{ page.start_index }}-{{ page.end_index }} of {{ page.paginator.count }} + {% endif %}