! RFACTOR TEMPLATE2

This commit is contained in:
Mateusz Gruszczyński
2025-02-28 16:28:13 +01:00
parent d0f1d25063
commit 85a37e4a78
2 changed files with 24 additions and 13 deletions

View File

@ -219,19 +219,17 @@
<!-- Kontener do wyświetlania komunikatów flash -->
<div class="container mt-3">
{% with messages = get_flashed_messages(with_categories=True) %}
{% if messages %}
{% for category, message in messages %}
<!-- Jeśli brak kategorii, używamy 'info' -->
{% if category == 'message' %}
{% set category = 'info' %}
{% endif %}
<div class="alert alert-{{ category }} alert-dismissible fade show" role="alert">
{{ message }}
<button type="button" class="btn-close" data-bs-dismiss="alert" aria-label="Close"></button>
</div>
{% endfor %}
{% endif %}
{% endwith %}
{% if messages %}
{% for category, message in messages %}
<!-- Zmapuj do stylu Bootstrapa -->
{% set bs_cat = bootstrap_alert_category(category) %}
<div class="alert alert-{{ bs_cat }} alert-dismissible fade show" role="alert">
{{ message }}
<button type="button" class="btn-close" data-bs-dismiss="alert" aria-label="Close"></button>
</div>
{% endfor %}
{% endif %}
{% endwith %}
</div>
<main class="container my-4 flex-fill">