{% load string_filters %} {% comment %} Use message tags to control these alerts. Available tags include: - safe: allow HTML in the message - block: for longer messages - this adds extra padding - noicon: don't show an icon - error/success/info - these change the connotation of the alert {% endcomment %} {% if messages %} {% for message in messages %}
×
{# Allow HTML to be embedded in messages #} {% if 'safe' in message.tags %} {{ message|safe }} {% else %} {{ message }} {% endif %} {% if 'noicon' not in message.tags %} {# Include an icon by default #} {% if 'success' in message.tags %} {% elif 'info' in message.tags %} {% elif 'warning' in message.tags %} {% elif 'danger' in message.tags or 'error' in message.tags %} {% endif %} {% endif %}
{% endfor %} {% endif %}