Skip to content

Commit 3b37a1d

Browse files
author
Emmanouil Konstantinidis
committed
Style Headers
1 parent ace28b5 commit 3b37a1d

File tree

4 files changed

+15
-8
lines changed

4 files changed

+15
-8
lines changed

rest_framework_docs/static/rest_framework_docs/css/style.css

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

rest_framework_docs/static/rest_framework_docs/js/index.js

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff 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
});

rest_framework_docs/static/rest_framework_docs/less/style.less

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff 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

rest_framework_docs/templates/rest_framework_docs/home.html

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff 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>

0 commit comments

Comments
 (0)