{#- Shared filter-form macros for the list views. GET filter forms render through form_open / field / form_close so the control row, the hidden store field (FR-003), and any preserved params stay uniform across views. POST forms keep the action-URL store transport (settings) and reuse only the field macros. `hx` turns the form into an htmx trigger: the form hx-gets its own action, serializing its fields (store and hidden filters ride the body), and morph-swaps the results region named by hx.target — so filtering is a fragment, never a navigation. `hx.trigger` carries the debounce ("input changed delay:300ms" for text fields, "change delay:300ms" for selects). The form element is only the trigger; it must live OUTSIDE the region it swaps or every swap would destroy the fields being typed into. -#} {% import "_links.html" as links with context %} {% macro form_open(action, hidden={}, hx=None, form_id='') -%}
{{ links.store_field() }} {%- for key, value in hidden.items() %} {%- endfor %} {%- endmacro %} {#- One labeled control: `kind` is an input type ("text", "number", ...) or "select" (with `options` as plain values, the active one marked). -#} {% macro field(kind, name, label, value='', options=(), placeholder='') -%} {%- endmacro %} {% macro form_close(submit='Apply') -%}
{%- endmacro %}