mirror of
https://github.com/encode/django-rest-framework.git
synced 2025-08-06 21:40:13 +03:00
Docs - Improve UI (#4890)
This commit is contained in:
parent
cc7ff979ce
commit
d37994821d
|
@ -186,13 +186,29 @@ body {
|
||||||
padding: 0px;
|
padding: 0px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.coredocs-section {
|
.coredocs-section-title {
|
||||||
margin-top: 20px;
|
margin-top: 20px;
|
||||||
padding-bottom: 10px;
|
padding-bottom: 10px;
|
||||||
border-bottom: 1px solid lightgrey;
|
border-bottom: 1px solid lightgrey;
|
||||||
}
|
}
|
||||||
|
|
||||||
.coredocs-section:last-child {
|
.coredocs-link-title a,
|
||||||
|
.coredocs-section-title a {
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
.coredocs-link-title a,
|
||||||
|
.coredocs-section-title a {
|
||||||
|
text-decoration: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
.coredocs-link-title:hover a,
|
||||||
|
.coredocs-section-title:hover a {
|
||||||
|
display: inline;
|
||||||
|
font-size: 20px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.coredocs-section-title:last-child {
|
||||||
margin-top: 0;
|
margin-top: 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -242,6 +258,18 @@ body {
|
||||||
|
|
||||||
/* @group Docs Content */
|
/* @group Docs Content */
|
||||||
|
|
||||||
|
.docs-content .meta .label {
|
||||||
|
vertical-align: middle;
|
||||||
|
font-size: 14px;
|
||||||
|
font-weight: normal;
|
||||||
|
}
|
||||||
|
|
||||||
|
.docs-content .meta code {
|
||||||
|
vertical-align: middle;
|
||||||
|
padding: .2em .6em .3em;
|
||||||
|
font-size: 14px;
|
||||||
|
}
|
||||||
|
|
||||||
.docs-content .btn {
|
.docs-content .btn {
|
||||||
font-size: inherit;
|
font-size: inherit;
|
||||||
}
|
}
|
||||||
|
@ -249,4 +277,5 @@ body {
|
||||||
.code-samples pre {
|
.code-samples pre {
|
||||||
margin-top: 20px;
|
margin-top: 20px;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* @end Docs Content */
|
/* @end Docs Content */
|
||||||
|
|
|
@ -1,7 +1,9 @@
|
||||||
{% load rest_framework %}
|
{% load rest_framework %}
|
||||||
|
|
||||||
{% for section_key, section in document.data.items %}
|
{% for section_key, section in document.data.items %}
|
||||||
<h2 id="{{ section_key }}" class="coredocs-section"><i class="fa fa-angle-right"></i> {{ section_key }}</h2>
|
<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>
|
||||||
|
|
||||||
{% for link_key, link in section.links.items %}
|
{% for link_key, link in section.links.items %}
|
||||||
{% include "rest_framework/docs/link.html" %}
|
{% include "rest_framework/docs/link.html" %}
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
|
|
|
@ -2,12 +2,21 @@
|
||||||
<div class="row coredocs-link">
|
<div class="row coredocs-link">
|
||||||
|
|
||||||
<div class="col-md-6 docs-content">
|
<div class="col-md-6 docs-content">
|
||||||
<button class="btn btn-sm btn-success" style="float: right; margin-top: 20px" data-toggle="modal" data-target="#{{ section_key }}_{{ link_key }}_modal">Interact</button>
|
<button
|
||||||
|
class="btn btn-sm btn-success"
|
||||||
|
style="float: right; margin-top: 20px"
|
||||||
|
data-toggle="modal"
|
||||||
|
data-target="#{{ section_key }}_{{ link_key }}_modal">
|
||||||
|
Interact
|
||||||
|
</button>
|
||||||
|
|
||||||
<h3 id="{{ section_key }}-{{ link_key }}">{{ link.title|default:link_key }}</h3>
|
<h3 id="{{ section_key }}-{{ link_key }}" class="coredocs-link-title">{{ link.title|default:link_key }} <a href="#{{ section_key }}-{{ link_key }}"><i class="fa fa-link" aria-hidden="true"></i>
|
||||||
<p>
|
</a></h3>
|
||||||
<span class="label label-primary">{{ link.action|upper }}</span> <code>{{ link.url }}</code>
|
|
||||||
</p>
|
<div class="meta">
|
||||||
|
<span class="label label-primary">{{ link.action|upper }}</span>
|
||||||
|
<code>{{ link.url }}</code>
|
||||||
|
</div>
|
||||||
|
|
||||||
<p>{% render_markdown link.description %}</p>
|
<p>{% render_markdown link.description %}</p>
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user