<ul class="itemLevel{{itemLevel}} list {% if itemLevel > 1 %}closed{% endif %}">
  <li class="openCloseTitle hover-highlight-effect {% if itemLevel > 1 %} iconExpandClosed {% else %} iconExpand {% endif %}">{{ layer.title }}</li>
  {% if layer.name|length > 0 %}
    <li>
      <span class="labelText">{{"mb.wms.wmsloader.repo.layer.label.name" | trans }}:</span>
      <span class="metaText">{{ layer.name }}</span>
    </li>
  {% endif %}
  {% if layer.title|length > 0 %}
  <li>
    <span class="labelText">{{"mb.wms.wmsloader.repo.layer.label.title" | trans }}:</span>
    <span class="metaText">{{ layer.title }}</span>
  </li>
  {% endif %}
  {% if layer.abstract|length > 0 %}
  <li>
    <span class="labelText">{{"mb.wms.wmsloader.repo.layer.label.abstract" | trans }}:</span>
    <span class="metaText">{{ layer.abstract }}</span>
  </li>
  {% endif %}
  {% if layer.queryable|length > 0 %}
  <li>
    <span class="labelText">{{"mb.wms.wmsloader.repo.layer.label.queryable" | trans }}:</span>
    <span class="metaText">{{ layer.queryable }}</span>
  </li>
  {% endif %}
  {% if layer.cascaded|length > 0 %}
  <li>
    <span class="labelText">{{"mb.wms.wmsloader.repo.layer.label.cascaded" | trans }}:</span>
    <span class="metaText">{{ layer.cascaded }}</span>
  </li>
  {% endif %}
  {% if layer.opaque|length > 0 %}
  <li>
    <span class="labelText">{{"mb.wms.wmsloader.repo.layer.label.opaque" | trans }}:</span>
    <span class="metaText">{{ layer.opaque }}</span>
  </li>
  {% endif %}
  {% if layer.noSubset|length > 0 %}
  <li>
    <span class="labelText">{{"mb.wms.wmsloader.repo.layer.label.nosubset" | trans }}:</span>
    <span class="metaText">{{ layer.noSubset }}</span>
  </li>
  {% endif %}
  {% if layer.fixedWidth|length > 0 %}
  <li>
    <span class="labelText">{{"mb.wms.wmsloader.repo.layer.label.fixedwidth" | trans }}:</span>
    <span class="metaText">{{ layer.fixedWidth }}</span>
  </li>
  {% endif %}
  {% if layer.fixedHeight|length > 0 %}
  <li>
    <span class="labelText">{{"mb.wms.wmsloader.repo.layer.label.fixedheight" | trans }}:</span>
    <span class="metaText">{{ layer.fixedHeight }}</span>
  </li>
  {% endif %}
  {% if layer.latlonBounds != null %}
    <li>
      <span class="labelText left">{{ "mb.wms.wmsloader.repo.layer.label.latlonbounds" | trans }}:</span>
      <span class="metaText">{{ layer.latlonBounds.srs }} {{ layer.latlonBounds.minx }}, {{ layer.latlonBounds.miny }}, {{ layer.latlonBounds.maxx }}, {{ layer.latlonBounds.maxy }}</span>
    </li>
  {% endif %}
  {% if layer.boundingBoxes|length > 0 %}
    <li>
      <span class="labelText left">{{ "mb.wms.wmsloader.repo.layer.label.boundingbox" | trans }}:</span>
      <ul class="left">
        {% for bbox in layer.boundingBoxes %}
          <li>
            <span class="metaText">{{ bbox.srs }} {{ bbox.minx }},{{ bbox.miny }},{{ bbox.maxx }},{{ bbox.maxy }}</span>
          </li>
        {% endfor %}
      </ul>
    </li>
  {% endif %}
  {% if layer.srs|length > 0 %}
  <li>
    <span class="labelText left">{{ "mb.wms.wmsloader.repo.layer.label.srs" | trans }}:</span>
    <span class="metaText">
      {% for srs in layer.srs %}
        {% if not loop.first %}, {% endif %}{{ srs }}
      {% endfor %}
    </span>
  </li>
  {% endif %}
  {% if layer.styles|length > 0 %}
    <li>
      <span class="labelText left">{{ "mb.wms.wmsloader.repo.layer.label.styles" | trans }}:</span>
        {% for style in layer.styles %}
          {% if not loop.first %}<br/>{% endif %}
          <span class="metaText">{{ "mb.wms.wmsloader.repo.layer.label.name" | trans }}: {{ style.name }}</span>
          <span class="metaText">{{ "mb.wms.wmsloader.repo.layer.label.title" | trans }}</dt>: {{ style.title }}</span>
          <span class="metaText">{{ "mb.wms.wmsloader.repo.layer.label.abstract" | trans }}: {{ style.abstract }}</span>
          <span class="metaText">
            {{ "mb.wms.wmsloader.repo.layer.label.legendurl" | trans }}: 
            {% if style.legendUrl is not null %}
            {{ style.legendUrl.width }}X{{ style.legendUrl.height }}
            {{ style.legendUrl.onlineResource.format }} {{ style.legendUrl.onlineResource.href }}
            {% endif %}
          </span>
          <span class="metaText">
            {{ "mb.wms.wmsloader.repo.layer.label.stylesheeturl" | trans }}:

            {% if layer.styleSheetUrl is defined %}
              {{ style.styleSheetUrl.format }} {{ style.styleSheetUrl.href }}
            {% endif %}<br/>
          </span>

          <span class="metaText">
            {{ "mb.wms.wmsloader.repo.layer.label.styleurl" | trans }}:
            {% if layer.styleUrl is defined %}
              {{ style.styleUrl.format }} {{ style.styleUrl.href }}
            {% endif %}
          </span>
        {% endfor %}
    </li>
  {% endif %}
  {% if layer.scale is defined and layer.scale != '' %}
    <li>
      <span class="labelText left">{{ "mb.wms.wmsloader.repo.layer.label.scale" | trans }}:</span>
      <span class="metaText">
          {{ "mb.wms.wmsloader.repo.layer.label.min" | trans }}:{% if layer.scale.min is not null %}{{ '%d'|format(layer.scale.min) }}{% endif %}<br/>
        {{ "mb.wms.wmsloader.repo.layer.label.max" | trans }}:{% if layer.scale.max is not null %}{{ '%d'|format(layer.scale.max) }}{% endif %}
      </span>

    </li>
  {% endif %}
  {% if layer.scaleHint is defined and layer.scaleHint != '' %}
  <li>
    <span class="labelText left">{{ "mb.wms.wmsloader.repo.layer.label.scalehint" | trans }}:</span>
    <span class="metaText">
      {{ "mb.wms.wmsloader.repo.layer.label.min" | trans }}:{% if layer.scaleHint.min is not null %}{{ layer.scaleHint.min }}{% endif %}<br/>
      {{ "mb.wms.wmsloader.repo.layer.label.max" | trans }}:{% if layer.scaleHint.max is not null %}{{ layer.scaleHint.max }}{% endif %}
    </span>
  </li>
  {% endif %}
  {% if layer.attribution is defined and layer.attribution != '' and layer.attribution|length > 0 %}
    <li>
      <span class="labelText left">{{ "mb.wms.wmsloader.repo.layer.label.attribution" | trans }}:</span>
        <ul class="left">
          <li>
            <span class="metaText">{{ "mb.wms.wmsloader.repo.layer.label.title" | trans }}:{{ layer.attribution.title }}</span>
          </li>
          <li>
            <span class="metaText">{{ "mb.wms.wmsloader.repo.layer.label.onlineresource" | trans }}:{{ layer.attribution.onlineResource }}</span>
          </li>
          <li>
            <span class="metaText">
              {{ "mb.wms.wmsloader.repo.layer.label.logourl" | trans }}:
              {{ layer.attribution.logoUrl.width }}X{{layer.attribution.logoUrl.height }}
              {{ layer.attribution.logoUrl.onlineResource.format }} {{ layer.attribution.logoUrl.onlineResource.href }}
            </span>
          </li>
        </ul>
    </li>
  {% endif %}
  {% if layer.identifier is defined and layer.identifier|length > 0 %}
    <li>
      <span class="labelText">{{ "mb.wms.wmsloader.repo.layer.label.identifier" | trans }}:</span>
      <ul>
        {% for identifier in layer.identifier %}
          {% if identifier.authority is defined and identifier.authority != '' %}
            <li>
              <span class="metaText">
                {{ "mb.wms.wmsloader.repo.layer.label.authority" | trans }}: 
                {{ "mb.wms.wmsloader.repo.layer.label.url" | trans }} {{ identifier.authority.url }}
                {{ "mb.wms.wmsloader.repo.layer.label.name" | trans }} {{ identifier.authority.name }}
              </span>
            </li>
          {% endif %}
          {% if identifier.value is defined %}
            <li><span class="metaText">{{ "mb.wms.wmsloader.repo.layer.label.value" | trans }}: {{ identifier.value }}</span></li>
          {% endif %}
        {% endfor %}
      </ul>
    </li>
  {% endif %}
  {% if layer.authority is defined and layer.authority|length > 0 %}
    <li>
      <span class="labelText">{{ "mb.wms.wmsloader.repo.layer.label.authority" | trans }}:</span>
      <ul>
        {% for authority in layer.authority %}
          <li>
            <span class="metaText">
            {{ "mb.wms.wmsloader.repo.layer.label.url" | trans }} {{ authority.url }}
            {% if authority.name is defined %}
              {{ "mb.wms.wmsloader.repo.layer.label.name" | trans }} {{ authority.name }}<br/>
            {% endif%}
          </li>
        {% endfor %}
      </ul>
    </li>
  {% endif %}
  {% if layer.metadataUrl is defined and layer.metadataUrl|length > 0 %}
    <li>
      <span class="labelText">{{ "mb.wms.wmsloader.repo.layer.label.metadataurl" | trans }}:</span>
        <ul>
        {% for metadataUrl in layer.metadataUrl %}
          <li>
            <span class="metaText">
              {{ metadataUrl.type }} {{ metadataUrl.onlineresource.format }} {{ metadataUrl.onlineresource.href }}
            </span>
          </li>
        {% endfor %}
        </ul>
    </li>
  {% endif %}
  {% if layer.dimension is defined and layer.dimension|length > 0 %}
  <li>
    <span class="labelText left">{{ "mb.wms.wmsloader.repo.layer.label.dimension" | trans }}:</span>
    <ul class="">
    {% for dimension in layer.dimension %}
      <li>
        <span class="metaText">
          name:'{{ dimension.name }}', units:'{{ dimension.units }}', unitSymbol:'{{ dimension.unitSymbol }}', 
          default:'{{ dimension.default }}', multipleValues:'{{ dimension.multipleValues }}', nearestValue:'{{ dimension.nearestValue }}',
          current:'{{ dimension.current }}', extent:'{{ dimension.extent }}'
        <span>
      </li>
    {% endfor %}
    </ul>
  </li>
  {% endif %}
  {% if layer.extent is defined and layer.extent|length > 0 %}
  <li>
    <span class="labelText">{{ "mb.wms.wmsloader.repo.layer.label.extent" | trans }}:</span>
      <ul>
      {% for extent in layer.extent %}
        <li>
          <span class="metaText">
            {{ extent.name }} {{ extent.default }} {{ extent.multipleValues }}
            {#{ extent.nearestValue }} {{ extent.current }} {{ extent.extentValue }#}
          <span>
        </li>
      {% endfor %}
      </ul>
  </li>
  {% endif %}
  {% if layer.dataUrl is defined and layer.dataUrl|length > 0 %}
    <li>
      <span class="labelText">{{ "mb.wms.wmsloader.repo.layer.label.dataurl" | trans }}:</span>
      <ul>
      {% for dataUrl in layer.dataUrl %}
        <li>
          <span class="metaText">
            {{ dataUrl.format }} {{ dataUrl.href }}
          <span>
        </li>
      {% endfor %}
      </ul>
    </li>
  {% endif %}
  {% if layer.featureListUrl is defined and layer.featureListUrl|length > 0 %}
    <li>
      <span class="labelText">{{ "mb.wms.wmsloader.repo.layer.label.featurelisturl" | trans }}:</span>
        <ul>
        {% for featureUrl in layer.featureListUrl %}
          <li>
            <span class="metaText">
              {{ featureUrl.format }} {{ featureUrl.href }}
            <span>
          </li>
        {% endfor %}
        </ul>
    </li>
  {% endif %}
  {% if layer.sublayer|length > 0 %}
    {% for sublayer in layer.sublayer %}
      <li>
        {% include "MapbenderWmsBundle:Repository:layer.html.twig"  with {'layer': sublayer, 'itemLevel': itemLevel + 1 }%}
      </li>
    {% endfor %}
  {% endif %}
</ul>
