{# Form helpers for the console. Import with context so they can see the form token:
{% import "_macros.html" as m with context %} #}
{% macro guard(back) -%}
{%- endmacro %}
{# A form that posts to /ui/ and comes back to . Its fields are the caller's. #}
{% macro post(action, back, cls="inline") -%}
{%- endmacro %}
{# An on/off switch that is its own small form: pressing it posts the opposite value. #}
{% macro switch(action, back, on, label, fields, value_name="mcp", on_value="on", off_value="off", disabled=False, reason="", text=True) -%}
{%- endmacro %}
{# A destructive button that asks first, with no script: a panel opens on hover or focus. #}
{% macro confirm(action, back, label, question, yes, fields, icon="") -%}