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
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!')

View File

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

View File

@ -1 +1,10 @@
{% 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 %}