Skip to content

Commit 1eb116b

Browse files
author
Emmanouil Konstantinidis
committed
Move the Submit button to the footer
1 parent b240a2b commit 1eb116b

File tree

4 files changed

+16
-6
lines changed

4 files changed

+16
-6
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 & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ $( document ).ready(function() {
3636
$('#responseStatusText').text('');
3737
$('#responseData').html('');
3838
$('#saveTokenButton').hide();
39+
$('#responseData').parent().hide();
3940
};
4041

4142
var setResponse = function (response) {
@@ -61,6 +62,8 @@ $( document ).ready(function() {
6162
break;
6263
}
6364

65+
$('#responseData').parent().show();
66+
6467
$('#responseStatusCode').text(response.status);
6568
$('#responseStatusCode').addClass(statusCodeClass);
6669

@@ -158,6 +161,7 @@ $( document ).ready(function() {
158161
var method = $("#methods").find( ".active" ).text();
159162
if (method === 'GET' || method === 'OPTIONS') {
160163
$('#headerData').hide();
164+
$('#headers #authorization').val();
161165
$('#fields').hide();
162166
} else {
163167
$('#headerData').show();

rest_framework_docs/static/rest_framework_docs/less/style.less

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,11 @@ body {
5656
margin-left: 5px;
5757
}
5858

59+
.btn:focus,
60+
.btn:active {
61+
outline: none !important;
62+
}
63+
5964
/* @end Misc */
6065

6166

rest_framework_docs/templates/rest_framework_docs/home.html

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -95,12 +95,13 @@ <h2 class="text-center">No endpoints found for {{ query }}.</h2>
9595
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
9696
<h4 class="modal-title">Live API Endpoints <span class="label label-info">Beta</span></h4>
9797
</div>
98+
99+
<form class="form-horizontal" id="requestForm">
98100
<div class="modal-body">
99101

100102
<div class="row">
101103
<div class="col-md-6 request">
102104
<h3>Request</h3>
103-
<form class="form-horizontal" id="requestForm">
104105
<div class="form-group">
105106
<label for="urlInput" class="col-sm-4 control-label">Endpoint</label>
106107
<div class="col-sm-8">
@@ -123,17 +124,15 @@ <h5 class="section-title"><span>Headers</span></h5>
123124

124125
<h5 class="section-title" id="headerData"><span>Data</span></h5>
125126
<div id="fields" class="fields"></div>
126-
127-
<button type="submit" class="btn btn-default">Send</button>
128-
</form>
129127
</div>
130128

131129
<div class="col-md-6 response">
132130
<h3>Response <span id="responseStatusCode" class="label status-code pull-right"></span></h3>
133131
<div><strong>Status Text</strong>: <span class="status-text" id="responseStatusText"></span></div>
134132
<pre><code id="responseData"></code></pre>
135-
<div id="saveTokenButton">
133+
<div class="well well-default text-center" id="saveTokenButton">
136134
<button class='btn btn-info'><i class='fa fa-key'></i> Save Token</button>
135+
<h5>Your token will be lost when you refresh the page.</h5>
137136
</div>
138137
</div>
139138
</div>
@@ -142,7 +141,9 @@ <h3>Response <span id="responseStatusCode" class="label status-code pull-right">
142141
</div>
143142
<div class="modal-footer">
144143
<button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
144+
<button type="submit" id="submitButton" class="btn btn-primary">Send</button>
145145
</div>
146+
</form>
146147
</div>
147148
</div>
148149
</div>

0 commit comments

Comments
 (0)