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') check = BooleanField('Bitte nicht ankreuzen')
email = EmailField('Email-Adresse') email = EmailField('Email-Adresse')
class User():
name = ''
@app.route('/') @app.route('/')
def index(): def index():
return render_template('index.html', title='Test', text='Hallo, Fooboar') return render_template('index.html', title='Test', text='Hallo, Fooboar')
@ -55,10 +52,10 @@ def questions():
return redirect(url_for('result')) return redirect(url_for('result'))
return render_template('questions.html', form=form) return render_template('questions.html', form=form)
@app.route('/form') # @app.route('/form')
def form(): # def form():
id = generate_id() # id = generate_id()
return render_template('form.html', title='Test', text='Hallo, Fooboar', your_id=id) # return render_template('form.html', title='Test', text='Hallo, Fooboar', your_id=id)
@app.route('/result') @app.route('/result')
def result(): def result():

View File

@ -14,7 +14,7 @@
<nav> <nav>
<ul> <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('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> <li {% if request.path == url_for('answers') %} class="active" {% endif %}><a href="{{ url_for('answers') }}">Meine Antworten</a></li>
</ul> </ul>
</nav> </nav>

View File

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

View File

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