From 8197e83d9606df1ca793dbe75586e71ebe891440 Mon Sep 17 00:00:00 2001 From: Jeremy Stretch Date: Fri, 5 Jan 2024 15:51:18 -0500 Subject: [PATCH] Hide paginator for empty pages --- netbox/project-static/dist/netbox.css | Bin 543220 -> 543283 bytes .../styles/transitional/_tables.scss | 11 + netbox/templates/inc/paginator.html | 216 +++++++++--------- 3 files changed, 120 insertions(+), 107 deletions(-) diff --git a/netbox/project-static/dist/netbox.css b/netbox/project-static/dist/netbox.css index d07eb73c7be40fe423a6274e3202f5e4835eb616..664e218df2b81140c344dc51edd0617310d21155 100644 GIT binary patch delta 70 zcmew|S#k3e#fBEf7N!>F7M2#)7Pc1lEgaUKO8H4ysmUd}Ihn;J3MEPTDV265MOHb9 a#U;AQ8JRgLb|op(FAB4YO*ir6H~;{EzZn<+ delta 30 mcmdlyMe)mI#fBEf7N!>F7M2#)7Pc1lEgaUK)2lo=b^-vfr3$0~ diff --git a/netbox/project-static/styles/transitional/_tables.scss b/netbox/project-static/styles/transitional/_tables.scss index dc9dfdb7a..31bb69b13 100644 --- a/netbox/project-static/styles/transitional/_tables.scss +++ b/netbox/project-static/styles/transitional/_tables.scss @@ -1,3 +1,14 @@ +// Object list tables +table.object-list { + + // Hide border of last row + tbody > tr:last-child > td { + border-bottom-width: 0; + } + +} + +// Object attribute tables table.attr-table { // Restyle row header diff --git a/netbox/templates/inc/paginator.html b/netbox/templates/inc/paginator.html index 1d122cf7a..0a9128034 100644 --- a/netbox/templates/inc/paginator.html +++ b/netbox/templates/inc/paginator.html @@ -1,115 +1,117 @@ {% load helpers %} {% load i18n %} -
+{% if page %} +
- {# Pages carousel #} - {% if paginator.num_pages > 1 %} -
+ {# Next page #} + {% if page.has_next %} +
  • + {% if htmx %} + + + + {% else %} + + + + {% endif %} +
  • + {% endif %} + {# /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 #} + +
    +{% endif %}