From: Tom Hunger Date: Thu, 22 Jan 2015 17:34:26 +0000 (+0000) Subject: Bootstrapify claim form. X-Git-Url: https://git.aero2k.de/?a=commitdiff_plain;h=4b82c8980e37e03f93226d4e3905a8d2bfc651a8;p=sirius.git Bootstrapify claim form. --- diff --git a/sirius/web/landing.py b/sirius/web/landing.py index f982d30..9f37bb9 100644 --- a/sirius/web/landing.py +++ b/sirius/web/landing.py @@ -10,11 +10,11 @@ blueprint = flask.Blueprint('landing', __name__) class ClaimForm(flask_wtf.Form): claim_code = wtforms.StringField( - 'claim_code', + 'Claim code', validators=[wtforms.validators.DataRequired()], ) printer_name = wtforms.StringField( - 'printer_name', + 'Name your printer', validators=[wtforms.validators.DataRequired()], ) diff --git a/sirius/web/templates/claim.html b/sirius/web/templates/claim.html index ba134e1..9c393ff 100644 --- a/sirius/web/templates/claim.html +++ b/sirius/web/templates/claim.html @@ -4,14 +4,32 @@ {% block page_content %}

Claim a printer

-
-
- {{ form.csrf_token }} - {{ form.claim_code.label }} - {{ form.claim_code(size=24) }} - {{ form.printer_name.label }} - {{ form.printer_name(size=24) }} - -
-
+
+ {{ form.csrf_token }} + +
+ + {% if form.claim_code.errors %} +
    + {% for error in form.claim_code.errors %} +
  • {{ error }}
  • + {% endfor %} +
+ {% endif %} + {{ form.claim_code(class="form-control") }} +
+ +
+ + {% if form.printer_name.errors %} +
    + {% for error in form.printer_name.errors %} +
  • {{ error }}
  • + {% endfor %} +
+ {% endif %} + {{ form.printer_name(class="form-control") }} +
+ +
{% endblock %}