Created
December 6, 2016 15:55
-
-
Save DavidHickman/ca7589c72778958aed4273a64cc78510 to your computer and use it in GitHub Desktop.
Adding Bootstrap alerts as Flask flash messages
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{% with messages = get_flashed_messages() %} | |
{% if messages %} | |
<ul class="flashes list-group"> | |
{% for message in messages %} | |
<li class="list-group-item"> | |
<div class="alert alert-success">{{message}}</div> | |
</li> | |
{% endfor %} | |
</ul> | |
{% endif %} | |
{% endwith %} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
.list-group { | |
margin: 10px 0; | |
} | |
.list-group-item { | |
margin: 0; | |
padding: 0; | |
} | |
.alert { | |
margin: 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment