{% load widget_tweaks village_tags %}
<fieldset class="village-fieldset{% if field.errors %} village-fieldset--error{% endif %}"
          id="checkboxes-{{ field.auto_id }}"
          aria-labelledby="{{ field.auto_id }}-legend{% if field.errors %} {{ field.auto_id }}-messages{% endif %}">
  <legend class="village-fieldset__legend facile-text--regular"
          id="{{ field.auto_id }}-legend">
    {{ field.label_tag }}
    {% if field.field.required %}
      *
    {% endif %}
    {% if field.help_text %}
      <span class="village-hint-text">{{ field.help_text }}</span>
    {% endif %}
  </legend>
  <div class="village-fieldset__content">
    <div class="village-checkbox-group{% if field.errors %} village-checkbox-group--error{% endif %}{% if field.field.disabled %} village-input-group--disabled{% endif %}">
      {% if field.errors %}
        {% with aria_describedby="aria-describedby:"|add:field.auto_id|add:"-desc-error" %}
          {{ field|village_input_class_attr|attr:"type:checkbox"|attr:aria_describedby }}
        {% endwith %}
      {% else %}
        {{ field|village_input_class_attr|attr:"type:checkbox" }}
      {% endif %}
      {% if field.errors %}
        <div id="{{ field.auto_id }}-desc-error" class="village-error-text">
          {{ field.errors }}
        </div>
      {% endif %}
    </div>
  </div>
  {% if field.errors %}
    <div id="{{ field.auto_id }}-messages">
      {{ field.errors }}
    </div>
  {% endif %}
</fieldset>
