From 87d4f88bcb3c06dbcbac0a48dd1f838afdd6343d Mon Sep 17 00:00:00 2001 From: neingeist Date: Sat, 10 Nov 2018 21:32:18 +0100 Subject: [PATCH] display flashed messages --- app/routes.py | 1 + app/templates/base.html | 10 ++++++++++ 2 files changed, 11 insertions(+) diff --git a/app/routes.py b/app/routes.py index 6ceffe2..16b4a08 100644 --- a/app/routes.py +++ b/app/routes.py @@ -12,6 +12,7 @@ def index(): def download(): form = DownloadForm() if form.validate_on_submit(): + flash('The download should start immediately.') return render_template('download.html', form=form, filename='test.mp3') elif request.method == 'GET': form.date.data = datetime.now() - timedelta(hours = 1) diff --git a/app/templates/base.html b/app/templates/base.html index b2420a4..eac5467 100644 --- a/app/templates/base.html +++ b/app/templates/base.html @@ -3,7 +3,17 @@ {% block title %}Prolefeeder{% endblock %} {% block content %}
+ +{% with messages = get_flashed_messages() %} +{% if messages %} + {% for message in messages %} + + {% endfor %} +{% endif %} +{% endwith %} + {% block app_content %} {% endblock %} +
{% endblock %}