{% comment %} Per-category Discord routing. Included by each section's settings page, which passes only its own categories. {% endcomment %} {% load i18n holdfast_tags %}
{% translate "Discord channels" %}
{% include "holdfast/partials/_stranded.html" with stranded=routes|stranded %} {% if not webhooks %}
{% url 'holdfast:webhooks' as webhooks_url %} {% blocktranslate %}No webhooks exist yet. Add them on the Webhooks page, then come back here to choose which alerts go where.{% endblocktranslate %}
{% else %}
{% blocktranslate %}Pick which channel each kind of alert goes to. One nobody has routed goes to every enabled webhook, so an upgrade never leaves you silently unalerted. Once channels are ticked it goes only there: if they are all deleted or switched off, it goes nowhere rather than to every channel, and this page says so. Untick them all to send it to every enabled webhook again.{% endblocktranslate %}
{# Without this the save leaves routing alone: the table was not on the page. #}
{% for route in routes %} {% endfor %}
{% translate "Alert" %} {% translate "Enabled" %} {% translate "Channels" %}
{{ route.get_category_display }} {% if route.is_stranded %} {% translate "goes nowhere" %} {% endif %}
{% for webhook in webhooks %}
{% endfor %} {% if route.is_stranded and not route.webhooks.all %} {# Its webhooks were deleted, so nothing shows ticked; leaving it so must not mean "everyone". #}
{% endif %}

{% blocktranslate %}Save first, then use Send test alerts below to fire one sample of each category down whatever routing is configured. It uses the same delivery path as a real alert, so anything that arrives really is wired up.{% endblocktranslate %}

{% endif %}