vartheme_bs5-2.0.x-dev/templates/misc/status-messages.html.twig
templates/misc/status-messages.html.twig
{#
/**
* @file
* Template for status messages.
*/
#}
{% set types = {
status: 'alert-success',
warning: 'alert-warning',
error: 'alert-danger',
info: 'alert-info',
primary: 'alert-primary',
secondary: 'alert-secondary',
light: 'alert-light',
dark: 'alert-dark'
} %}
{% for type, messages in message_list %}
<div role="region" aria-label="{{ status_headings[type] }}" {{ attributes|without('role', 'aria-label') }}>
{% embed '@molecules/alert/alert.twig' with {
type: types[type],
} %}
{% block content %}
{% if status_headings[type] %}
<h2 class="visually-hidden">{{ status_headings[type] }}</h2>
{% endif %}
{% if messages|length > 1 %}
<ul>
{% for message in messages %}
<li>{{ message }}</li>
{% endfor %}
</ul>
{% else %}
{{ messages|first }}
{% endif %}
{% endblock %}
{% endembed %}
</div>
{% endfor %}
