Ported a couple of templates to Bootstrap 3.x.

This commit is contained in:
Loic Bistuer 2014-12-03 17:30:07 +07:00
parent ff02a0af9c
commit b90f4228b2
2 changed files with 15 additions and 16 deletions

View File

@ -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 @@
</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 @@
<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>

View File

@ -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:"col-sm-2 control-label" }}
<div class="controls"> <div class="col-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>