mirror of
https://github.com/netbox-community/netbox.git
synced 2025-07-27 10:58:37 -06:00
Perform OOB swap for filter badges
This commit is contained in:
parent
35cff12974
commit
1c995fa5f9
@ -181,7 +181,9 @@ class ObjectListView(BaseMultiObjectView, ActionsMixin, TableMixin):
|
||||
if 'pk' in table.base_columns:
|
||||
table.columns.hide('pk')
|
||||
return render(request, 'htmx/table.html', {
|
||||
'model': model,
|
||||
'table': table,
|
||||
'filter_form': filterset_form,
|
||||
})
|
||||
|
||||
context = {
|
||||
|
@ -63,9 +63,7 @@ Context:
|
||||
<div class="tab-pane show active" id="object-list" role="tabpanel" aria-labelledby="object-list-tab">
|
||||
|
||||
{# Applied filters #}
|
||||
{% if filter_form %}
|
||||
{% applied_filters model filter_form request.GET %}
|
||||
{% endif %}
|
||||
{% include 'inc/applied_filters_pane.html' %}
|
||||
|
||||
{# Object table controls #}
|
||||
{% include 'inc/table_controls_htmx.html' with table_modal="ObjectTable_config" %}
|
||||
|
@ -2,6 +2,9 @@
|
||||
{% load helpers %}
|
||||
{% load render_table from django_tables2 %}
|
||||
|
||||
{# Applied filters #}
|
||||
{% include 'inc/applied_filters_pane.html' %}
|
||||
|
||||
{% 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 %}
|
||||
|
8
netbox/templates/inc/applied_filters_pane.html
Normal file
8
netbox/templates/inc/applied_filters_pane.html
Normal file
@ -0,0 +1,8 @@
|
||||
{% load helpers %}
|
||||
|
||||
<div id="applied_filters_pane" hx-swap-oob="true">
|
||||
{# Applied filters #}
|
||||
{% if filter_form %}
|
||||
{% applied_filters model filter_form request.GET %}
|
||||
{% endif %}
|
||||
</div>
|
Loading…
Reference in New Issue
Block a user