{# Filter-form shell: collapsible
wrapper, active-count badge, inline "Clear filters" link in the summary, auto-submit-on- change script, and the 4-column responsive grid every filter form in the audit uses. Pair with ``_filter_select.html`` and ``_filter_text.html`` for the individual controls inside the form body. Parameters: - action (str) form action URL - clear_href (str) URL for the "Clear filters" link (typically the action URL with no query string) - signals (list) iterable of active-signal values - any non-empty / non-None entry counts toward the "+N active" badge - hidden (dict, optional) name -> value hidden fields (eg. sort / direction so they round-trip) Call style: use Jinja's ``{% call ... %}`` block to pass the controls as the macro body. See opportunities/_filter_controls.html for an end-to-end example. #} {%- macro filter_form(action, clear_href, signals, hidden=None) -%} {%- set _active_count = (signals | reject('equalto', '') | reject('equalto', None) | list | length) -%}
0 %} open{% endif %}> Filters {%- if _active_count > 0 %} {{ _active_count }} active {%- endif %} {%- if _active_count > 0 %} Clear filters {%- endif %}
{{ caller() }} {%- if hidden %} {%- for name, value in hidden.items() %} {%- endfor %} {%- endif %}
{%- endmacro %}