From e4738edf99cb96214db066079adae021c25bc059 Mon Sep 17 00:00:00 2001 From: Pjotr Prins Date: Sun, 24 May 2020 11:16:47 -0500 Subject: Download page --- bh20simplewebuploader/main.py | 32 +++++++++++++++---------- bh20simplewebuploader/templates/download.html | 30 +++++++++++++++++++++++ bh20simplewebuploader/templates/menu.html | 1 + bh20simplewebuploader/templates/org-header.html | 1 + 4 files changed, 52 insertions(+), 12 deletions(-) create mode 100644 bh20simplewebuploader/templates/download.html (limited to 'bh20simplewebuploader') diff --git a/bh20simplewebuploader/main.py b/bh20simplewebuploader/main.py index eb9a0f5..f7e45fb 100644 --- a/bh20simplewebuploader/main.py +++ b/bh20simplewebuploader/main.py @@ -417,22 +417,12 @@ def receive_files(): finally: shutil.rmtree(dest_dir) - -@app.route('/demo') -def demo_page(): - return render_template('demo.html',menu='DEMO') - -@app.route('/blog') -def blog_page(): - return render_template('blog.html',menu='BLOG') - -@app.route('/about') -def about_page(): +def get_html_body(fn): buf = "" in_body = False begin_body = re.compile(r"",re.IGNORECASE) end_body = re.compile(r"(|.*=\"postamble\")",re.IGNORECASE) - with open('doc/web/about.html') as f: + with open(fn) as f: for line in f: if end_body.match(line): break @@ -440,6 +430,24 @@ def about_page(): buf += line elif begin_body.match(line): in_body = True + return buf + +@app.route('/download') +def download_page(): + buf = get_html_body('doc/web/download.html') + return render_template('about.html',menu='DOWNLOAD',embed=buf) + +@app.route('/demo') +def demo_page(): + return render_template('demo.html',menu='DEMO') + +@app.route('/blog') +def blog_page(): + return render_template('blog.html',menu='BLOG') + +@app.route('/about') +def about_page(): + buf = get_html_body('doc/web/about.html') return render_template('about.html',menu='ABOUT',embed=buf) ## Dynamic API functions starting here diff --git a/bh20simplewebuploader/templates/download.html b/bh20simplewebuploader/templates/download.html new file mode 100644 index 0000000..07b6951 --- /dev/null +++ b/bh20simplewebuploader/templates/download.html @@ -0,0 +1,30 @@ + + + {% include 'org-header.html' %} + + {% include 'banner.html' %} + {% include 'menu.html' %} + + {{ embed|safe }} + + {% include 'footer.html' %} + + + + + diff --git a/bh20simplewebuploader/templates/menu.html b/bh20simplewebuploader/templates/menu.html index 55bb1c4..6f97e19 100644 --- a/bh20simplewebuploader/templates/menu.html +++ b/bh20simplewebuploader/templates/menu.html @@ -1,6 +1,7 @@