{% load widget_tweaks village_tags %}
{# Generic input snippet used by most of the field types #}
<div class="{{ field.field.widget.group_class|default:'village-input-group' }}{% if field.errors %} {{ field.field.widget.group_class|default:'village-input-group' }}--error{% endif %}{% if field.field.disabled %} village-input-group--disabled{% endif %}">
  <label for="{{ field.id_for_label }}" class="village-label">
    {{ field.label }}
    {% if field.field.required %}
      *
    {% endif %}
    {% if field.help_text %}
      <span class="village-hint-text">{{ field.help_text }}</span>
    {% endif %}
  </label>
  {% if field.errors %}
    {% with aria_describedby="aria-describedby:"|add:field.auto_id|add:"-desc-error" %}
      {{ field|village_input_class_attr|attr:"aria-invalid:true"|attr:aria_describedby }}
    {% endwith %}
  {% else %}
    {{ field|village_input_class_attr }}
  {% endif %}
  {% if field.errors %}
    <div id="{{ field.auto_id }}-desc-error">
      {{ field.errors }}
    </div>
  {% endif %}
</div>
