2022-07-24 14:20:20 +02:00
|
|
|
{% set flash_title = label|replace({'success': 'flash.success', 'error': 'flash.error'
|
|
|
|
, 'warning': 'flash.warning', 'notice': 'flash.notice', 'info': 'flash.info'}) %}
|
|
|
|
{% set flash_symbol = label|replace({'success': 'fa-check-circle', 'error': 'fa-exclamation-triangle'
|
|
|
|
, 'warning': 'fa-exclamation-circle', 'notice': 'fa-flag', 'info': 'fa-flag'}) %}
|
|
|
|
|
|
|
|
{% set flash_bg = label|replace({'success': 'bg-success text-white',
|
|
|
|
'error': 'bg-danger text-white', 'warning': 'bg-warning text-white',
|
2023-07-03 22:01:39 +02:00
|
|
|
'notice': 'bg-info text-white', 'info': 'bg-body-tertiary'})%}
|
2022-07-24 14:20:20 +02:00
|
|
|
|
|
|
|
<div class="toast shadow" role="alert" aria-live="assertive" aria-atomic="true" data-delay="5000" {{ stimulus_controller('common/toast') }}>
|
|
|
|
<div class="toast-header {{ flash_bg }}">
|
2022-07-24 18:08:21 +02:00
|
|
|
{# <img src="..." class="rounded me-2" alt="...">#}
|
|
|
|
<i class="fas fa-fw {{ flash_symbol }} me-2"></i>
|
|
|
|
<strong class="me-auto">{{ flash_title|trans }}</strong>
|
2022-07-24 14:20:20 +02:00
|
|
|
<small class="{% if "text-white" in flash_bg %}text-white{% else %}text-muted{% endif %}">{{ "now" | format_datetime("short", "short") }}</small>
|
2022-07-24 18:19:57 +02:00
|
|
|
<button type="button" class="ms-2 mb-1 btn-close {% if "text-white" in flash_bg %}btn-close-white{% endif %}" data-bs-dismiss="toast" aria-label="Close"></button>
|
2022-07-24 14:20:20 +02:00
|
|
|
</div>
|
|
|
|
<div class="toast-body {{ flash_bg }}">
|
|
|
|
{{ message | trans }}
|
|
|
|
</div>
|
|
|
|
</div>
|