Skip to content

Commit b440bd7

Browse files
committed
Merge pull request #2187 from loic/cosmetic_fixes
Cosmetic fixes in the API browser HTML.
2 parents 9879a5d + 0c0d65d commit b440bd7

File tree

4 files changed

+18
-18
lines changed

4 files changed

+18
-18
lines changed

rest_framework/static/rest_framework/js/default.js

+2-1
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,8 @@ prettyPrint();
2424

2525
// Bootstrap tooltips.
2626
$('.js-tooltip').tooltip({
27-
delay: 1000
27+
delay: 1000,
28+
container: 'body'
2829
});
2930

3031
// Deal with rounded tab styling after tab clicks.

rest_framework/templates/rest_framework/login_base.html

+11-12
Original file line numberDiff line numberDiff line change
@@ -21,11 +21,11 @@
2121
{% csrf_token %}
2222
<div id="div_id_username"
2323
class="clearfix control-group {% if form.username.errors %}error{% endif %}">
24-
<div class="controls">
25-
<label class="span4">Username:</label>
26-
<input style="height: 25px" type="text" name="username" maxlength="100"
24+
<div class="form-group">
25+
<label for="id_username">Username:</label>
26+
<input type="text" name="username" maxlength="100"
2727
autocapitalize="off"
28-
autocorrect="off" class="span12 textinput textInput"
28+
autocorrect="off" class="form-control textinput textInput"
2929
id="id_username" required
3030
{% if form.username.value %}value="{{ form.username.value }}"{% endif %}>
3131
{% if form.username.errors %}
@@ -36,12 +36,11 @@
3636
</div>
3737
</div>
3838
<div id="div_id_password"
39-
class="clearfix control-group {% if form.password.errors %}error{% endif %}"
40-
style="margin-top: 10px">
41-
<div class="controls">
42-
<label class="span4">Password:</label>
43-
<input style="height: 25px" type="password" name="password" maxlength="100"
44-
autocapitalize="off" autocorrect="off" class="span12 textinput textInput"
39+
class="clearfix control-group {% if form.password.errors %}error{% endif %}">
40+
<div class="form-group">
41+
<label for="id_password">Password:</label>
42+
<input type="password" name="password" maxlength="100"
43+
autocapitalize="off" autocorrect="off" class="form-control textinput textInput"
4544
id="id_password" required>
4645
{% if form.password.errors %}
4746
<p class="text-error">
@@ -56,8 +55,8 @@
5655
<div class="well well-small text-error" style="border: none">{{ error }}</div>
5756
{% endfor %}
5857
{% endif %}
59-
<div class="form-actions-no-box" style="margin-top: 20px">
60-
<input type="submit" name="submit" value="Log in" class="btn btn-primary" id="submit-id-submit">
58+
<div class="form-actions-no-box">
59+
<input type="submit" name="submit" value="Log in" class="btn btn-primary form-control" id="submit-id-submit">
6160
</div>
6261
</form>
6362
</div>

rest_framework/templates/rest_framework/raw_data_form.html

+4-4
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,10 @@
22
{% csrf_token %}
33
{{ form.non_field_errors }}
44
{% for field in form %}
5-
<div class="control-group">
6-
{{ field.label_tag|add_class:"control-label" }}
7-
<div class="controls">
8-
{{ field }}
5+
<div class="form-group">
6+
{{ field.label_tag|add_class:"col-sm-2 control-label" }}
7+
<div class="col-sm-10">
8+
{{ field|add_class:"form-control" }}
99
<span class="help-block">{{ field.help_text }}</span>
1010
</div>
1111
</div>

tests/test_authentication.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,7 @@ def test_login_view_renders_on_get(self):
142142
cf. [#1810](https://github.com/tomchristie/django-rest-framework/pull/1810)
143143
"""
144144
response = self.csrf_client.get('/auth/login/')
145-
self.assertContains(response, '<label class="span4">Username:</label>')
145+
self.assertContains(response, '<label for="id_username">Username:</label>')
146146

147147
def test_post_form_session_auth_failing_csrf(self):
148148
"""

0 commit comments

Comments
 (0)