<a href="{{ path("mapbender_manager_application_newlayerset",{'slug': application.slug}) }}" class="iconAdd right addLayerset iconBig" title="{{ 'mb.manager.admin.layerset.add' | trans}}"></a>
{% if application.layersets|length > 0 %}
  <label for="inputFilterLayersets" class="labelInput">{{"mb.manager.admin.filter.layerset"|trans}}</label><input id="inputFilterLayersets" type="text" class="input listFilterInput" data-filter-target="all-instances">

  <ul class="listFilterContainer" id="all-instances">
    {% for layerset in application.layersets %}
      <li class="filterItem">
        <table class="application-component-table layersetTable" data-id="{{ layerset.id }}">
          <thead>
            <tr class='doNotFilter'>
              <th colspan="4">
                <h3 class="subTitle">{{ layerset.title }}</h3>
              </th>
            </tr>
            <tr class='doNotFilter'>
              <th title="{{ 'mb.manager.admin.layerset.id_description' | trans }}">{{ 'mb.manager.admin.layerset.id' | trans }}</th>
              <th>{{ 'mb.manager.admin.layerset.title' | trans }}</th>
              <th>{{ 'mb.manager.admin.layerset.type' | trans }}</th>
              <th class="iconColumn">
                <a class="iconAdd hover-highlight-effect addInstance" title="{{"mb.manager.admin.instance.add"|trans}}" href="{{ path("mapbender_manager_application_listsources",{'slug': application.slug, 'layersetId': layerset.id}) }}"></a>
                <a class="iconEdit hover-highlight-effect editLayerset" title="{{"mb.manager.admin.layerset.edit"|trans}} {{layerset.title}}" href="{{ path("mapbender_manager_application_editlayerset",{'slug': application.slug, 'layersetId': layerset.id}) }}"></a>
                <a class="iconRemove hover-highlight-effect removeLayerset" title="{{"mb.manager.admin.layerset.delete.title"|trans}} {{layerset.title}}" href="{{ path("mapbender_manager_application_confirmdeletelayerset",{'slug': application.slug, 'layersetId': layerset.id}) }}"></a>
              </th>
            </tr>
          </thead>
          <tbody>
            {% for instance in layerset.instances %}
              <tr class="sourceinst" data-id="{{ instance.id }}" data-href="{{ path('mapbender_manager_repository_instanceweight', {'slug': application.slug,'layersetId': layerset.id, 'instanceId': instance.id})}}">
                <td class="idColumn description" title="{{ 'mb.manager.admin.layerset.id_description' | trans }}">{{ instance.source.id }}/{{ instance.id }}</td>
                <td class="titleColumn description">{{ instance.title }} ({{ instance.source.title }})</td>
                <td class="typeColumn description">{{ instance.source.type }}</td>
                <td class="iconColumn">
                  <div class="checkWrapper hover-highlight-effect {{  instance.enabled ? 'iconPublishActive' : 'iconPublish' }}"
                       title="{{"mb.manager.admin.instance.show_hide"|trans}} {{instance.title}}"
                       data-icon-off="iconPublish" data-icon-on="iconPublishActive">
                    <input class="checkbox" data-url="{{ path('mapbender_manager_repository_instanceenabled', {'slug': application.slug,'layersetId': layerset.id, 'instanceId': instance.id})}}" data-id="{{ instance.id }}" type="checkbox" {% if instance.enabled %} checked="checked" {% endif %}>
                  </div>
                  <a class="iconEdit hover-highlight-effect editInstance" title="{{"mb.manager.admin.instance.edit"|trans}} {{instance.title}}" href="{{ path("mapbender_manager_repository_instance",{"slug": application.slug, "instanceId": instance.id})  }}"></a>
                  <span class="iconRemove hover-highlight-effect removeInstance" title="{{"mb.manager.admin.instance.delete.title"|trans}} {{instance.title}}" data-id="{{ layerset.id }}" data-slug="{{ application.slug }}" data-url="{{ path("mapbender_manager_application_deleteinstance",{"slug": application.slug, 'layersetId': layerset.id, "instanceId": instance.id}) }}"></span>
                </td>
              </tr>
            {% else %}
              <tr>
                <td colspan="4" class="description">{{ 'mb.manager.admin.instance.no_instance_added' | trans }}</td>
              </tr>
            {% endfor %}
          </tbody>
        </table>
      </li>
    {% endfor %}
  </ul>
{% else %}
  <p class="description">{{ 'mb.manager.admin.instance.no_layer_added' | trans }}</p>
{% endif %}
