Bill form style update

This commit is contained in:
Emily 2019-05-12 21:00:06 +01:00
parent 9826d12466
commit c29ec24bdd
2 changed files with 10 additions and 10 deletions

View File

@ -11,14 +11,15 @@ FORM_RENDER_KW = {
} }
class BillForm(Form): class BillForm(Form):
payment_to = StringField(_("Payment to"), [validators.DataRequired()]) payment_to = StringField(_("Payment to"), [validators.DataRequired()], render_kw = FORM_RENDER_KW)
description = TextAreaField(_("Description"), render_kw = { description = TextAreaField(_("Description"), render_kw = {
"cols": 55, "cols": 55,
"rows": 8 "rows": 8,
**FORM_RENDER_KW
}) })
sum = DecimalField(_("Sum")) sum = DecimalField(_("Sum"), render_kw = FORM_RENDER_KW)
kid = IntegerField(_("KID")) kid = IntegerField(_("KID"), render_kw = FORM_RENDER_KW)
date_due = DateField(_("Date due")) date_due = DateField(_("Date due"), render_kw = FORM_RENDER_KW)
class LoginForm(Form): class LoginForm(Form):
email = StringField(_("Email"), [ email = StringField(_("Email"), [

View File

@ -23,18 +23,17 @@
</div> </div>
<div class="modal-body"> <div class="modal-body">
{% macro render_field(field) %} {% macro render_field(field) %}
<dt> <div class="form-group">
<label for="{{ field.label.field_id }}">{{ _(field.label.text) }}</label> <label for="{{ field.label.field_id }}">{{ _(field.label.text) }}</label>
</dt> {{ field(**kwargs)|safe }}
<dd>{{ field(**kwargs)|safe }}
{% if field.errors %} {% if field.errors %}
<ul class=errors> <ul class=errors>
{% for error in field.errors %} {% for error in field.errors %}
<li>{{ error }}</li> <li>{{ error }}</li>
{% endfor %} {% endfor %}
</ul> </ul>
{% endif %} {% endif %}
</dd> </div>
{% endmacro %} {% endmacro %}
<form method=post> <form method=post>
<dl> <dl>