diff options
| author | zorun <github@bitsofnetworks.org> | 2020-04-26 23:17:48 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2020-04-26 23:17:48 +0200 |
| commit | c509896b8c0fa46cd845dc87fa42a8fca8bb7f5b (patch) | |
| tree | 4482ffb2e3bdb92bc6545c582130dc98cdccc4ae /ihatemoney/templates | |
| parent | 08bb95422bd43ce729992673b27117088f5454d9 (diff) | |
| download | ihatemoney-mirror-c509896b8c0fa46cd845dc87fa42a8fca8bb7f5b.zip ihatemoney-mirror-c509896b8c0fa46cd845dc87fa42a8fca8bb7f5b.tar.gz ihatemoney-mirror-c509896b8c0fa46cd845dc87fa42a8fca8bb7f5b.tar.bz2 | |
Add support for different categories of "flash alerts" (#594)
Diffstat (limited to 'ihatemoney/templates')
| -rw-r--r-- | ihatemoney/templates/layout.html | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/ihatemoney/templates/layout.html b/ihatemoney/templates/layout.html index eaf13a6..35d2797 100644 --- a/ihatemoney/templates/layout.html +++ b/ihatemoney/templates/layout.html @@ -125,9 +125,13 @@ </div> <div class="messages"> - {% for message in get_flashed_messages() %} - <div class="flash alert alert-success">{{ message }}</div> - {% endfor %} + {% for category, message in get_flashed_messages(with_categories=true) %} + {% if category == "message" %}{# Default category for flash(msg) #} + <div class="flash alert alert-success">{{ message }}</div> + {% else %} + <div class="flash alert alert-{{ category }}">{{ message }}</div> + {% endif %} + {% endfor %} </div> {% block footer %} |
