{% with messages = get_flashed_messages(with_categories=true) %} | |
{% if messages %} | |
{% for category, message in messages %} | |
<div class="alert alert-{{ category }}" role="alert"> | |
{% if category == 'danger' %} | |
<span class="glyphicon glyphicon-exclamation-sign" aria-hidden="true"></span> | |
{% endif %} | |
<span class="sr-only">{{ category }}:</span> | |
{{ message }} | |
</div> | |
{% endfor %} | |
{% endif %} | |
{% endwith %} |