File tree Expand file tree Collapse file tree 1 file changed +43
-0
lines changed
rest_framework_docs/templates/rest_framework_docs Expand file tree Collapse file tree 1 file changed +43
-0
lines changed Original file line number Diff line number Diff line change
1
+ <!DOCTYPE html>
2
+ < html >
3
+ < head >
4
+ < style >
5
+ table {
6
+ font-family : arial, sans-serif;
7
+ border-collapse : collapse;
8
+ width : 100% ;
9
+ }
10
+
11
+ td , th {
12
+ border : 1px solid # dddddd ;
13
+ text-align : left;
14
+ padding : 8px ;
15
+ }
16
+
17
+ tr : nth-child (even) {
18
+ background-color : # ECF0F1 ;
19
+ }
20
+ </ style >
21
+ </ head >
1
22
{% extends "rest_framework_docs/docs.html" %}
2
23
{% load drfdocs_filters %}
3
24
@@ -65,8 +86,29 @@ <h4 class="panel-title title">
65
86
{% endif %}
66
87
67
88
{% if endpoint.fields %}
89
+ {% if desc_table %}
90
+ < p class ="fields-desc "> Fields details:</ p >
91
+ < table >
92
+ < tr >
93
+ < th > Field Name </ th >
94
+ < th > Field Type </ th >
95
+ < th > Max Length </ th >
96
+ < th > Is Required </ th >
97
+ </ tr >
98
+ {% for field in endpoint.fields %}
99
+ < tr >
100
+ < td > {{ field.name }} </ td >
101
+ < td > {{ field.type }} </ td >
102
+ < td > {{ field.max_length }} </ td >
103
+ < td > {{ field.required }} </ td >
104
+ </ tr >
105
+ {% endfor %}
106
+ </ table >
107
+ {% else %}
108
+
68
109
< p class ="fields-desc "> Fields:</ p >
69
110
{%include "rest_framework_docs/components/fields_list.html" with fields=endpoint.fields %}
111
+ {% endif %}
70
112
{% elif not endpoint.errors %}
71
113
< p > No fields.</ p >
72
114
{% endif %}
@@ -99,3 +141,4 @@ <h4 class="modal-title">Live API Endpoints <span class="label label-info">Beta</
99
141
</ div >
100
142
101
143
{% endblock %}
144
+ </ html >
You can’t perform that action at this time.
0 commit comments