{% macro render_field_with_errors(field, css_class="col-sm-5") %}
 <div class="form-group {%if field.errors %} has-error {% endif %}">
    <label for="{{field.id}}" class="col-sm-2 control-label">{{ field.label }}</label>
    <div class="{{css_class}}">
      {{field(**kwargs)|safe}}
    </div>
  </div>
{% endmacro %}

{% macro render_field(field) %}
{% if field.type != 'HiddenField' %}
 <div class="form-group">
    <label for="{{field.id}}" class="col-sm-2 control-label">{{ field.label }}</label>
    <div class="col-sm-5">
        {{field(**kwargs)|safe}}
    </div>
  </div>
{% else %}
    {{field(**kwargs)|safe}}
{% endif %}
{% endmacro %}

{% macro render_button(field) %}
   <div class="form-group">
    <div class="col-sm-offset-2 col-sm-10">
      {{field(**kwargs)|safe}}
    </div>
  </div>
{% endmacro %}