From 64f737a5883c40b5fcc2fc180cbd8835afcc6dd0 Mon Sep 17 00:00:00 2001 From: Joseph Wenninger Date: Sat, 12 Aug 2017 14:51:59 +0200 Subject: [PATCH] allow at least one level of nesting --- .../templates/rest_framework/docs/document.html | 10 ++++++++-- .../templates/rest_framework/docs/interact.html | 4 ++-- .../templates/rest_framework/docs/link.html | 4 ++-- .../templates/rest_framework/docs/sidebar.html | 13 +++++++++---- 4 files changed, 21 insertions(+), 10 deletions(-) diff --git a/rest_framework/templates/rest_framework/docs/document.html b/rest_framework/templates/rest_framework/docs/document.html index 274eee4e3..467f64cb5 100644 --- a/rest_framework/templates/rest_framework/docs/document.html +++ b/rest_framework/templates/rest_framework/docs/document.html @@ -13,7 +13,7 @@ {% if 'javascript' in langs %}{% include "rest_framework/docs/langs/javascript-intro.html" %}{% endif %} -{% if document.data %} + {% for section_key, section in document.data|items %} {% if section_key %}

{{ section_key }} @@ -23,9 +23,15 @@ {% for link_key, link in section.links|items %} {% include "rest_framework/docs/link.html" %} {% endfor %} + {% if not section.links %} + {%for sub_section_key,sub_section in section.data|items%} + {% for link_key, link in sub_section.links|items %} + {% include "rest_framework/docs/link.html" %} + {% endfor %} + {%endfor%} + {% endif %} {% endfor %} {% for link_key, link in document.links|items %} {% include "rest_framework/docs/link.html" %} {% endfor %} -{% endif %} diff --git a/rest_framework/templates/rest_framework/docs/interact.html b/rest_framework/templates/rest_framework/docs/interact.html index 3703301c2..357d30213 100644 --- a/rest_framework/templates/rest_framework/docs/interact.html +++ b/rest_framework/templates/rest_framework/docs/interact.html @@ -1,7 +1,7 @@ {% load rest_framework %} -