diff options
author | Jose M. Guisado <jguisado@soleta.eu> | 2021-02-16 13:18:38 +0000 |
---|---|---|
committer | Jose M. Guisado <jguisado@soleta.eu> | 2021-02-16 13:18:38 +0000 |
commit | 199854f1e90335ea37987a58efcde2ee6a3dd38a (patch) | |
tree | e75283324f565921cce0972db24c7652e2880acd /ogcp/templates/base.html | |
parent | 989dc5bd36959c785ffabab02eade3a0719e6093 (diff) |
Start using Flask flash messages
These are used to store a message string that can be later accessed. We
can use Flask flash messages to alert about any error or providing info
when processing a request.
Diffstat (limited to 'ogcp/templates/base.html')
-rw-r--r-- | ogcp/templates/base.html | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/ogcp/templates/base.html b/ogcp/templates/base.html index 94f4579..4304e42 100644 --- a/ogcp/templates/base.html +++ b/ogcp/templates/base.html @@ -12,6 +12,21 @@ <body> {% include 'nav.html' %} {% block nav %}{% endblock %} + {% block flash %} + {% for category, message in get_flashed_messages(with_categories=True) %} + {% if category == 'info' %} + <div class="alert alert-info alert-dismissible fade show m-1" role="alert"> + {% elif category == 'error' %} + <div class="alert alert-danger alert-dismissible fade show m-1" role="alert"> + {% endif %} + {{ message }} + <button type="button" class="close" data-dismiss="alert" aria-label="{{ _('Close') }}"> + <span aria-hidden="true">×</span> + </button> + </div> + {% endfor %} + {% endblock %} + <div id="content">{% block content %}{% endblock %}</div> <div id="footer"> {% block footer %}{% endblock %} |