{# One editable configuration section, as one swappable unit. Every state renders through this fragment - facts, editing, freshly saved, refused - so the settings page and the htmx swaps can never disagree about what a section looks like. The form itself is picked by section name, and the notifications section additionally lists its channels with a test button each. A refused save renders at 200 with the refusal inline and verbatim: htmx does not swap an error status, so answering 4xx would freeze the screen and report nothing. #} {% import "_macros.html" as m %}

{{ section.title }}

{% if section.problem %} {{ m.problem(section.problem.fix, section.problem.output) }} {% endif %} {% if section.notice %}

{{ section.notice }}

{% endif %} {% if section.test %} {% if section.test.error %} {{ m.problem("The " ~ section.test.channel ~ " test did not go out.", section.test.error) }} {% else %}

Test message sent through {{ section.test.channel }}.

{% endif %} {% endif %} {% if section.editing %} {% include "fragments/settings_form_" ~ section.name ~ ".html" %} {% else %} {{ m.facts(section.entries) }} {% if section.name == "notifications" %} {% include "fragments/notif_channels.html" %} {% endif %}
{% endif %}