{% extends "forms/field.html.twig" %}

{% block label %}
{% endblock %}

{% block input %}
    <div class="form-input-wrapper {{ field.size }}">
        <input
            {# required attribute structures #}
            name="{{ (scope ~ field.name)|fieldName }}"
            value="{{ value|join(', ') }}"
            type="checkbox"
            {% if value == true %} checked="checked" {% endif %}

            {# input attribute structures #}
            {% block input_attributes %}
                {% if field.classes is defined %}class="{{ field.classes }}" {% endif %}
                {% if field.id is defined %}id="{{ field.id|e }}" {% endif %}
                {% if field.style is defined %}style="{{ field.style|e }}" {% endif %}
                {% if field.disabled %}disabled="disabled"{% endif %}
                {% if field.autofocus in ['on', 'true', 1] %}autofocus="autofocus"{% endif %}
                {% if field.novalidate in ['on', 'true', 1] %}novalidate="novalidate"{% endif %}
                {% if field.validate.required in ['on', 'true', 1] %}required="required"{% endif %}
            {% endblock %}
            />

        <label class="inline">{{ field.label|e }} {{ field.validate.required in ['on', 'true', 1] ? '<span class="required">*</span>' }}</label>
    </div>
{% endblock %}
