{% extends 'base.html' %} {% block extrahead %} {% load static %} {% load custom_tags_and_filters %} {% endblock %} {% block title %}Alerts{% endblock %} {% block content %}

Alerts

{% if form.non_field_errors %}
{{ form.non_field_errors }}
{% endif %}

You can create and edit alerts that will be visible to everyone. The alert will only be visible after the debut time and will be deleted after the expiration time. (HTML syntax is allowed).

{% if editing %} Edit this alert {% else %} Create a new alert {% endif %}

{% csrf_token %} {% if form.instance.id %}{% endif %}
{% if form.title.errors %}- {{ form.title.errors }}{% endif %}
{% if alert_categories %}
{% if form.category.errors %}- {{ form.category.errors|striptags }}{% endif %}
{% endif %}
{% if form.contents.errors %}- {{ form.contents.errors|striptags }}{% endif %}
{% if form.debut_time.errors %}- {{ form.debut_time.errors|striptags }}{% endif %}
{% if form.expiration_time.errors %} - {{ form.expiration_time.errors|striptags }} {% endif %}
{% button type="save" value=editing|yesno:"Save changes,Create alert" %}
{% for a in alerts %}
{% csrf_token %}
{% if a.title %} {{ a.title }}
{% endif %} {{ a.contents|safe|linebreaksbr }}

Debuts on {{ a.debut_time }}
{% if a.expiration_time %} Expires on {{ a.expiration_time }} {% else %} This alert will never expire {% endif %}
{% endfor %}
{% endblock %}