{# alerts/rules_form.html — a new rule, or one rule's own page (#5317): named for the rule, in three sections (what it watches, when it fires, what happens), then Delete at the foot, behind the confirm dialog, saying that its history goes with it. #} {% extends "base.html" %} {% from "_macros.html" import crumbs, page_header %} {% block title %}{{ rule.name if rule else "New alert rule" }} — Alerts — Steward{% endblock %} {% block breadcrumb %}{{ crumbs([("Alerts", "/alerts/"), (rule.name if rule else "New rule", "")]) }}{% endblock %} {% block content %}
{%- if not rule.enabled %}Off · {% endif -%} {%- if fired %}Last fired {{ fired|ago }}{% else %}Never fired{% endif -%} {%- if history_count is defined and history_count is not none %} · {{ history_count }} change{{ "s" if history_count != 1 }} of state on record{% endif -%}
{% else %} {{ page_header("New alert rule") }} {% endif %} {# ── Delete: on the rule's own page, never in the list (#5317) ─────────── #} {% if rule and session.user_role == 'admin' %}Its history goes with it{% if history_count %} ({{ history_count }} change{{ "s" if history_count != 1 }} of state){% endif %}. Disabling it on the Alerts page keeps the history.