From cc808b3df3b0c30abbf286e46b63ebfffcf25b09 Mon Sep 17 00:00:00 2001 From: Quentin Roy Date: Wed, 20 May 2015 16:29:58 +0200 Subject: [PATCH 1/2] Allow any input properties to be added as additional parameter of the input macro. Avoid useless "None" input class to be set as a side effect. --- budget/templates/forms.html | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/budget/templates/forms.html b/budget/templates/forms.html index 2904e0d5..39798627 100644 --- a/budget/templates/forms.html +++ b/budget/templates/forms.html @@ -1,13 +1,14 @@ -{% macro input(field, multiple=False, class=None) -%} +{% macro input(field, multiple=False) -%} + {# Additional arguments will be added as input properties (e.g. class="yourclass") #}
{% if field.type != "SubmitField" %} {{ field.label(class="control-label") }} {% endif %}
{% if multiple == True %} - {{ field(multiple=True, class=class) }} + {{ field(multiple=True, **kwargs) }} {% else %} - {{ field(class=class) | safe }} + {{ field(**kwargs) | safe }} {% endif %} {% if field.description %}

{{ field.description }}

From acfb15dfc40cb564a5f0d77b0332fe63a749edab Mon Sep 17 00:00:00 2001 From: Quentin Roy Date: Wed, 20 May 2015 16:35:15 +0200 Subject: [PATCH 2/2] Avoid amount field autocomplete. --- budget/templates/forms.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/budget/templates/forms.html b/budget/templates/forms.html index 39798627..cc5d018b 100644 --- a/budget/templates/forms.html +++ b/budget/templates/forms.html @@ -81,7 +81,7 @@ {{ input(form.date, class="datepicker") }} {{ input(form.what) }} {{ input(form.payer) }} - {{ input(form.amount) }} + {{ input(form.amount, autocomplete="off") }} {{ input(form.payed_for) }}