Embellish the form

This commit is contained in:
Sauer 2019-04-12 19:57:17 +02:00
parent 39b97cb97f
commit a9c02410e6
4 changed files with 14 additions and 9 deletions

View File

@ -29,9 +29,6 @@ class QuestionForm(Form):
check = BooleanField('Bitte nicht ankreuzen')
email = EmailField('Email-Adresse')
class User():
name = ''
@app.route('/')
def index():
return render_template('index.html', title='Test', text='Hallo, Fooboar')
@ -55,10 +52,10 @@ def questions():
return redirect(url_for('result'))
return render_template('questions.html', form=form)
@app.route('/form')
def form():
id = generate_id()
return render_template('form.html', title='Test', text='Hallo, Fooboar', your_id=id)
# @app.route('/form')
# def form():
# id = generate_id()
# return render_template('form.html', title='Test', text='Hallo, Fooboar', your_id=id)
@app.route('/result')
def result():

View File

@ -14,7 +14,7 @@
<nav>
<ul>
<li {% if request.path == url_for('index') %} class="active" {% endif %}><a href="{{ url_for('index') }}">Home</a></li>
<li {% if request.path == url_for('form') %} class="active" {% endif %}><a href="{{ url_for('form') }}">Formular</a></li>
<li {% if request.path == url_for('questions') %} class="active" {% endif %}><a href="{{ url_for('questions') }}">Formular</a></li>
<li {% if request.path == url_for('answers') %} class="active" {% endif %}><a href="{{ url_for('answers') }}">Meine Antworten</a></li>
</ul>
</nav>

View File

@ -6,7 +6,7 @@
Kein Alkohol mehr.
</div>
<div class="btn-group">
<a href="{{ url_for('form') }}"><button>Jetzt mitspielen</button></a>
<a href="{{ url_for('questions') }}"><button>Jetzt mitspielen</button></a>
<a href="{{ url_for('answers') }}"><button>Hier geht's zu deinen Antworten</button></a>
<a href="{{ url_for('solution') }}"><button>Lösung einreichen</button></a>
</div>

View File

@ -4,13 +4,21 @@
<form method=post>
<dl>
{{ render_field(form.computer) }}
<br>
{{ render_field(form.status) }}
<br>
{{ render_field(form.vegetable) }}
<br>
{{ render_field(form.spirit_animal) }}
<br>
{{ render_field(form.operating_system) }}
<br>
{{ form.check }} {{ form.check.label }}
<br>
<br>
{{ render_field(form.email) }}
</dl>
<p></p>
<p><input type=submit value=Abschicken>
</form>
{% endblock %}