Skip to content

Instantly share code, notes, and snippets.

@androidzhibinw
Forked from victorkristof/flask-flash-bootstrap
Created January 27, 2016 10:36
Show Gist options
  • Save androidzhibinw/1403b6e6f16ff7412c23 to your computer and use it in GitHub Desktop.
Save androidzhibinw/1403b6e6f16ff7412c23 to your computer and use it in GitHub Desktop.
Flask flash messages as Bootstrap alert.
{% with messages = get_flashed_messages(with_categories=true) %}
<!-- Categories: success (green), info (blue), warning (yellow), danger (red) -->
{% if messages %}
{% for category, message in messages %}
<div class="alert alert-{{ category }} alert-dismissible" role="alert">
<button type="button" class="close" data-dismiss="alert" aria-label="Close"><span aria-hidden="true">&times;</span></button>
<!-- <strong>Title</strong> --> {{ message }}
</div>
{% endfor %}
{% endif %}
{% endwith %}
@androidzhibinw
Copy link
Author

nice

@AnaisGueyte
Copy link

Like that ;)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment