From 725a2efce8f07c839288d1f60f45a8daf22fb89f Mon Sep 17 00:00:00 2001 From: asauer Date: Fri, 12 Apr 2019 20:05:29 +0200 Subject: [PATCH] Fix form width for mobile view --- gruppenbildungsspiel.py | 2 +- templates/_formhelpers.html | 7 ++++--- templates/questions.html | 9 --------- 3 files changed, 5 insertions(+), 13 deletions(-) diff --git a/gruppenbildungsspiel.py b/gruppenbildungsspiel.py index 9d00308..eb74228 100644 --- a/gruppenbildungsspiel.py +++ b/gruppenbildungsspiel.py @@ -16,7 +16,7 @@ def input_check(form, field): raise validators.ValidationError('Bitte wähle eine Option aus') class QuestionForm(Form): - computers = [('default', 'Bitte auswählen'), ('hal', 'HAL 9000 (2001: Odyssee im Weltraum)'), ('deepthought', 'Deep Thought (Per Anhalter durch die Galaxie)'), ('neuromancer', 'Neuromancer (Neuromancer)'), ('samantha', 'Samatha (Her)'), ('tars', 'TARS und CASE (Interstellar)')] + computers = [('default', 'Bitte auswählen'), ('hal', 'HAL 9000 (2001: Odyssee im Weltraum)'), ('deepthought', 'Deep Thought (Hitchhiker\'s Guide)'), ('neuromancer', 'Neuromancer (Neuromancer)'), ('samantha', 'Samatha (Her)'), ('tars', 'TARS und CASE (Interstellar)')] computer = SelectField(u'Fiktionaler Lieblingscomputer', choices=computers, validators=[validators.InputRequired(), input_check]) statuses = [('default', 'Bitte auswählen'), ('200', '200 OK'), ('300', '300 Multiple Choices'), ('301', '301 Moved Permanently'), ('402', '402 Payment Required'), ('404', '404 (Sleep) Not Found'), ('408', '408 Request Timeout'), ('418', '418 I am a teapot'), ('450', '450 Blocked by Windows Parental Controls'), ('451', '451 Unavailable For Legal Reasons'), ('502', '502 Bad Gateway (Internetkurort)')] status = SelectField(u'Welcher HTTP-Statuscode trifft am häufigsten auf dich zu?', choices=statuses, validators=[validators.InputRequired(), input_check]) diff --git a/templates/_formhelpers.html b/templates/_formhelpers.html index 0b6bfda..040f2ab 100644 --- a/templates/_formhelpers.html +++ b/templates/_formhelpers.html @@ -1,6 +1,6 @@ {% macro render_field(field) %} -
{{ field.label }} -
{{ field(**kwargs)|safe }} +

{{ field.label }} +
{{ field(**kwargs)|safe }} {% if field.errors %}

{% endif %} -
+

+
{% endmacro %} diff --git a/templates/questions.html b/templates/questions.html index 0a9721d..803f74b 100644 --- a/templates/questions.html +++ b/templates/questions.html @@ -2,22 +2,13 @@ {% block content %} {% from "_formhelpers.html" import render_field %}
-
{{ render_field(form.computer) }} -
{{ render_field(form.status) }} -
{{ render_field(form.vegetable) }} -
{{ render_field(form.spirit_animal) }} -
{{ render_field(form.operating_system) }} -
{{ form.check }} {{ form.check.label }} -
-
{{ render_field(form.email) }} -