{% load i18n %}

<div class="relate multiple{% if not value %} empty{% endif %}">
  <div class="multiple-search">
    <input type="search" id="id-{{ name }}" name="{{ name }}" 
           class="autocomplete"
           value=""
           data-search_minlength="{{ search_minlength }}"
           data-search_url="{{ search_url }}"
           placeholder="{{ hint }}">

    <input type="hidden" name="{{ name }}_rm" value="" class="rm-list" />
    <input type="hidden" name="{{ name }}_add" value="{{ initialvalue }}"
           class="add-list" />

    <div class="searchresults ui-front"></div>

  </div>

  <ul class="related">
    <li class="tpl" style="display: none">
      <span href="#">label</span> 
      <a href="#" data-urn="value"
         class="delete related-option">
        {% trans "Remove" %}
      </a>
    </li>
    {% for related in value %}
    <li>
      <span href="#">{{ related.label }}</span> 
      <a href="#" data-urn="{{ related.value }}" 
         class="delete related-option">
        {% comment %}Translators: relate widget remove relation{% endcomment %}
        {% trans "Remove" %}
      </a>
    </li>
    {% endfor %}
  </ul>
</div>
