1{% with messages = get_flashed_messages(with_categories=true) %}
2 {% if messages %}
3 {% for category, message in messages %}
4 <div class="alert alert-{{ category }} alert-dismissible fade show" role="alert">
5 <span>{{ message }}</span>
6 <button type="button" class="close" data-dismiss="alert" aria-label="Close">
7 <span aria-hidden="true">×</span>
8 </button>
9 </div>
10 {% endfor %}
11 {% endif %}
12{% endwith %}
13