{% load list_tags %} {% comment %} List-view toolbar — two-row layout: Row 1: search input (left) + export button (right, via ml-auto) Row 2: filter facet rail (full width, wraps internally) Args: facets (iterable|None) — passed straight to filter_facets.html search_param (str) — query key, default "q" search_placeholder (str|None) — input placeholder text search_value (str|None) — initial value; falls back to request.GET[search_param] export_url (bool|None) — render export button when truthy; pairs with CsvExportMixin export_disabled (bool|None) — render greyed-out export button (empty queryset) htmx_target (str|None) — CSS selector to swap on input/typing (live filter) hide_export (bool|None) — explicit suppression even if view supports CSV When `htmx_target` is provided, the search input fires `hx-get` with `hx-trigger="keyup changed delay:300ms"` and pushes the URL. {% endcomment %}
{# Top row: search (left) + export (right) #} {% if search_param or search_placeholder or export_url %}
{% if search_param or search_placeholder %} {% with sp=search_param|default:"q" %} {% endwith %} {% endif %} {% if export_url and not hide_export %}
{% include 'components/export_button.html' with disabled=export_disabled %}
{% endif %}
{% endif %} {# Second row: facet rail spans full width #} {% if facets %}
{% include 'components/filter_facets.html' with facets=facets %}
{% endif %}