Create solution page and add home content

This commit is contained in:
Sauer 2019-04-10 21:52:38 +02:00
parent 1d61a5ff18
commit 5292794178
4 changed files with 30 additions and 9 deletions

View File

@ -1,5 +1,7 @@
from flask import Flask, render_template from flask import Flask, render_template
app = Flask(__name__) app = Flask(__name__)
app.jinja_env.trim_blocks = True
app.jinja_env.lstrip_blocks = True
@app.route('/') @app.route('/')
def index(): def index():
@ -20,3 +22,8 @@ def admin():
@app.route('/answers') @app.route('/answers')
def answers(): def answers():
return render_template('answers.html', title='Test', text='Hallo, Admin Fooboar') 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!')

View File

@ -3,16 +3,17 @@
<head> <head>
<meta charset="UTF-8" /> <meta charset="UTF-8" />
<title>{{ title }}</title> <title>{{ title }}</title>
<link rel="stylesheet" href="{{ url_for('static', filename='main.css') }}" <link rel="stylesheet" href="{{ url_for('static', filename='main.css') }}">
</head> </head>
<body> <body>
<nav> <nav>
<ul> <ul>
<li><a href="{{ url_for('index') }}">Home</a></li> <li><a href="{{ url_for('index') }}">Home</a></li>
<li><a href="{{ url_for('form') }}">Questionnaire</a></li> <li><a href="{{ url_for('form') }}">Questionnaire</a></li>
<li><a href="{{ url_for('answers') }}">My Answers</a></li> <li><a href="{{ url_for('answers') }}">My Answers</a></li>
</ul> </ul>
</nav> </nav>
<p>{{ text }}</p> {% block content %}
{% endblock %}
</body> </body>
</html> </html>

View File

@ -1 +1,10 @@
{% extends "base.html" %} {% extends "base.html" %}
{% block content %}
<div>
<ul>
<li><a href="{{ url_for('form') }}">Jetzt mitspielen</a></li>
<li><a href="{{ url_for('answers') }}">Hier geht's zu deinen Antworten</a></li>
<li><a href="{{ url_for('solution') }}">Lösung einreichen</a></li>
</ul>
</div>
{% endblock %}

4
templates/solution.html Normal file
View File

@ -0,0 +1,4 @@
{% extends "base.html" %}
{% block content %}
index
{% endblock %}