2021-11-23 13:00:03 +00:00
|
|
|
{% with messages = get_flashed_messages(with_categories=true) %}
|
|
|
|
{% if messages %}
|
|
|
|
{% set cookie_flash_flag = namespace(value=False) %}
|
|
|
|
{% for category, message in messages %}
|
|
|
|
{% if category == "error" %}
|
|
|
|
<div class="alert alert-danger alert-dismissible fade show" role="alert">
|
2021-11-24 17:17:56 +00:00
|
|
|
<i class="bi bi-exclamation-triangle-fill" title="Error" aria-title="Error"></i>
|
2021-11-23 13:00:03 +00:00
|
|
|
{{ message|safe }}
|
|
|
|
<button type="button" class="btn-close" data-bs-dismiss="alert" aria-label="Close"></button>
|
|
|
|
</div>
|
|
|
|
{% elif category == "success" %}
|
|
|
|
<div class="alert alert-success alert-dismissible fade show" role="alert">
|
2021-11-24 17:17:56 +00:00
|
|
|
<i class="bi bi-check2-circle" title="Success" aria-title="Success"></i>
|
2021-11-23 13:00:03 +00:00
|
|
|
{{ message|safe }}
|
|
|
|
<button type="button" class="btn-close" data-bs-dismiss="alert" aria-label="Close"></button>
|
|
|
|
</div>
|
|
|
|
{% elif category == "warning" %}
|
|
|
|
<div class="alert alert-warning alert-dismissible fade show" role="alert">
|
2021-11-24 17:17:56 +00:00
|
|
|
<i class="bi bi-info-circle-fill" aria-title="Warning" title="Warning"></i>
|
2021-11-23 13:00:03 +00:00
|
|
|
{{ message|safe }}
|
|
|
|
<button type="button" class="btn-close" data-bs-dismiss="alert" aria-label="Close"></button>
|
|
|
|
</div>
|
|
|
|
{% elif category == "cookie_alert" %}
|
|
|
|
{% if not cookie_flash_flag.value %}
|
|
|
|
<div class="alert alert-primary alert-dismissible fade show" id="cookie-alert" role="alert">
|
2021-11-24 17:17:56 +00:00
|
|
|
<i class="bi bi-info-circle-fill" title="Cookie Alert" aria-title="Cookie Alert"></i>
|
2021-11-23 13:00:03 +00:00
|
|
|
{{ message|safe }}
|
|
|
|
<button type="button" id="dismiss-cookie-alert" class="btn btn-success" data-bs-dismiss="alert" aria-label="Close">Accept</button>
|
|
|
|
</div>
|
|
|
|
{% set cookie_flash_flag.value = True %}
|
|
|
|
{% endif %}
|
|
|
|
{% else %}
|
|
|
|
<div class="alert alert-primary alert-dismissible fade show" role="alert">
|
|
|
|
<i class="bi bi-info-circle-fill" title="Alert"></i>
|
|
|
|
{{ message|safe }}
|
|
|
|
<button type="button" class="btn-close" data-bs-dismiss="alert" aria-label="Close"></button>
|
|
|
|
</div>
|
|
|
|
{% endif %}
|
|
|
|
{% endfor %}
|
|
|
|
{% endif %}
|
|
|
|
{% endwith %}
|