{% macro render_field_with_errors(field,icon_class) %}
<div class="{% if field.errors %}has-error{% endif %}">
  <div class="input-group mb-3">
      {% set pl = kwargs.pop('placeholder',field.label.text) %}
      {{ field(placeholder=pl, class_='form-control', **kwargs)|safe }}
        <div class="input-group-append">
          <div class="input-group-text">
            <span class="{{icon_class}}"></span>
          </div>
        </div>
  </div>
  {% if field.errors %}
  {% for error in field.errors %}
      <span class="help-block">{{ error }}</span>
  {% endfor %}
  {% endif %}
</div>
{% endmacro %}

{% macro render_field(field) %}
<p>{{ field(class_='form-control', **kwargs)|safe }}</p>
{% endmacro %}

{% macro render_checkbox_field(field) -%}
<div class="icheck-primary">
    {{ field(type='checkbox', **kwargs) }} 
    <label for="remember">
     {{ field.label }}
    </label>
    <!-- <label>
       -     {{ field(type='checkbox', **kwargs) }}
       - </label> -->
</div>
{%- endmacro %}
