From c91aec06988f9c658971081a4423c782111d7685 Mon Sep 17 00:00:00 2001 From: Jeremy Stretch Date: Thu, 4 Jan 2024 16:30:45 -0500 Subject: [PATCH] Clean up paginator styling --- netbox/templates/htmx/table.html | 4 +- netbox/templates/inc/paginator.html | 132 ++++++++++++++++------- netbox/templates/inc/paginator_htmx.html | 75 ------------- 3 files changed, 98 insertions(+), 113 deletions(-) delete mode 100644 netbox/templates/inc/paginator_htmx.html diff --git a/netbox/templates/htmx/table.html b/netbox/templates/htmx/table.html index 8d56a4427..1ad1a7bc1 100644 --- a/netbox/templates/htmx/table.html +++ b/netbox/templates/htmx/table.html @@ -4,10 +4,10 @@ {% with preferences|get_key:"pagination.placement" as paginator_placement %} {% if paginator_placement == 'top' or paginator_placement == 'both' %} - {% include 'inc/paginator_htmx.html' with table=table paginator=table.paginator page=table.page %} + {% include 'inc/paginator.html' with htmx=True table=table paginator=table.paginator page=table.page %} {% endif %} {% render_table table 'inc/table_htmx.html' %} {% if paginator_placement != 'top' %} - {% include 'inc/paginator_htmx.html' with table=table paginator=table.paginator page=table.page %} + {% include 'inc/paginator.html' with htmx=True table=table paginator=table.paginator page=table.page %} {% endif %} {% endwith %} diff --git a/netbox/templates/inc/paginator.html b/netbox/templates/inc/paginator.html index b3a9127c2..1d122cf7a 100644 --- a/netbox/templates/inc/paginator.html +++ b/netbox/templates/inc/paginator.html @@ -1,55 +1,115 @@ {% load helpers %} {% load i18n %} -
-
- {# Page number carousel #} - {% if paginator.num_pages > 1 %} -
+
+ + {# Pages carousel #} + {% if paginator.num_pages > 1 %} +
- {% endif %} -
-
- {# Per-page count selector #} + {# /Next page #} + + + + {% endif %} + {# /Pages carousel #} + + {# Showing #} + + {% blocktrans trimmed with start=page.start_index end=page.end_index total=page.paginator.count %} + Showing {{ start }}-{{ end }} of {{ total }} + {% endblocktrans %} + + {# /Showing #} + + {# Pagination options #} +
+ + {# /Pagination options #} +
diff --git a/netbox/templates/inc/paginator_htmx.html b/netbox/templates/inc/paginator_htmx.html deleted file mode 100644 index 967b9d003..000000000 --- a/netbox/templates/inc/paginator_htmx.html +++ /dev/null @@ -1,75 +0,0 @@ -{% load helpers %} -{% load i18n %} - -
-
- {# Page number carousel #} - {% 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 %} -
-
- {# Per-page count selector #} - {% if page %} - - - {% blocktrans trimmed with start=page.start_index end=page.end_index total=page.paginator.count %} - Showing {{ start }}-{{ end }} of {{ total }} - {% endblocktrans %} - - {% endif %} -
-