{% include '@MapbenderManager/fragments/filter-group.html.twig' with {filterTargetId: 'listFilterSources'} %}

<ul id="listFilterSources">
  {% for instance in reusable_instances %}
  <li class="filterItem">
    <a class="checkContainer" href="{{ path('mapbender_manager_application_attachreusableinstance', {'layerset': layerset, 'instance': instance}) }}">
      <h3>
        <span class="badge badge--datasource bg-info pull-right bg-sm"><i class="fas fa-wifi"></i>&nbsp;{{ 'mb.terms.sourceinstance.reusable.singular' | trans }} #{{ instance.id }}</span>
        {{ instance.source.type | source_label }}#{{ instance.source.id }}: {{ instance.title | default(instance.source.title) }}<sup>{{ instance.source.alias }}</sup>
        <div class="clear"></div>
      </h3>
      <div>{{ instance.source.description }}</div>
    </a>
  {% endfor %}
{% for source in sources %}
  <li class="filterItem">
    <a class="checkContainer" href="{{ path("mapbender_manager_application_addinstance",{'slug': application.slug, "layersetId": layerset.id, "sourceId": source.id}) }}">
      <h3>{{ source.type | source_label }}#{{ source.id }}: {{ source.title }}<sup>{{ source.alias }}</sup></h3>
      <div>{{ source.description }}</div>
    </a>
  </li>
{% else %}
  <li>{{ 'mb.manager.source.no_source' | trans }}</li>
{% endfor %}
</ul>
