From 3e197782133ad26c64c9ae99dc3d03584da99de2 Mon Sep 17 00:00:00 2001 From: Marc Brinkmann Date: Sat, 15 Feb 2014 11:45:19 +0100 Subject: [PATCH] Corrected some aspects on FormField template. --- flask_bootstrap/templates/bootstrap/wtf.html | 24 +++++++++++--------- 1 file changed, 13 insertions(+), 11 deletions(-) diff --git a/flask_bootstrap/templates/bootstrap/wtf.html b/flask_bootstrap/templates/bootstrap/wtf.html index e4f5ce59..4d7ebf7e 100644 --- a/flask_bootstrap/templates/bootstrap/wtf.html +++ b/flask_bootstrap/templates/bootstrap/wtf.html @@ -56,18 +56,20 @@ {{field(class='btn btn-%s' % button_map.get(field.name, 'default'))}} {% endcall %} {%- elif field.type == 'FormField' -%} +{# note: FormFields are tricky to get right and complex setups requiring + these are probably beyond the scope of what this macro tries to do. + the code below ensures that things don't break horribly if we run into + one, but does not try too hard to get things pretty. #}
- {{ field.name }} -
- {%- for subfield in field %} - {% if not bootstrap_is_hidden_field(subfield) -%} - {{ form_field(subfield, - form_type=form_type, - horizontal_columns=horizontal_columns, - button_map=button_map) }} - {%- endif %} - {%- endfor %} -
+ {{field.label}} + {%- for subfield in field %} + {% if not bootstrap_is_hidden_field(subfield) -%} + {{ form_field(subfield, + form_type=form_type, + horizontal_columns=horizontal_columns, + button_map=button_map) }} + {%- endif %} + {%- endfor %}
{% else -%}