Include @detail_routes and @list_routes in the auto generated docs.

This commit is contained in:
Tommy Beadle 2017-04-04 14:35:05 -04:00
parent 5e6b233977
commit aa10958627
4 changed files with 41 additions and 25 deletions

View File

@ -0,0 +1,17 @@
{% load rest_framework %}
{% for link_key, link in section.links|items %}
{% with section_key=parent_key %}
{% include "rest_framework/docs/link.html" %}
{% endwith %}
{% endfor %}
{% for section_key, sect in section.data|items %}
{% if section_key %}
<h2 id="{{ parent_key|add:'-' }}{{ section_key }}" class="coredocs-section-title">{{ parent_key|add:' / ' }}{{ section_key }} <a href="#{{ parent_key|add:'-' }}{{ section_key }}"><i class="fa fa-link" aria-hidden="true"></i></a></h2>
{% endif %}
{% with parent_key=parent_key|add:'-'|add:section_key section=sect %}
{% include "rest_framework/docs/document-incl.html" %}
{% endwith %}
{% endfor %}

View File

@ -14,17 +14,6 @@
</div>
</div>
{% for section_key, section in document.data|items %}
{% if section_key %}
<h2 id="{{ section_key }}" class="coredocs-section-title">{{ section_key }} <a href="#{{ section_key }}"><i class="fa fa-link" aria-hidden="true"></i>
</a></h2>
{% endif %}
{% for link_key, link in section.links|items %}
{% include "rest_framework/docs/link.html" %}
{% endfor %}
{% endfor %}
{% for link_key, link in document.links|items %}
{% include "rest_framework/docs/link.html" %}
{% endfor %}
{% with parent_key=None section=document %}
{% include "rest_framework/docs/document-incl.html" %}
{% endwith %}

View File

@ -0,0 +1,18 @@
{% load rest_framework %}
{% if section.links %}
<ul class="sub-menu {% if parent_key %}collapse{% endif %}" id="{{ parent_key }}-dropdown">
{% for link_key, link in section.links|items %}
<li><a href="#{{ parent_key }}-{{ link_key }}">{{ link.title|default:link_key }}</a></li>
{% endfor %}
</ul>
{% endif %}
{% for key, sect in section.data|items %}
<li data-toggle="collapse" data-target="#{{ parent_key|add:'-' }}{{ key }}-dropdown" class="collapsed">
<a><i class="fa fa-dot-circle-o fa-lg"></i> {{ parent_key|add:' / ' }}{% if key %}{{ key }}{% else %}API Endpoints{% endif %} <span class="arrow"></span></a>
</li>
{% with section=sect parent_key=parent_key|add:'-'|add:key %}
{% include 'rest_framework/docs/sidebar-menu.html' %}
{% endwith %}
{% endfor %}

View File

@ -1,20 +1,12 @@
{% load rest_framework %}
<div class="sidebar">
<h3 class="brand"><a href="#">{{ document.title }}</a></h3>
<i class="fa fa-bars fa-2x toggle-btn" data-toggle="collapse" data-target="#menu-content"></i>
<div class="menu-list">
<ul id="menu-content" class="menu-content collapse out">
{% for section_key, section in document.data|items %}
<li data-toggle="collapse" data-target="#{{ section_key }}-dropdown" class="collapsed">
<a><i class="fa fa-dot-circle-o fa-lg"></i> {% if section_key %}{{ section_key }}{% else %}API Endpoints{% endif %} <span class="arrow"></span></a>
</li>
<ul class="sub-menu {% if section_key %}collapse{% endif %}" id="{{ section_key }}-dropdown">
{% for link_key, link in section.links|items %}
<li><a href="#{{ section_key }}-{{ link_key }}">{{ link.title|default:link_key }}</a></li>
{% endfor %}
</ul>
{% endfor %}
{% with parent_key=None section=document %}
{% include 'rest_framework/docs/sidebar-menu.html' %}
{% endwith %}
</ul>
<ul class="menu-list menu-list-bottom">