Sfoglia il codice sorgente

Fixes #15944: Extend paginator template to be aware of placement

Jeremy Stretch 1 anno fa
parent
commit
a9b311b100
2 ha cambiato i file con 2 aggiunte e 2 eliminazioni
  1. 1 1
      netbox/templates/htmx/table.html
  2. 1 1
      netbox/templates/inc/paginator.html

+ 1 - 1
netbox/templates/htmx/table.html

@@ -4,7 +4,7 @@
 
 {% with preferences|get_key:"pagination.placement" as paginator_placement %}
   {% if paginator_placement == 'top' or paginator_placement == 'both' %}
-    {% include 'inc/paginator.html' with htmx=True table=table paginator=table.paginator page=table.page %}
+    {% include 'inc/paginator.html' with htmx=True table=table paginator=table.paginator page=table.page placement='top' %}
   {% endif %}
   {% render_table table 'inc/table_htmx.html' %}
   {% if paginator_placement != 'top' %}

+ 1 - 1
netbox/templates/inc/paginator.html

@@ -3,7 +3,7 @@
 
 {% if page %}
   <div
-      class="d-flex justify-content-between align-items-center border-top p-2"
+      class="d-flex justify-content-between align-items-center border-{% if placement == 'top' %}bottom{% else %}top{% endif %} p-2"
       hx-target="closest .htmx-container"
       hx-disinherit="hx-select hx-swap"
       {% if not table.embedded %}hx-push-url="true"{% endif %}