From f64050a9f5e9f693219c61c14d11f40658b13f41 Mon Sep 17 00:00:00 2001 From: Arthur Hanson Date: Tue, 13 Aug 2024 14:30:57 +0700 Subject: [PATCH] 16756 don't duplicate code --- netbox/templates/extras/htmx/script_result.html | 17 +---------------- netbox/templates/htmx/table.html | 2 +- 2 files changed, 2 insertions(+), 17 deletions(-) diff --git a/netbox/templates/extras/htmx/script_result.html b/netbox/templates/extras/htmx/script_result.html index 8bdbf744b..49879e6a5 100644 --- a/netbox/templates/extras/htmx/script_result.html +++ b/netbox/templates/extras/htmx/script_result.html @@ -1,7 +1,6 @@ {% load helpers %} {% load log_levels %} {% load i18n %} -{% load render_table from django_tables2 %}

@@ -42,21 +41,7 @@

{% trans "Log" %}
- -
- {% 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 placement='top' %} - {% endif %} - {% render_table table 'inc/table_htmx.html' %} - {% if paginator_placement != 'top' %} - {% include 'inc/paginator.html' with htmx=True table=table paginator=table.paginator page=table.page %} - {% endif %} - {% endwith %} -
- -{# Include the updated object count for display elsewhere on the page #} -
{{ table.rows|length }}
+ {% include 'htmx/table.html' with no_htmx_container=True%}
{% endif %} diff --git a/netbox/templates/htmx/table.html b/netbox/templates/htmx/table.html index f93c86a34..86d9d4cb7 100644 --- a/netbox/templates/htmx/table.html +++ b/netbox/templates/htmx/table.html @@ -2,7 +2,7 @@ {% load helpers %} {% load render_table from django_tables2 %} -
+
{% 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 placement='top' %}