{% extends "django_cradmin/viewhelpers/listfilter/base/abstractfilter.django.html" %}

{% block label-for %}{% endblock label-for %}

{% block inputfield %}
    <div id="{{ me.get_inputfield_dom_id }}"
            class="django-cradmin-listfilter-radiolist"
            django-cradmin-listfilter-radiolist={{ me.get_angularjs_options_json|safe }}>
        {% for choicedata in choicesdata %}
            <div class="radio" id="{{ choicedata.dom_id }}_wrapper">
                {% comment %}
                    We use aria-labeledby to make screenreaders read the main label
                    and the radio label (without this we have no context for the
                    value). Some browsers will read the value twice with this, while
                    others will only read the main label if we only have the main
                    label in aria-labeledby.
                {% endcomment %}
                <label id="{{ choicedata.dom_id }}_label">
                    <input type="radio"
                           id="{{ choicedata.dom_id }}"
                           data-url="{{ choicedata.url }}"
                           aria-labeledby="{{ me.get_label_dom_id }} {{ choicedata.dom_id }}_label"
                           {% if choicedata.is_selected %}checked{% endif %}>
                    {{ choicedata.label }}
                </label>
            </div>
        {% endfor %}
    </div>
{% endblock inputfield %}
