mirror of
https://github.com/netbox-community/netbox.git
synced 2026-01-09 13:22:18 -06:00
Added custom field support to filter forms
This commit is contained in:
@@ -1,27 +1,32 @@
|
||||
{% load form_helpers %}
|
||||
|
||||
<div class="panel panel-default">
|
||||
<div class="panel-heading">
|
||||
<span class="fa fa-filter" aria-hidden="true"></span>
|
||||
<strong>Filter</strong>
|
||||
</div>
|
||||
<div class="panel-body">
|
||||
<form action="." method="get" class="form">
|
||||
{% for field in filter_form %}
|
||||
<div class="form-group">
|
||||
{% if field|widget_type == 'checkboxinput' %}
|
||||
<label for="{{ field.id_for_label }}">{{ field }} {{ field.label }}</label>
|
||||
{% else %}
|
||||
{{ field.label_tag }}
|
||||
{{ field }}
|
||||
{% endif %}
|
||||
{% if filter_form %}
|
||||
<div class="panel panel-default">
|
||||
<div class="panel-heading">
|
||||
<span class="fa fa-filter" aria-hidden="true"></span>
|
||||
<strong>Filter</strong>
|
||||
</div>
|
||||
<div class="panel-body">
|
||||
<form action="." method="get" class="form">
|
||||
{% for field in filter_form %}
|
||||
<div class="form-group">
|
||||
{% if field|widget_type == 'checkboxinput' %}
|
||||
<label for="{{ field.id_for_label }}">{{ field }} {{ field.label }}</label>
|
||||
{% else %}
|
||||
{{ field.label_tag }}
|
||||
{{ field }}
|
||||
{% endif %}
|
||||
</div>
|
||||
{% endfor %}
|
||||
<div class="text-right">
|
||||
<button type="submit" class="btn btn-primary">
|
||||
<span class="fa fa-search" aria-hidden="true"></span> Apply
|
||||
</button>
|
||||
<a href="." class="btn btn-default">
|
||||
<span class="fa fa-remove" aria-hidden="true"></span> Clear
|
||||
</a>
|
||||
</div>
|
||||
{% endfor %}
|
||||
<div class="text-right">
|
||||
<button type="submit" class="btn btn-primary">
|
||||
<span class="fa fa-search" aria-hidden="true"></span> Apply filters
|
||||
</button>
|
||||
</div>
|
||||
</form>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
Reference in New Issue
Block a user