{% from "quite_admin/_icons.html" import filter_icon %} {% from "quite_admin/_controls.html" import field_options, field_attributes with context %}
{{ filter_icon() }}
{% if filter_errors %}{% endif %}
{% set labels = {'eq': 'Equals', 'ne': 'Does not equal', 'icontains': 'Contains', 'not_icontains': 'Does not contain', 'istartswith': 'Starts with', 'iendswith': 'Ends with', 'in': 'Is one of', 'on': 'On date', 'gt': 'Greater than', 'gte': 'At least', 'lt': 'Less than', 'lte': 'At most', 'is_null': 'Empty values', 'is_empty': 'Is empty text'} %} {% for field in filter_fields %} {% set state = namespace(open=false) %}{% for name, pair in filter_parameters.items() if pair[0].name == field.name %}{% if filter_values.get(name) or filter_errors.get(name) %}{% set state.open=true %}{% endif %}{% endfor %}
{{ field.label }} {% for name, pair in filter_parameters.items() if pair[0].name == field.name %}{% set op = pair[1] %} {% if op in ('is_null','is_empty') %} {% elif op == 'in' %} {% elif (field.kind == 'boolean' or field.choices) and op in ('eq','ne') %} {% else %}{% endif %} {% if filter_errors.get(name) %}

{{ t(filter_errors[name]) }}

{% endif %} {% endfor %}
{% endfor %} {% for editor in relation_filters %}
{% endfor %}