<div class="description">
  <span class="right">{{ 'mb.manager.admin.template' | trans }}: {{template_name|default('Unknown')}}</span>
  <div class="clear"></div>
</div>

{% for region in regions %}
  <div class="{{region}} region">
      <table class="application-component-table elementsTable" data-region="{{ region }}">
        <thead>
          <tr>
            <th colspan="2">
              <h3 class="subTitle">{{ region | capitalize }}</h3>
            </th>
            <th class="iconColumn regionProperties">
              {% if true and form[region] is defined %}
                  {{ form_widget(form[region]) }}
              {% endif %}
            </th>
          </tr>
          <tr>
            <th>{{ 'mb.manager.admin.element.title' | trans }}</th>
            <th class="type">{{ 'mb.manager.admin.element.type' | trans }}</th>
            <th class="iconColumn">
              <a href="{{ path('mapbender_manager_element_select', { 'slug': application.slug, 'region': region }) }}" class="iconAdd hover-highlight-effect addElement" title="{{'mb.manager.admin.element.add'|trans}} {{region}}"></a>
            </th>
          </tr>
        </thead>
        <tbody>
        {% for element in application.getElementsByRegion(region) %}
              <tr class="element" data-id="{{element.id}}" data-href="{{ path('mapbender_manager_element_weight', {'id': element.id})}}">
                <td class="titleColumn description">{{ element.title | trans }}</td>
                <td class="typeColumn description">{{ element_class_title(element) | trans }}</td>
                <td class="iconColumn">
                  <div class="checkWrapper hover-highlight-effect {{ element.enabled ? 'iconPublishActive' : 'iconPublish' }}"
                       title="{{"mb.manager.admin.element.show_hide"|trans}} {{element.title}}"
                       data-icon-off="iconPublish" data-icon-on="iconPublishActive">
                    <input class="checkbox"
                           data-url="{{ path('mapbender_manager_element_enable', { 'id': element.id })}}"
                           data-id="{{ element.id }}" type="checkbox" {% if element.enabled %} checked="checked" {% endif %}>
                  </div>
                  <span class="iconEdit editElement hover-highlight-effect"
                        title="{{"mb.manager.admin.element.edit"|trans}}  {{element.title}}"
                        data-url="{{ path('mapbender_manager_element_edit', {'slug': application.slug, 'id': element.id})}}"></span>
                  <span class="iconKey secureElement {% if aclManager.hasObjectAclEntries(element) %}has {% endif %}hover-highlight-effect"
                        title="{{ "mb.manager.managerbundle.acl_element"|trans }}  {{ element.title }}

{% for acl in aclManager.getObjectAclEntriesAsArray(element) %}
{{acl.type}}: {{ acl.name }}
{% endfor %}"
                        data-url="{{ path('mapbender_manager_element_security', {'slug': application.slug, 'id': element.id })}}"></span>
                  <span class="iconRemove removeElement hover-highlight-effect"
                        title="{% trans with {'%element_title%': element.title} %} mb.manager.be.element.delete {% endtrans %}"
                        data-slug="{{ application.slug }}"
                        data-url="{{ path('mapbender_manager_element_delete', {'slug': application.slug, 'id': element.id}) }}"></span>
                </td>
              </tr>
        {% else %}
            <tr class="dummy">
              <td class="description">{{"mb.manager.admin.element.no_element_added."|trans}}</td>
              <td></td>
              <td></td>
            </tr>
        {% endfor %}
        </tbody>
      </table>
  </div>
{% endfor %}
