File tree Expand file tree Collapse file tree 4 files changed +15
-8
lines changed
static/rest_framework_docs
templates/rest_framework_docs Expand file tree Collapse file tree 4 files changed +15
-8
lines changed Original file line number Diff line number Diff line change @@ -23,7 +23,7 @@ var jsonPP = {
2323$ ( document ) . ready ( function ( ) {
2424
2525 var setResponse = function ( method , response ) {
26- if ( method == 'OPTIONS' ) {
26+ if ( ! response . status ) {
2727 return $ ( '#responseData' ) . html ( jsonPP . prettyPrint ( response ) ) ;
2828 }
2929
@@ -95,10 +95,11 @@ $( document ).ready(function() {
9595
9696 var _setupFields = function ( fields ) {
9797 $ . each ( fields , function ( i , field ) {
98+ var label = field . name . replace ( '_' , ' ' ) ;
9899 $ ( '#fields' ) . append ( "" +
99100 '<div class="form-group">' +
100- '<label for="field' + field . name + '">' + field . name + '</label>' +
101- '<input type="text" class="form-control" id="field' + field . name + '" placeholder="' + field . type + '">' +
101+ '<label for="field' + field . name + '">' + label + '</label>' +
102+ '<input type="text" class="form-control input-sm " id="field' + field . name + '" placeholder="' + field . type + '">' +
102103 '</div>' +
103104 "" ) ;
104105 } ) ;
Original file line number Diff line number Diff line change @@ -172,6 +172,12 @@ body {
172172
173173 .request {
174174
175+ .section-title {
176+ background-color : @gray-lighter ;
177+ text-align : center ;
178+ padding : 5px ;
179+ .BorderRadius (3px );
180+ }
175181
176182 .methods {
177183
Original file line number Diff line number Diff line change @@ -102,18 +102,18 @@ <h3>Request</h3>
102102 < form id ="requestForm ">
103103 < div class ="form-group ">
104104 < label for ="urlInput "> Endpoint</ label >
105- < input type ="text " class ="form-control " id ="urlInput " placeholder ="Url ">
105+ < input type ="text " class ="form-control input-sm " id ="urlInput " placeholder ="Url ">
106106 </ div >
107107
108108 < div class ="btn-group methods " id ="methods " role ="group "> </ div >
109109
110- < h5 > Headers</ h5 >
110+ < h5 class =" section-title " > < span > Headers</ span > </ h5 >
111111 < div class ="form-group ">
112112 < label for ="exampleInputPassword1 "> Authorization</ label >
113- < input type ="text " class ="form-control " id ="exampleInputPassword1 " placeholder ="Token ">
113+ < input type ="text " class ="form-control input-sm " id ="exampleInputPassword1 " placeholder ="Token ">
114114 </ div >
115115
116- < h5 > Data</ h5 >
116+ < h5 class =" section-title " > < span > Data</ span > </ h5 >
117117 < div id ="fields " class ="fields "> </ div >
118118
119119 < button type ="submit " class ="btn btn-default "> Send</ button >
You can’t perform that action at this time.
0 commit comments