{% from 'includes/forms.html' import required, optional, tip %} {% from 'developers/includes/macros.html' import some_html_tip %} {% macro simple_label(field, label, opt, req, tooltip, hint) %} {% if field.field.required and req != False %}{{ required() -}}{% endif %} {% if opt %}{{ optional() -}}{% endif %} {% if not hint and tooltip %}{{ tip(None, tooltip) }}{% endif %} {% endmacro %} {% if tag %} <{{ tag }} class="brform simple-field c {{ cls }}{{ ' error' if field.errors }}"> {% endif %} {% set choice = field|is_choice_field %} {% if not tooltip %}{% set tooltip = field.help_text %}{% endif %} {% if grid %}
{% else %} {% if choice %}{{ field.as_widget() }}{% endif %} {% endif %} {{ simple_label(field, label, opt, req, tooltip, hint) }} {% if grid %}
{% if choice %} {{ field.as_widget() }} {{ simple_label(field, label, opt, req, tooltip, hint) }} {% endif %} {% endif %} {% if not choice %} {{ field.as_widget(attrs=attrs) }} {% endif %} {% if hint and tooltip %} {{ field.help_text }} {% endif %} {% if some_html %} {{ some_html_tip() }} {% endif %} {% if cc_maxlength %}
{% endif %} {{ field.errors }} {% if grid %}
{% endif %} {% if tag %} {% endif %}