{% comment %}
# SPDX-License-Identifier: AGPL-3.0-or-later
{% endcomment %}

{% load i18n %}
{% load extras %}

{% for message in messages %}
  <div class="alert alert-{{ message.tags }} alert-dismissible
              d-flex align-items-center fade show"
       role="alert">
    <div class="me-2">
      {% if message.tags == 'danger' %}
        {% icon 'exclamation-triangle' %}
        <span class="visually-hidden">{% trans "Error:" %}</span>
      {% elif message.tags == 'warning' %}
        {% icon 'exclamation-triangle' %}
        <span class="visually-hidden">{% trans "Caution:" %}</span>
      {% elif message.tags == 'info' %}
        {% icon 'info-circle' %}
        <span class="visually-hidden">{% trans "Info:" %}</span>
      {% elif message.tags == 'success' %}
        {% icon 'check-circle' %}
        <span class="visually-hidden">{% trans "Success:" %}</span>
      {% endif %}
    </div>

    <div>
      {{ message }}
      <button type="button" class="btn-close" data-bs-dismiss="alert"
              aria-label="{% trans "Close" %}">
      </button>
    </div>
  </div>
{% endfor %}
