Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
D
django-rest-framework
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
edx
django-rest-framework
Commits
b440bd74
Commit
b440bd74
authored
Dec 08, 2014
by
Tom Christie
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #2187 from loic/cosmetic_fixes
Cosmetic fixes in the API browser HTML.
parents
9879a5dc
0c0d65d2
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
18 additions
and
18 deletions
+18
-18
rest_framework/static/rest_framework/js/default.js
+2
-1
rest_framework/templates/rest_framework/login_base.html
+11
-12
rest_framework/templates/rest_framework/raw_data_form.html
+4
-4
tests/test_authentication.py
+1
-1
No files found.
rest_framework/static/rest_framework/js/default.js
View file @
b440bd74
...
@@ -24,7 +24,8 @@ prettyPrint();
...
@@ -24,7 +24,8 @@ prettyPrint();
// Bootstrap tooltips.
// Bootstrap tooltips.
$
(
'.js-tooltip'
).
tooltip
({
$
(
'.js-tooltip'
).
tooltip
({
delay
:
1000
delay
:
1000
,
container
:
'body'
});
});
// Deal with rounded tab styling after tab clicks.
// Deal with rounded tab styling after tab clicks.
...
...
rest_framework/templates/rest_framework/login_base.html
View file @
b440bd74
...
@@ -21,11 +21,11 @@
...
@@ -21,11 +21,11 @@
{% csrf_token %}
{% csrf_token %}
<div
id=
"div_id_username"
<div
id=
"div_id_username"
class=
"clearfix control-group {% if form.username.errors %}error{% endif %}"
>
class=
"clearfix control-group {% if form.username.errors %}error{% endif %}"
>
<div
class=
"
controls
"
>
<div
class=
"
form-group
"
>
<label
class=
"span4
"
>
Username:
</label>
<label
for=
"id_username
"
>
Username:
</label>
<input
style=
"height: 25px"
type=
"text"
name=
"username"
maxlength=
"100"
<input
type=
"text"
name=
"username"
maxlength=
"100"
autocapitalize=
"off"
autocapitalize=
"off"
autocorrect=
"off"
class=
"
span12
textinput textInput"
autocorrect=
"off"
class=
"
form-control
textinput textInput"
id=
"id_username"
required
id=
"id_username"
required
{%
if
form
.
username
.
value
%}
value=
"{{ form.username.value }}"
{%
endif
%}
>
{%
if
form
.
username
.
value
%}
value=
"{{ form.username.value }}"
{%
endif
%}
>
{% if form.username.errors %}
{% if form.username.errors %}
...
@@ -36,12 +36,11 @@
...
@@ -36,12 +36,11 @@
</div>
</div>
</div>
</div>
<div
id=
"div_id_password"
<div
id=
"div_id_password"
class=
"clearfix control-group {% if form.password.errors %}error{% endif %}"
class=
"clearfix control-group {% if form.password.errors %}error{% endif %}"
>
style=
"margin-top: 10px"
>
<div
class=
"form-group"
>
<div
class=
"controls"
>
<label
for=
"id_password"
>
Password:
</label>
<label
class=
"span4"
>
Password:
</label>
<input
type=
"password"
name=
"password"
maxlength=
"100"
<input
style=
"height: 25px"
type=
"password"
name=
"password"
maxlength=
"100"
autocapitalize=
"off"
autocorrect=
"off"
class=
"form-control textinput textInput"
autocapitalize=
"off"
autocorrect=
"off"
class=
"span12 textinput textInput"
id=
"id_password"
required
>
id=
"id_password"
required
>
{% if form.password.errors %}
{% if form.password.errors %}
<p
class=
"text-error"
>
<p
class=
"text-error"
>
...
@@ -56,8 +55,8 @@
...
@@ -56,8 +55,8 @@
<div
class=
"well well-small text-error"
style=
"border: none"
>
{{ error }}
</div>
<div
class=
"well well-small text-error"
style=
"border: none"
>
{{ error }}
</div>
{% endfor %}
{% endfor %}
{% endif %}
{% endif %}
<div
class=
"form-actions-no-box"
style=
"margin-top: 20px"
>
<div
class=
"form-actions-no-box"
>
<input
type=
"submit"
name=
"submit"
value=
"Log in"
class=
"btn btn-primary"
id=
"submit-id-submit"
>
<input
type=
"submit"
name=
"submit"
value=
"Log in"
class=
"btn btn-primary
form-control
"
id=
"submit-id-submit"
>
</div>
</div>
</form>
</form>
</div>
</div>
...
...
rest_framework/templates/rest_framework/raw_data_form.html
View file @
b440bd74
...
@@ -2,10 +2,10 @@
...
@@ -2,10 +2,10 @@
{% csrf_token %}
{% csrf_token %}
{{ form.non_field_errors }}
{{ form.non_field_errors }}
{% for field in form %}
{% for field in form %}
<div
class=
"
control
-group"
>
<div
class=
"
form
-group"
>
{{ field.label_tag|add_class:"control-label" }}
{{ field.label_tag|add_class:"co
l-sm-2 co
ntrol-label" }}
<div
class=
"co
ntrols
"
>
<div
class=
"co
l-sm-10
"
>
{{ field }}
{{ field
|add_class:"form-control"
}}
<span
class=
"help-block"
>
{{ field.help_text }}
</span>
<span
class=
"help-block"
>
{{ field.help_text }}
</span>
</div>
</div>
</div>
</div>
...
...
tests/test_authentication.py
View file @
b440bd74
...
@@ -142,7 +142,7 @@ class SessionAuthTests(TestCase):
...
@@ -142,7 +142,7 @@ class SessionAuthTests(TestCase):
cf. [#1810](https://github.com/tomchristie/django-rest-framework/pull/1810)
cf. [#1810](https://github.com/tomchristie/django-rest-framework/pull/1810)
"""
"""
response
=
self
.
csrf_client
.
get
(
'/auth/login/'
)
response
=
self
.
csrf_client
.
get
(
'/auth/login/'
)
self
.
assertContains
(
response
,
'<label
class="span4
">Username:</label>'
)
self
.
assertContains
(
response
,
'<label
for="id_username
">Username:</label>'
)
def
test_post_form_session_auth_failing_csrf
(
self
):
def
test_post_form_session_auth_failing_csrf
(
self
):
"""
"""
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment