{% extends "qommon/forms/widget.html" %}
{% block widget-control %}
<select id="form_{{widget.name}}" name="{{widget.name}}"
    {% if widget.select2 %}data-autocomplete="true"{% endif %}
    {% if widget.required %}data-required="true"{% endif %}
    {% for attr in widget.attrs.items %}{{attr.0}}="{{attr.1}}"{% endfor %}>
  {% if not widget.separate_hint and widget.hint %}
  <option value="" data-hint="{{ widget.hint }}">{% if not widget.select2 %}{{ widget.hint }}{% endif %}</option>
  {% endif %}
  {% for option in widget.get_options %}
  <option{% for attr in option.attrs.items %} {{attr.0}}="{{attr.1}}"{% endfor %}>{{ option.description }}</option>
  {% empty %}
    {% if widget.separate_hint or not widget.hint %}
    <option value="">---</option>
    {% endif %}
  {% endfor %}
</select>
{% endblock %}
