<div class="{% if error %}{{ field.error_class }}{% endif %}">
    <select id="{{ field.id }}"
            name="{{ field.id }}"
            data-allow-clear="true"
            data-placeholder="{{ _('Select a %(label)s', label=field.label) }}"
            class="{{ field.class_ }} {% if error %}{{ field.error_class }}{% endif %}"
            {% if field.multiple %}multiple{% endif %}
            {% if field.disabled %}disabled{% endif %}
            {% if field.select2 %}data-role="select2"{% endif %}>
        {% if not field.multiple and not field.required %}
            <option></option>
        {% endif %}
        {% for value, label in field._get_choices(request) %}
            <option value="{{ value }}" {{ 'selected' if (data is not none and (value in (data if field.multiple else [data]))) else '' }}>{{ label }}
            </option>
        {% endfor %}
    </select>
    {% if field.help_text %}
        <small class="form-hint mt-2">{{ field.help_text }}</small>
    {% endif %}
</div>
{% include "forms/_error.html" %}
