From 746b68eaf129b8d949c32eebd35612c8ce19a4e0 Mon Sep 17 00:00:00 2001 From: Ralf Ramsauer Date: Sun, 18 Mar 2018 16:01:06 +0100 Subject: [PATCH] index: don't show labels for buttons Signed-off-by: Ralf Ramsauer --- doorlockd-new/templates/formhelpers.html | 12 ++++++++++++ doorlockd-new/templates/index.html | 9 +++++---- 2 files changed, 17 insertions(+), 4 deletions(-) diff --git a/doorlockd-new/templates/formhelpers.html b/doorlockd-new/templates/formhelpers.html index 8690d30..69a0ae4 100644 --- a/doorlockd-new/templates/formhelpers.html +++ b/doorlockd-new/templates/formhelpers.html @@ -10,3 +10,15 @@ {% endif %} {% endmacro %} + +{% macro render_field(field) %} +
{{ field(**kwargs)|safe }} + {% if field.errors %} +
    + {% for error in field.errors %} +
  • {{ error }}
  • + {% endfor %} +
+ {% endif %} +
+{% endmacro %} diff --git a/doorlockd-new/templates/index.html b/doorlockd-new/templates/index.html index 4cc4ab5..0a59f16 100644 --- a/doorlockd-new/templates/index.html +++ b/doorlockd-new/templates/index.html @@ -1,4 +1,4 @@ -{% from "formhelpers.html" import render_field_label %} +{% from "formhelpers.html" import render_field_label, render_field %} @@ -37,11 +37,13 @@ margin-top: 40px; } + {{ state_img }}
{{ render_field_label(authentication_form.username) }} {{ render_field_label(authentication_form.password) }} - {{ render_field_label(authentication_form.open) }} - {{ render_field_label(authentication_form.close) }} +
+ {{ render_field(authentication_form.open) }} + {{ render_field(authentication_form.close) }} {{ authentication_form.csrf_token }}
{% if response %} @@ -50,6 +52,5 @@ {% endif %}
Die Kitchen ist: {{ state_text }} - {{ state_img }}