{% macro render_field(field, addon, prepend, tooltip, label_text) %}
{{ render_label(field, tooltip, label_text) }}
{% if addon %}
{% if prepend %} {{addon|safe}} {{field(**kwargs)}} {% else %} {{field(**kwargs)}} {{addon|safe}} {% endif %}
{% else %} {{field(**kwargs)}} {% endif %} {% if field.errors %} {% for error in field.errors %} {{ error }} {% endfor %} {% endif %}
{% endmacro %} {% macro render_label(field, tooltip, text) %} {% if tooltip and text %} {{ field.label(class="control-label", style='width:148px', text=text) }}
 
{% elif tooltip and not text %} {{ field.label(class="control-label", style='width:148px') }}
 
{% elif not tooltip and text %} {{ field.label(class="control-label", text=text) }} {% else %} {{ field.label(class="control-label") }} {% endif %} {% endmacro %}