<!-- ENUMERATE format -->
{% load static %}
{% load i18n %}

<!-- # value: [ { 'key':'keyname' , 'selected':True/False }, ...    ]  -->

{% if item.is_multi %} <!-- multi -->
<div class="mb-3 row">
<label class="col-form-label col-sm-2">{{ item.displayname }}</label>

<div class="form-check col-sm-10">
<select class="form-check col-sm-10" name="{{ item.fieldname }}" id="id_{{item.fieldname}}" multiple
  data-cv-select2="simple">
    {% for instance in item.value %}
    {% if instance.selected %}
        {% if instance.widget %}
            <option value="{{ instance.value }}" selected>{{ instance.widget|safe }} &nbsp;  {{ instance.value }}</option>
          {% else %}
            <option value="{{ instance.value }}" selected>{{ instance.value }}</option>
          {% endif %}
    {% else %}
          {% if instance.widget %}
            <option value="{{ instance.value }}">{{ instance.widget|safe }} &nbsp; {{ instance.value }}</option>
           {% else %}
            <option value="{{ instance.value }}">{{ instance.value }}</option>
          {% endif %}
    {% endif %}
    {% endfor %}
</select>
  {% if item.description %}<div class="form-text">{{ item.description }}</div>{% endif %}
</div>

</div>

{% else %} <!-- single -->
<div class="mb-3 row">
<label class="col-form-label col-sm-2">{{ item.displayname }}</label>

<div class="form-check col-sm-10">
<select class="form-check col-sm-10" name="{{ item.fieldname }}" id="id_{{item.fieldname}}"
  data-cv-select2="simple">
    <option value="">----------------------</option>
    {% for instance in item.value %}
    {% if instance.selected %} 
        {% if instance.widget %}
            <option value="{{ instance.value }}" selected>{{ instance.widget|safe }} &nbsp; {{ instance.value }}</option>
        {% else %}
            <option value="{{ instance.value }}" selected>{{ instance.value }}</option>
        {% endif %}
    {% else %}
        {% if instance.widget %}
          <option value="{{ instance.value }}">{{ instance.widget|safe }} &nbsp; {{ instance.value }}</option>
        {% else %}
          <option value="{{ instance.value }}">{{ instance.value }}</option>
        {% endif %}
    {% endif %}
    {% endfor %}
</select>
  {% if item.description %}<div class="form-text">{{ item.description }}</div>{% endif %}
</div>

</div>





{% endif %}


