Skip to content

Cosmetic fixes in the API browser HTML. #2187

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Dec 8, 2014
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion rest_framework/static/rest_framework/js/default.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,8 @@ prettyPrint();

// Bootstrap tooltips.
$('.js-tooltip').tooltip({
delay: 1000
delay: 1000,
container: 'body'
});

// Deal with rounded tab styling after tab clicks.
Expand Down
23 changes: 11 additions & 12 deletions rest_framework/templates/rest_framework/login_base.html
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,11 @@
{% csrf_token %}
<div id="div_id_username"
class="clearfix control-group {% if form.username.errors %}error{% endif %}">
<div class="controls">
<label class="span4">Username:</label>
<input style="height: 25px" type="text" name="username" maxlength="100"
<div class="form-group">
<label for="id_username">Username:</label>
<input type="text" name="username" maxlength="100"
autocapitalize="off"
autocorrect="off" class="span12 textinput textInput"
autocorrect="off" class="form-control textinput textInput"
id="id_username" required
{% if form.username.value %}value="{{ form.username.value }}"{% endif %}>
{% if form.username.errors %}
Expand All @@ -36,12 +36,11 @@
</div>
</div>
<div id="div_id_password"
class="clearfix control-group {% if form.password.errors %}error{% endif %}"
style="margin-top: 10px">
<div class="controls">
<label class="span4">Password:</label>
<input style="height: 25px" type="password" name="password" maxlength="100"
autocapitalize="off" autocorrect="off" class="span12 textinput textInput"
class="clearfix control-group {% if form.password.errors %}error{% endif %}">
<div class="form-group">
<label for="id_password">Password:</label>
<input type="password" name="password" maxlength="100"
autocapitalize="off" autocorrect="off" class="form-control textinput textInput"
id="id_password" required>
{% if form.password.errors %}
<p class="text-error">
Expand All @@ -56,8 +55,8 @@
<div class="well well-small text-error" style="border: none">{{ error }}</div>
{% endfor %}
{% endif %}
<div class="form-actions-no-box" style="margin-top: 20px">
<input type="submit" name="submit" value="Log in" class="btn btn-primary" id="submit-id-submit">
<div class="form-actions-no-box">
<input type="submit" name="submit" value="Log in" class="btn btn-primary form-control" id="submit-id-submit">
</div>
</form>
</div>
Expand Down
8 changes: 4 additions & 4 deletions rest_framework/templates/rest_framework/raw_data_form.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@
{% csrf_token %}
{{ form.non_field_errors }}
{% for field in form %}
<div class="control-group">
{{ field.label_tag|add_class:"control-label" }}
<div class="controls">
{{ field }}
<div class="form-group">
{{ field.label_tag|add_class:"col-sm-2 control-label" }}
<div class="col-sm-10">
{{ field|add_class:"form-control" }}
<span class="help-block">{{ field.help_text }}</span>
</div>
</div>
Expand Down
2 changes: 1 addition & 1 deletion tests/test_authentication.py
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ def test_login_view_renders_on_get(self):
cf. [#1810](https://github.com/tomchristie/django-rest-framework/pull/1810)
"""
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):
"""
Expand Down