Created
August 20, 2014 09:29
-
-
Save pistatium/9bf24d49ea294578224a to your computer and use it in GitHub Desktop.
WTForm with bootstrap
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{% for field in form %} | |
<div class="form-group {{funcs["yesno"](field.errors,"has-error")}}"> | |
<label for="{{field.label.field_id}}" class="col-sm-2 control-label">{{field.label.text}}</label> | |
<div class="col-sm-10"> | |
{% raw field(class_="form-control") %} | |
{% if field.description %} | |
<span class="help-block">{{ field.description}}</span> | |
{% end %} | |
{% if field.errors %} | |
<span class="help-block"> | |
{% for err in field.errors %} | |
{{err}} | |
{% end %} | |
</span> | |
{% end %} | |
</div> | |
</div> | |
{% end %} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment