Skip to content

Commit 7099a57

Browse files
committed
Ported a couple of templates to Bootstrap 3.x.
1 parent 7055fd8 commit 7099a57

File tree

2 files changed

+15
-16
lines changed

2 files changed

+15
-16
lines changed

rest_framework/templates/rest_framework/login_base.html

Lines changed: 11 additions & 12 deletions
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

Lines changed: 4 additions & 4 deletions
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>

0 commit comments

Comments
 (0)