{# Trigger list + add controls for one automation. Included by automations.html on first render and re-rendered in place by the automations_triggers HTMX endpoint (single endpoint, action via hx-vals). Expects: triggers, slug, events, error. The schedule add UI is the cron editor component (components/cron_builder.js): the
mount renders itself and keeps a hidden `cron` input the server validates. Existing schedule rows carry data-cron and the component fills the friendly text (the raw cron shown here is the no-JS fallback). Editing a schedule = delete + re-add. #}
{% if error %}

{{ error }}

{% endif %} {% if triggers %}
    {% for trigger in triggers %}
  • {% if trigger.trigger_type == 'schedule' %} {{ _("Schedule") }} {{ trigger.cron }} {% else %} {{ _("Event") }} {{ events.get(trigger.event_type, trigger.event_type) }} {% endif %} {% if trigger.trigger_type == 'schedule' %} {% endif %}
  • {% endfor %}
{% else %}

{{ _("No triggers — this automation won't run until one is added.") }}

{% endif %} {# Two entry points; each reveals its own panel (one at a time). automations.js (initTriggerEditor) toggles .adding-schedule / .adding-event on this container and drives the cron builder; a row's Edit reuses the schedule panel pre-populated. #}

{{ _("Add a schedule") }}

{{ _("Add an event trigger") }}