#138 Changed template to handle the section grouping correctly

This commit is contained in:
drgomesp 2013-02-21 15:47:20 -03:00
parent 9c601664d1
commit fe96e262ec

View File

@ -1,20 +1,30 @@
{% extends "NelmioApiDocBundle::layout.html.twig" %} {% extends "NelmioApiDocBundle::layout.html.twig" %}
{% block content %} {% block content %}
{% for resource, methods in resources %} {% for section, sections in resources %}
<li class="resource"> {% for resource, methods in sections %}
<div class="heading"> <li class="resource">
<h2>{{ resource }}</h2> <div class="heading">
</div> {% if section == 'others' and resource == 'others' %}
<ul class="endpoints"> <h2>{{ resource }}</h2>
<li class="endpoint"> {% endif %}
<ul class="operations"> {% if section != 'others' %}
{% for data in methods %} <h1>{{ section }}</h1>
{% include 'NelmioApiDocBundle::method.html.twig' %} {% endif %}
{% endfor %} {% if resource != 'others' %}
</ul> <h2>{{ resource }}</h2>
</li> {% endif %}
</ul> </div>
</li> <ul class="endpoints">
<li class="endpoint">
<ul class="operations">
{% for data in methods %}
{% include 'NelmioApiDocBundle::method.html.twig' %}
{% endfor %}
</ul>
</li>
</ul>
</li>
{% endfor %}
{% endfor %} {% endfor %}
{% endblock content %} {% endblock content %}