{% macro required_note() -%}
* {{ _('Required fields') }}
{%- endmacro %} {% macro required() -%} * {%- endmacro %} {% macro optional() -%} {{ _('(optional)') }} {%- endmacro %} {% macro pretty_field(field, label=None, tooltip=None, tag='li', req=None, opt=False, choice=None, class='row', before='', validate=False) %} {% if choice == None %} {% set choice = field|is_choice_field %} {% endif %} {% if req == None %} {% set req = field.field.required %} {% endif %} {% set attrs = {'required': ''} if req and validate else {} %} {% if tag %} <{{ tag }} class="{{ class }}{{ ' error' if field.errors }}"> {% endif %} {{ before }} {% if not choice %} {{ field.as_widget(attrs=attrs) }} {% endif %} {{ field.errors }} {% if tag %} {{ tag }}> {% endif %} {% endmacro %} {% macro tip(name, tip) %} {% if name %} {{ name }} {% endif %} ? {% endmacro %}