{% load common_form_filters %} {% load common_tags %} {% capture as aria_invalid_attr %}aria-invalid:{% if field.errors %}true{% else %}false{% endif %}{% endcapture %} {% with input_type=field.field.widget.input_type %} {% if input_type == 'hidden' and 'data-node-name' not in field.field.widget.attrs %} {{ field }} {% else %}
{% if field.field.widget.choices|length > 0 %} {% if input_type == 'radio' or input_type == 'checkbox' %}
{{ field.label }} {% if field.field.required %}{{ required_star }}{% endif %}
{% for sub_field in field %}
{% comment %} id_for_label can be wrong for some reason {% endcomment %} {% if not field.field.widget.segmented_control %}
{% endfor %}
{% include "common/form/field_meta.html" with field_id=field.html_name %}
{% elif input_type == 'select' %} {% include "common/form/input.html" %} {% include "common/form/field_meta.html" with field_id=field.id_for_label %} {% endif %} {% else %} {% if input_type == 'hidden' %} {{ field }} {% elif input_type == 'checkbox' %} {% if field.field.widget.switch %}
{% endif %} {% if field.field.widget.switch %}
{% endif %} {% else %} {% include "common/form/input.html" %} {% endif %} {% include "common/form/field_meta.html" with field_id=field.id_for_label %} {% endif %}
{% endif %} {% endwith %}