diff --git a/netbox/netbox/views/generic/bulk_views.py b/netbox/netbox/views/generic/bulk_views.py index c8636b4de..6f4608730 100644 --- a/netbox/netbox/views/generic/bulk_views.py +++ b/netbox/netbox/views/generic/bulk_views.py @@ -198,13 +198,9 @@ class ObjectListView(BaseMultiObjectView, ActionsMixin, TableMixin): # Hide selection checkboxes if 'pk' in table.base_columns: table.columns.hide('pk') - filter_chits = render_to_string('inc/applied_filters_pane.html', { - 'model': model, - 'filter_form': filterset_form, - }, request) return render(request, 'htmx/table.html', { 'table': table, - 'filter_chits': filter_chits, + 'filter_form': filterset_form, 'model': model, 'actions': actions, }) diff --git a/netbox/templates/generic/object_list.html b/netbox/templates/generic/object_list.html index 2edf77ffc..23df06f12 100644 --- a/netbox/templates/generic/object_list.html +++ b/netbox/templates/generic/object_list.html @@ -68,7 +68,7 @@ Context:
{# Applied filters #} - {% include 'inc/applied_filters_pane.html' %} + {% applied_filters model form_filter request.GET %} {# Object table controls #} {% include 'inc/table_controls_htmx.html' with table_modal="ObjectTable_config" %} diff --git a/netbox/templates/htmx/table.html b/netbox/templates/htmx/table.html index 9639eec39..d23d3640b 100644 --- a/netbox/templates/htmx/table.html +++ b/netbox/templates/htmx/table.html @@ -4,7 +4,7 @@ {% load render_table from django_tables2 %} {# OOB Swaps to update various components #} -{{ filter_chits }} +{% applied_filters model form_filter request.GET %}
{% with preferences|get_key:"pagination.placement" as paginator_placement %} diff --git a/netbox/templates/inc/applied_filters_pane.html b/netbox/templates/inc/applied_filters_pane.html deleted file mode 100644 index 073606ccf..000000000 --- a/netbox/templates/inc/applied_filters_pane.html +++ /dev/null @@ -1,8 +0,0 @@ -{% load helpers %} - -
- {# Applied filters #} - {% if filter_form %} - {% applied_filters model filter_form request.GET %} - {% endif %} -
diff --git a/netbox/utilities/templates/helpers/applied_filters.html b/netbox/utilities/templates/helpers/applied_filters.html index 6e2b10e11..0e23a3cd6 100644 --- a/netbox/utilities/templates/helpers/applied_filters.html +++ b/netbox/utilities/templates/helpers/applied_filters.html @@ -1,20 +1,22 @@ {% load i18n %} -{% if applied_filters %} -
- {% for filter in applied_filters %} - - {{ filter.link_text }} - - {% endfor %} - {% if applied_filters|length > 1 %} - - {% trans "Clear all" %} - - {% endif %} - {% if save_link %} - - {% trans "Save" %} - - {% endif %} -
-{% endif %} +
+ {% if applied_filters %} +
+ {% for filter in applied_filters %} + + {{ filter.link_text }} + + {% endfor %} + {% if applied_filters|length > 1 %} + + {% trans "Clear all" %} + + {% endif %} + {% if save_link %} + + {% trans "Save" %} + + {% endif %} +
+ {% endif %} +
\ No newline at end of file diff --git a/netbox/utilities/templatetags/form_helpers.py b/netbox/utilities/templatetags/form_helpers.py index cae15839c..ed33b09b1 100644 --- a/netbox/utilities/templatetags/form_helpers.py +++ b/netbox/utilities/templatetags/form_helpers.py @@ -57,6 +57,7 @@ def widget_type(field): # Inclusion tags # + @register.inclusion_tag('form_helpers/render_fieldset.html') def render_fieldset(form, fieldset): """