{% extends "layouts/workspace_settings.html" %} {% load static %} {% block title %}Inbox rules · DemandTrail Messaging{% endblock %} {% block content_wrap %}{% endblock %} {% comment %} `editorOpen` hides the header's primary while the editor is on screen: the editor carries its own "Save rule" primary, and two orange buttons on one page is two calls to action. It flips on the htmx swap that fills #inbox-rule-editor, which is the only signal there is — that partial arrives long after Alpine booted. **And it has to flip back, which is the whole reason the second handler exists.** inbox:rule_save answers with toast_response — a 204 — so htmx swaps nothing and the saved form just sits there. A flag set on open and never reset left the header button hidden for the rest of the session, with no way to start a second rule short of reloading. Two guards on that handler, both load-bearing. `bbChanged` rather than `detail.successful`, because a *refused* save is also a 204 and closing the editor on one would throw away the correction the operator is part-way through — only the success path sets inboxRulesChanged. And `$refs.editor.contains(...)`, because this listener sees every htmx request in the page: without it, deleting some other rule from its row menu would wipe the editor somebody is typing in. {% endcomment %} {% block content %}
Triggers stop at the first match. Rules do not: every rule that matches applies, in the order below.
{% include "inbox/_rule_rows.html" %}
{% endblock %} {% block extra_head %} {{ block.super }} {% comment %} The condition builder's date rules use flatpickr, as the contact list's do. {% endcomment %} {% endblock %} {% block alpine_components %} {{ block.super }} {% comment %} The §11.4 builder's component, defined here rather than in the editor partial: x-data can only call a factory that already exists, and the partial arrives by htmx swap long after Alpine booted. Same placement contacts/list.html uses, for the same reason. {% endcomment %} {% include "contacts/_filter_bar_script.html" %} {% include "partials/_list_behaviours.html" %} {% endblock %}