mirror of
https://github.com/encode/django-rest-framework.git
synced 2025-08-05 21:10:13 +03:00
parent
5d10c2eb64
commit
72fe3deb2f
|
@ -13,8 +13,8 @@
|
||||||
{% if 'javascript' in langs %}{% include "rest_framework/docs/langs/javascript-intro.html" %}{% endif %}
|
{% if 'javascript' in langs %}{% include "rest_framework/docs/langs/javascript-intro.html" %}{% endif %}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
{% if document.data %}
|
{% if document|data %}
|
||||||
{% for section_key, section in document.data|items %}
|
{% for section_key, section in document|data|items %}
|
||||||
{% if section_key %}
|
{% 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>
|
<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>
|
</a></h2>
|
||||||
|
|
|
@ -5,8 +5,8 @@
|
||||||
<i class="fa fa-bars fa-2x toggle-btn" data-toggle="collapse" data-target="#menu-content"></i>
|
<i class="fa fa-bars fa-2x toggle-btn" data-toggle="collapse" data-target="#menu-content"></i>
|
||||||
<div class="menu-list">
|
<div class="menu-list">
|
||||||
<ul id="menu-content" class="menu-content collapse out">
|
<ul id="menu-content" class="menu-content collapse out">
|
||||||
{% if document.data %}
|
{% if document|data %}
|
||||||
{% for section_key, section in document.data|items %}
|
{% for section_key, section in document|data|items %}
|
||||||
<li data-toggle="collapse" data-target="#{{ section_key }}-dropdown" class="collapsed">
|
<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>
|
<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>
|
||||||
<ul class="sub-menu {% if section_key %}collapse{% endif %}" id="{{ section_key }}-dropdown">
|
<ul class="sub-menu {% if section_key %}collapse{% endif %}" id="{{ section_key }}-dropdown">
|
||||||
|
|
|
@ -245,6 +245,20 @@ def items(value):
|
||||||
return value.items()
|
return value.items()
|
||||||
|
|
||||||
|
|
||||||
|
@register.filter
|
||||||
|
def data(value):
|
||||||
|
"""
|
||||||
|
Simple filter to access `data` attribute of object,
|
||||||
|
specifically coreapi.Document.
|
||||||
|
|
||||||
|
As per `items` filter above, allows accessing `document.data` when
|
||||||
|
Document contains Link keyed-at "data".
|
||||||
|
|
||||||
|
See issue #5395
|
||||||
|
"""
|
||||||
|
return value.data
|
||||||
|
|
||||||
|
|
||||||
@register.filter
|
@register.filter
|
||||||
def schema_links(section, sec_key=None):
|
def schema_links(section, sec_key=None):
|
||||||
"""
|
"""
|
||||||
|
|
|
@ -27,7 +27,7 @@ def pytest_configure():
|
||||||
'BACKEND': 'django.template.backends.django.DjangoTemplates',
|
'BACKEND': 'django.template.backends.django.DjangoTemplates',
|
||||||
'APP_DIRS': True,
|
'APP_DIRS': True,
|
||||||
'OPTIONS': {
|
'OPTIONS': {
|
||||||
"debug": True, # We want template errors to raise
|
"debug": True, # We want template errors to raise
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
|
|
Loading…
Reference in New Issue
Block a user