{% macro render_field(field, addon, prepend, tooltip, label_text, show_label='false') %}
{{ render_label(field, tooltip, label_text, show_label) }} {% 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 %} {% else %}   {% endif %}
{% endmacro %} {% macro render_label(field, tooltip, text, show_label) %} {% if tooltip and text %} {% if show_label == 'false' %} {{ field.label(class="sr-only", style='width:148px', text=text) }} {% else %} {{ field.label(class="control-label", style='width:148px', text=text) }} {% endif %}
 
{% elif tooltip and not text %} {% if show_label == 'false' %} {{ field.label(class="sr-only", style='width:148px') }} {% else %} {{ field.label(class="control-label", style='width:148px') }} {% endif %}
 
{% elif not tooltip and text %} {% if show_label == 'false' %} {{ field.label(class="sr-only", text=text) }} {% else %} {{ field.label(class="control-label", text=text) }} {% endif %} {% else %} {% if show_label == 'false' %} {{ field.label(class="sr-only") }} {% else %} {{ field.label(class="control-label") }} {% endif %} {% endif %} {% endmacro %} {% macro render_toggle(field, label) %}
{{field(class="onoffswitch-checkbox")}}
{{ label }}
{% endmacro %}