filter and display login notifications by type

This commit is contained in:
dandds
2018-12-10 13:25:47 -05:00
parent eeb8e5f328
commit 03d7d0fac0
2 changed files with 15 additions and 2 deletions

View File

@@ -1,6 +1,10 @@
{% from "components/alert.html" import Alert %}
{% with messages = get_flashed_messages(with_categories=true) %}
{% if not category_filter %}
{% set category_filter=["success", "info", "warning", "error"] %}
{% endif %}
{% with messages = get_flashed_messages(with_categories=true, category_filter=category_filter) %}
{% if messages %}
{% for category, message_config in messages %}
{{ Alert(message_config["title"], message=message_config.get("message"), level=category) }}