{% extends "holdfast/base.html" %} {% load i18n %} {% block holdfast_brand %}{% translate "Webhooks" %}{% endblock %} {% block holdfast_content %}
{% blocktranslate %}The Discord channels alerts can be posted to. Which alert goes to which channel is chosen on each section's settings page; a category nobody has routed there goes to every enabled webhook. A webhook Discord says was deleted, or whose token it rejects, is switched off here with the reason. The URL is a credential, which is why only section managers see this page, and why it is never shown in full once saved.{% endblocktranslate %}
{% include "holdfast/partials/_stranded.html" %} {% if not webhooks %}
{% translate "No webhooks yet. Add one below, then route alerts to it on each section's settings page." %}
{% else %}
{% for webhook in webhooks %} {# Masked: the URL is the channel's password. #} {% endfor %}
{% translate "Name" %} {% translate "URL" %} {% translate "Enabled" %} {% translate "Ping" %} {% translate "Groups" %} {% translate "Notes" %}
{{ webhook.name }}{{ webhook.masked_url }} {% if webhook.is_enabled %} {% translate "yes" %} {% else %} {% translate "no" %} {% if webhook.disabled_reason %}
{{ webhook.disabled_reason }}{% if webhook.disabled_at %} ({{ webhook.disabled_at|date:"Y-m-d H:i" }} EVE){% endif %}
{% endif %} {% endif %}
{{ webhook.get_ping_type_display }} {{ webhook.ping_groups.all|join:", "|default:"-" }} {{ webhook.notes }} {% translate "Edit" %}
{% csrf_token %}
{% csrf_token %}
{% endif %}
{% if editing %}{% translate "Edit" %} {{ editing.name }}{% else %}{% translate "Add a webhook" %}{% endif %}
{% csrf_token %} {% for error in form.non_field_errors %}
{{ error }}
{% endfor %}
{{ form.name }} {% for error in form.name.errors %}
{{ error }}
{% endfor %}
{{ form.url }}
{{ form.url.help_text }}
{% for error in form.url.errors %}
{{ error }}
{% endfor %}
{{ form.ping_type }} {% for error in form.ping_type.errors %}
{{ error }}
{% endfor %}
{{ form.ping_groups }}
{{ form.ping_groups.help_text }} {% translate "Ctrl-click to pick several." %}
{% for error in form.ping_groups.errors %}
{{ error }}
{% endfor %}
{{ form.notes }}
{{ form.is_enabled }}
{% if editing %} {% translate "Cancel" %} {% endif %}
{% endblock %}