Skip to content

Commit

Permalink
Corrected some aspects on FormField template.
Browse files Browse the repository at this point in the history
  • Loading branch information
mbr committed Feb 15, 2014
1 parent e5ea72c commit 3e19778
Showing 1 changed file with 13 additions and 11 deletions.
24 changes: 13 additions & 11 deletions flask_bootstrap/templates/bootstrap/wtf.html
Original file line number Diff line number Diff line change
Expand Up @@ -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. #}
<fieldset>
<legend>{{ field.name }}</legend>
<div class="control-group">
{%- 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 %}
</div>
<legend>{{field.label}}</legend>
{%- 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 %}
</fieldset>
{% else -%}
<div class="form-group {% if field.errors %} has-error{% endif %}">
Expand Down

0 comments on commit 3e19778

Please sign in to comment.