{% extends 'forms/base_widget.html' %}


{% block html %}
    {% set input_args = dict(input_args) %}
    {% set field_disabled = input_args.pop('disabled', false) %}
    {% set reasons = field.disabled_choices_reasons|default({}) %}
    {% for subfield in field %}
        {% set disabled = field_disabled or subfield.data in field.disabled_choices|default([]) %}
        {% set reason = reasons.get(subfield.data) %}
        <div class="i-checkbox">
            <span class="checkbox-label {{ 'checkbox-disabled' if disabled }}">
                {{ subfield(disabled=disabled, **input_args) }}
                {{ subfield.label }}
            </span>
            {% if disabled and reason %}
                <i class="icon-warning icon-padding" title="{{ reason }}"></i>
            {% endif %}
        </div>
    {% endfor %}
{% endblock %}
