{% macro messages() %} {% with messages = get_flashed_messages(with_categories=True) %} {% if messages %} {% for category, m in messages %} {% if category %} {# alert-error changed to alert-danger in bootstrap 3, mapping is for backwards compatibility #} {% set mapping = {'message': 'info', 'error': 'danger'} %}
{% else %}
{% endif %} {{ m|safe }}
{% endfor %} {% endif %} {% endwith %} {% endmacro %}