{% include "header.html" %}
<h1>MapServer Mapfile Landing Page</h1>
<ul>
    <li><b>Title:</b> {{response.title}}</li>
    <li><b>Layer Count:</b> {{response.layer-count}}</li>
    <li><b>Map Name:</b> {{response.name}}</li>
</ul>
<p>
    Below are all the services available for this Mapfile.
</p>
<table>
    <thead>
        <tr>
            <th>#</th>
            <th>Type</th>
            <th>Service</th>
            <th>Title</th>
        </tr>
    </thead>
    <tbody>
        {% set index = 1 -%}
        {% for link in response.linkset -%}
        {% if existsIn(link, "service-doc") -%}
        {% for service in link.service-doc -%}
        <tr>
            <td>{{ index }}</td>
            <td>{{ service.service }}</td>
            <td><a href="{{ service.href }}">{{ service.title }}</a></td>
            <td>{{ link.title }}</td>
        </tr>
        {% set index = index + 1 -%}
        {% endfor -%}
        {% endif -%}
        {% if existsIn(link, "service-desc") -%}
        {% for service in link.service-desc -%}
        <tr>
            <td>{{ index }}</td>
            <td>{{ service.service }}</td>
            <td><a href="{{ service.href }}">{{ service.title }}</a></td>
            <td>{{ link.title }}</td>
        </tr>
        {% set index = index + 1 -%}
        {% endfor -%}
        {% endif -%}
        {% endfor -%}
    </tbody>
</table>
{% include "footer.html" -%}