mirror of
https://github.com/netbox-community/netbox.git
synced 2025-07-16 04:02:52 -06:00
Merge branch '9583-add_column_specific_search_field_to_tables' of https://github.com/netbox-community/netbox into 9583-add_column_specific_search_field_to_tables
This commit is contained in:
commit
762ebe23f9
@ -66,9 +66,10 @@ Context:
|
||||
|
||||
{# Object list tab #}
|
||||
<div class="tab-pane show active" id="object-list" role="tabpanel" aria-labelledby="object-list-tab">
|
||||
|
||||
{# Applied filters #}
|
||||
{% applied_filters model filter_form request.GET %}
|
||||
{% if not request.htmx %}
|
||||
{# Applied filters #}
|
||||
{% applied_filters model filter_form request.GET %}
|
||||
{% endif %}
|
||||
|
||||
{# Object table controls #}
|
||||
{% include 'inc/table_controls_htmx.html' with table_modal="ObjectTable_config" %}
|
||||
|
@ -3,8 +3,10 @@
|
||||
{% load buttons %}
|
||||
{% load render_table from django_tables2 %}
|
||||
|
||||
{# OOB Swaps to update various components #}
|
||||
{% applied_filters model filter_form request.GET %}
|
||||
{% if request.htmx %}
|
||||
{# OOB Swaps to update various components #}
|
||||
{% applied_filters model filter_form request.GET %}
|
||||
{% endif %}
|
||||
|
||||
<div class="htmx-container table-responsive">
|
||||
{% with preferences|get_key:"pagination.placement" as paginator_placement %}
|
||||
|
@ -134,7 +134,7 @@ def render_table_filter_field(fieldname, table, request):
|
||||
field = None
|
||||
|
||||
# Does this table have a filterset form?
|
||||
if table.filterset_form is not None:
|
||||
if hasattr(table, 'filterset_form') and table.filterset_form is not None:
|
||||
# Get the filterset field
|
||||
field = get_filter_field(table.filterset_form, fieldname)
|
||||
|
||||
|
@ -270,6 +270,8 @@ def applied_filters(context, model, form, query_params):
|
||||
Display the active filters for a given filter form.
|
||||
"""
|
||||
user = context['request'].user
|
||||
if not form:
|
||||
return
|
||||
form.is_valid() # Ensure cleaned_data has been set
|
||||
|
||||
applied_filters = []
|
||||
@ -304,6 +306,7 @@ def applied_filters(context, model, form, query_params):
|
||||
save_link = f"{url}?object_types={object_type}¶meters={quote(parameters)}"
|
||||
|
||||
return {
|
||||
'request': context['request'],
|
||||
'applied_filters': applied_filters,
|
||||
'save_link': save_link,
|
||||
}
|
||||
|
@ -25,8 +25,6 @@ check_dist() {
|
||||
if [[ $diff != "" ]]; then
|
||||
local SHA=$(git rev-parse HEAD)
|
||||
echo "Commit '$SHA' produced different static assets than were committed"
|
||||
echo $diff
|
||||
echo $(git diff $DIST)
|
||||
exit 1
|
||||
fi
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user