mirror of
https://github.com/encode/django-rest-framework.git
synced 2025-08-04 20:40:14 +03:00
Use items
templatetag in recursive templates.
This essentially continues the changes from 0173e9bd
.
This commit is contained in:
parent
f98c88c498
commit
ba091db98c
|
@ -4,12 +4,12 @@
|
|||
</a></h{{level}}>
|
||||
{% endif %}
|
||||
|
||||
{% if section.links.items %}
|
||||
{% for link_key, link in section.links.items %}
|
||||
{% if section.links|items %}
|
||||
{% for link_key, link in section.links|items %}
|
||||
{% include "rest_framework/docs/link.html" with prefix=prefix level=level|add:1%}
|
||||
{% endfor %}
|
||||
{% else %}
|
||||
{% include 'rest_framework/docs/_recursive_document.html' with items=section.items prefix=prefix|add:section_key|add:'/' level=level|add:1 %}
|
||||
{% include 'rest_framework/docs/_recursive_document.html' with items=section|items prefix=prefix|add:section_key|add:'/' level=level|add:1 %}
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
|
||||
|
|
|
@ -3,17 +3,17 @@
|
|||
<li data-toggle="collapse" data-target="#{{prefix}}{{ section_key }}-dropdown" class="collapsed">
|
||||
<a><i class="fa fa-dot-circle-o fa-lg"></i> {% if prefix %}{{prefix}}/{% endif %}{% if section_key %}{{ section_key }}{% else %}API Endpoints{% endif %} <span class="arrow"></span></a>
|
||||
</li>
|
||||
{% if section.links.items %}
|
||||
{% if section.links|items %}
|
||||
<ul class="sub-menu {% if section_key %}collapse{% endif %}" id="{{prefix}}{{ section_key }}-dropdown">
|
||||
{% for link_key, link in section.links.items %}
|
||||
{% for link_key, link in section.links|items %}
|
||||
<li><a href="#{% if prefix %}{{prefix}}/{% endif %}{{ section_key }}-{{ link_key }}">{{ link.title|default:link_key }}</a></li>
|
||||
{% endfor %}
|
||||
</ul>
|
||||
{% else %}
|
||||
{% if prefix %}
|
||||
{% include 'rest_framework/docs/_recursive_menu.html' with items=section.items prefix=prefix|add:'/'|add:section_key %}
|
||||
{% include 'rest_framework/docs/_recursive_menu.html' with items=section|items prefix=prefix|add:'/'|add:section_key %}
|
||||
{% else %}
|
||||
{% include 'rest_framework/docs/_recursive_menu.html' with items=section.items prefix=section_key %}
|
||||
{% include 'rest_framework/docs/_recursive_menu.html' with items=section|items prefix=section_key %}
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
|
|
Loading…
Reference in New Issue
Block a user