#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" %}
{% block content %}
{% for resource, methods in resources %}
<li class="resource">
<div class="heading">
<h2>{{ resource }}</h2>
</div>
<ul class="endpoints">
<li class="endpoint">
<ul class="operations">
{% for data in methods %}
{% include 'NelmioApiDocBundle::method.html.twig' %}
{% endfor %}
</ul>
</li>
</ul>
</li>
{% for section, sections in resources %}
{% for resource, methods in sections %}
<li class="resource">
<div class="heading">
{% if section == 'others' and resource == 'others' %}
<h2>{{ resource }}</h2>
{% endif %}
{% if section != 'others' %}
<h1>{{ section }}</h1>
{% endif %}
{% if resource != 'others' %}
<h2>{{ resource }}</h2>
{% endif %}
</div>
<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 %}
{% endblock content %}