{%load pgfilters%}
    {% if field.is_hidden %}
      {{ field }}
    {% else %}{# not field.is_hidden #}
      {% if not field|ischeckbox %}
        <div class="form-group">
          {{field|label_class:"control-label col-lg-12"}}
          <div class="col-lg-12 controls">
            {% if field.errors %}
              {% for e in field.errors %}
                <div class="alert alert-danger">{{e}}</div>
              {% endfor %}
            {% endif %}
            {{field|field_class:"form-control"}}
            {%if field.help_text%}
              <small>{{field.help_text|safe}}</small>
            {%endif%}
          </div>
        </div>
      {% else %}{# field|ischeckbox #}
        <div class="form-group">
          <div class="col-lg-12 {%if field|isrequired_error%} alert alert-danger{%endif%}">
            {% if not field|ismultiplecheckboxes %}
              <div class="form-check">
                {{ field }}
                <label for="{{ field.id_for_label }}" class="form-check-label">
                  {{ field.label }}
                </label>
                {%if field.help_text%}
                  <small class="form-text text-muted">{{field.help_text|safe}}</small>
                {%endif%}
              </div>
            {% else %}
              {{ field.label_tag }}
	      {%if field.help_text%}<small class="form-text">{{field.help_text|safe}}</small>{%endif%}
              {% for cb in field %}
                <div class="form-check">
                  {{ cb.tag }}
                  <label for="{{ cb.id_for_label }}" class="form-check-label">{{ cb.choice_label }}</label>
{%if described_checkboxes|dictlookup:field.name%}

		  <div class="describedcheckbox">{{described_checkboxes|dictlookup:field.name|dictlookup:cb.data.value}}</div>
{%endif%}
                </div>
              {% endfor %}
            {% endif %}
          </div>
          {% if field.errors and not field|isrequired_error %}
            {% for e in field.errors %}
              <div class="alert alert-danger">{{e}}</div>
            {% endfor %}
          {% endif %}
        </div>
      {% endif %}
    {% endif %}
