From 5292794178279fe4cd1adf2edd275753d57de724 Mon Sep 17 00:00:00 2001 From: asauer Date: Wed, 10 Apr 2019 21:52:38 +0200 Subject: [PATCH] Create solution page and add home content --- gruppenbildungsspiel.py | 7 +++++++ templates/base.html | 19 ++++++++++--------- templates/index.html | 9 +++++++++ templates/solution.html | 4 ++++ 4 files changed, 30 insertions(+), 9 deletions(-) create mode 100644 templates/solution.html diff --git a/gruppenbildungsspiel.py b/gruppenbildungsspiel.py index bf2a1d6..19da1f3 100644 --- a/gruppenbildungsspiel.py +++ b/gruppenbildungsspiel.py @@ -1,5 +1,7 @@ from flask import Flask, render_template app = Flask(__name__) +app.jinja_env.trim_blocks = True +app.jinja_env.lstrip_blocks = True @app.route('/') def index(): @@ -20,3 +22,8 @@ def admin(): @app.route('/answers') def answers(): return render_template('answers.html', title='Test', text='Hallo, Admin Fooboar') + +@app.route('/solution') +def solution(): + return render_template('solution.html', title='Test', text='Hallo, Lösung!') + diff --git a/templates/base.html b/templates/base.html index 532c6e9..034e30b 100644 --- a/templates/base.html +++ b/templates/base.html @@ -3,16 +3,17 @@ {{ title }} - - -

{{ text }}

+ + {% block content %} + {% endblock %} diff --git a/templates/index.html b/templates/index.html index 94d9808..16c6d82 100644 --- a/templates/index.html +++ b/templates/index.html @@ -1 +1,10 @@ {% extends "base.html" %} + {% block content %} +
+ +
+ {% endblock %} diff --git a/templates/solution.html b/templates/solution.html new file mode 100644 index 0000000..e2a001c --- /dev/null +++ b/templates/solution.html @@ -0,0 +1,4 @@ +{% extends "base.html" %} + {% block content %} + index + {% endblock %}