{%- if _ is not defined -%} {% macro _(message) -%} {{ message }} {%- endmacro %} {%- endif -%} {# Renders field for bootstrap 3 standards. Params: field - WTForm field kwargs - pass any arguments you want in order to put them into the html attributes. There are few exceptions: for - for_, class - class_, class__ - class_ Example usage: {{ horz_form.field(form.email, placeholder='Input email', type='email') }} #} {% macro div_form_group(field) -%}
{%- if field.type == 'SelectField' -%} {{ value_macro(field.selected_choice_label) }} {%- else -%} {{ value_macro(field.data) }} {%- endif -%}
{% endmacro %} {# Renders radio field Params: field - WTForm field (there are no check, but you should put here only BooleanField. kwargs - pass any arguments you want in order to put them into the html attributes. There are few exceptions: for - for_, class - class_, class__ - class_ Example usage: {{ horiz_form.radio_field(form.answers) }} #} {% macro radio_field(field, label_visible=true, tabIndex="1") -%} {% call div_form_group(field, **kwargs) %} {% if label_visible %} {{ field.label(class_='control-label') }} {% endif %}{{ label }}
{% endif %} {% endfor %}