diff --git a/netbox/templates/generic/object_list.html b/netbox/templates/generic/object_list.html index f05cc3f4d..1de818ef6 100644 --- a/netbox/templates/generic/object_list.html +++ b/netbox/templates/generic/object_list.html @@ -96,10 +96,7 @@ {# Object table #}
-
- {% render_table table 'inc/table_htmx.html' %} -
- {% include 'inc/paginator_htmx.html' with paginator=table.paginator page=table.page %} + {% include 'htmx/table.html' %}
diff --git a/netbox/templates/htmx/table.html b/netbox/templates/htmx/table.html index 711708e32..c5d0ac46b 100644 --- a/netbox/templates/htmx/table.html +++ b/netbox/templates/htmx/table.html @@ -1,4 +1,4 @@ -{# Render an HTML table element #} +{# Render an HTMX-enabled table with paginator #} {% load render_table from django_tables2 %} {% render_table table 'inc/table_htmx.html' %} diff --git a/netbox/templates/inc/table_htmx.html b/netbox/templates/inc/table_htmx.html index 7a20debae..bf8156c2b 100644 --- a/netbox/templates/inc/table_htmx.html +++ b/netbox/templates/inc/table_htmx.html @@ -1,47 +1,49 @@ {% load django_tables2 %} - - {% if table.show_header %} - - - {% for column in table.columns %} - {% if column.orderable %} - - {{ column.header }} - - {% else %} - {{ column.header }} - {% endif %} - {% endfor %} - - - {% endif %} - - {% for row in table.page.object_list|default:table.rows %} - - {% for column, cell in row.items %} - {{ cell }} - {% endfor %} - - {% empty %} - {% if table.empty_text %} +
+ + {% if table.show_header %} + - — {{ table.empty_text }} — + {% for column in table.columns %} + {% if column.orderable %} + + {{ column.header }} + + {% else %} + {{ column.header }} + {% endif %} + {% endfor %} - {% endif %} - {% endfor %} - - {% if table.has_footer %} - - - {% for column in table.columns %} - {{ column.footer }} - {% endfor %} - - - {% endif %} - + + {% endif %} + + {% for row in table.page.object_list|default:table.rows %} + + {% for column, cell in row.items %} + {{ cell }} + {% endfor %} + + {% empty %} + {% if table.empty_text %} + + — {{ table.empty_text }} — + + {% endif %} + {% endfor %} + + {% if table.has_footer %} + + + {% for column in table.columns %} + {{ column.footer }} + {% endfor %} + + + {% endif %} + +