{% if app.session is not null and app.session.started %}
{% set _flash_messages = app.session.flashbag.all %}
{% if _flash_messages|length > 0 %}
<div id="flash-messages">
{% for label, messages in _flash_messages %}
{% for message in messages %}
<div class="alert alert-{{ label }}">
<button type="button" class="alert-close" onclick="this.closest('div').style.display='none'">×</button>
{{ message|trans|striptags }}
</div>
{% endfor %}
{% endfor %}
</div>
{% endif %}
{% endif %}