FreedomBox/plinth/templates/messages.html
Sunil Mohan Adapa 62dad9336b
ui: Use Bootstrap 5 styling for all alerts
- Ensure that .sr-only is replaced with newer classes.

- Ensure that icons are present for all alerts.

- Use flex-box for display of icons on the left center of the alert.

- .close has been renamed to .btn-close.

- × is no longer required for close buttons.

Tests:

- Visually verify all the changes by triggering them with code changes.

Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: Veiko Aasa <veiko17@disroot.org>
2024-12-12 12:38:01 +02:00

35 lines
1.2 KiB
HTML

{% comment %}
# SPDX-License-Identifier: AGPL-3.0-or-later
{% endcomment %}
{% load i18n %}
{% 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' %}
<span class="fa fa-exclamation-triangle" aria-hidden="true"></span>
<span class="visually-hidden">{% trans "Error:" %}</span>
{% elif message.tags == 'warning' %}
<span class="fa fa-exclamation-triangle" aria-hidden="true"></span>
<span class="visually-hidden">{% trans "Caution:" %}</span>
{% elif message.tags == 'info' %}
<span class="fa fa-info-circle" aria-hidden="true"></span>
<span class="visually-hidden">{% trans "Info:" %}</span>
{% elif message.tags == 'success' %}
<span class="fa fa-check-circle" aria-hidden="true"></span>
<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 %}