From 64772b13ba320e926ed0e44abdc82106d21574c6 Mon Sep 17 00:00:00 2001 From: neingeist Date: Sat, 10 Nov 2018 21:19:38 +0100 Subject: [PATCH] serve file from the download form --- app/routes.py | 4 ++-- app/templates/download.html | 8 ++++++++ app/templates/download_thanks.html | 10 ---------- 3 files changed, 10 insertions(+), 12 deletions(-) delete mode 100644 app/templates/download_thanks.html diff --git a/app/routes.py b/app/routes.py index 84cdd55..6ceffe2 100644 --- a/app/routes.py +++ b/app/routes.py @@ -12,11 +12,11 @@ def index(): def download(): form = DownloadForm() if form.validate_on_submit(): - return render_template('download_thanks.html', title='Download', form=form) + return render_template('download.html', form=form, filename='test.mp3') elif request.method == 'GET': form.date.data = datetime.now() - timedelta(hours = 1) form.length.data = 60 - return render_template('download.html', title='Download', form=form) + return render_template('download.html', form=form) @app.route('/download_file/') def download_file(filename): diff --git a/app/templates/download.html b/app/templates/download.html index 1461969..243078d 100644 --- a/app/templates/download.html +++ b/app/templates/download.html @@ -1,5 +1,13 @@ {% extends "base.html" %} + +{% block head %} + {{ super() }} + {% if filename is defined %} + + {% endif %} +{% endblock %} + {% block app_content %}

Download

diff --git a/app/templates/download_thanks.html b/app/templates/download_thanks.html deleted file mode 100644 index 4e4b49c..0000000 --- a/app/templates/download_thanks.html +++ /dev/null @@ -1,10 +0,0 @@ -{% extends "base.html" %} - -{% block head %} - {{ super() }} - -{% endblock %} - -{% block app_content %} -

Thanks!

-{% endblock %}