mirror of
https://github.com/netbox-community/netbox.git
synced 2025-12-12 11:29:36 -06:00
Add guard for FilterModifierWidget with no lookups
This commit is contained in:
parent
575dcea478
commit
197f94a6ef
@ -1,13 +1,15 @@
|
|||||||
<div class="d-flex filter-modifier-group">
|
<div class="d-flex filter-modifier-group">
|
||||||
{# Modifier dropdown - NO name attribute, just a UI control #}
|
{% if widget.lookups %}
|
||||||
<select class="form-select modifier-select"
|
{# Modifier dropdown - NO name attribute, just a UI control #}
|
||||||
data-field="{{ widget.field_name }}"
|
<select class="form-select modifier-select"
|
||||||
data-empty-placeholder="{{ widget.empty_placeholder }}"
|
data-field="{{ widget.field_name }}"
|
||||||
aria-label="Modifier">
|
data-empty-placeholder="{{ widget.empty_placeholder }}"
|
||||||
{% for lookup, label in widget.lookups %}
|
aria-label="Modifier">
|
||||||
<option value="{{ lookup }}"{% if widget.current_modifier == lookup %} selected{% endif %}>{{ label }}</option>
|
{% for lookup, label in widget.lookups %}
|
||||||
{% endfor %}
|
<option value="{{ lookup }}"{% if widget.current_modifier == lookup %} selected{% endif %}>{{ label }}</option>
|
||||||
</select>
|
{% endfor %}
|
||||||
|
</select>
|
||||||
|
{% endif %}
|
||||||
|
|
||||||
{# Original widget - rendered exactly as it would be without our wrapper #}
|
{# Original widget - rendered exactly as it would be without our wrapper #}
|
||||||
<div class="ms-2 flex-grow-1 filter-value-container">
|
<div class="ms-2 flex-grow-1 filter-value-container">
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user