{% load aldryn_forms_tags i18n %}

{% if field %}
    {% for choice in field.field.choices %}
        <div class="radio{% if field.field.required %} form-required{% endif %}{% if field.errors %} has-error{% endif %}">
            {% block form_field_label %}
                <label for="{{ field.auto_id }}_{{ choice.0 }}">
                    {% block form_field %}
                        <input type="radio" name="{{ field.name }}" id="{{ field.auto_id }}_{{ choice.0 }}" value="{{ field.value }}" {% if field.value == choice.0 %}checked="checked"{% endif %}>
                    {% endblock form_field %}
                    {{ choice.1 }}
                </label>
            {% endblock form_field_label %}
            {% block form_field_errors %}
                {% if field.errors %}
                    {% for error in field.errors %}
                        <span class="text-danger">{{ error }}</span>
                    {% endfor %}
                {% endif %}
            {% endblock form_field_errors %}
        </div>
    {% endfor %}
{% endif %}
