From 863fb9aa47cc961abf06290a548cecbc4db2939b Mon Sep 17 00:00:00 2001 From: jeremystretch Date: Tue, 14 Dec 2021 20:53:24 -0500 Subject: [PATCH] Sync HTMX and non-HTMX paginator styles --- netbox/templates/inc/paginator.html | 87 ++++++++++++------------ netbox/templates/inc/paginator_htmx.html | 7 ++ 2 files changed, 51 insertions(+), 43 deletions(-) diff --git a/netbox/templates/inc/paginator.html b/netbox/templates/inc/paginator.html index 8242ffcde..eb349ead5 100644 --- a/netbox/templates/inc/paginator.html +++ b/netbox/templates/inc/paginator.html @@ -1,51 +1,52 @@ {% load helpers %} -
+
+
+ {# Page number carousel #} {% if paginator.num_pages > 1 %} -
- {% if page.has_previous %} - +
+ {% 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 %} - - {% endfor %} - {% endif %} + {% for p in page.smart_pages %} + {% if p %} + + {{ p }} + + {% else %} + + {% endif %} {% endfor %} -
- - -
-
- {% if page %} - - Showing {{ page.start_index }}-{{ page.end_index }} of {{ page.paginator.count }} - + {% if page.has_next %} + + + + {% endif %} +
{% endif %} +
+
+ {# Per-page count selector #} + + {% if page %} + + Showing {{ page.start_index }}-{{ page.end_index }} of {{ page.paginator.count }} + + {% endif %} +
diff --git a/netbox/templates/inc/paginator_htmx.html b/netbox/templates/inc/paginator_htmx.html index 75a904a15..c78361490 100644 --- a/netbox/templates/inc/paginator_htmx.html +++ b/netbox/templates/inc/paginator_htmx.html @@ -2,6 +2,7 @@
+ {# Page number carousel #} {% if paginator.num_pages > 1 %}
{% if page.has_previous %} @@ -44,6 +45,7 @@ {% endif %}
+ {# Per-page count selector #} + {% if page %} + + Showing {{ page.start_index }}-{{ page.end_index }} of {{ page.paginator.count }} + + {% endif %}