aboutsummaryrefslogtreecommitdiffstats
path: root/rest_framework/templates
diff options
context:
space:
mode:
authorCezar Pendarovski2014-09-05 09:38:54 +0200
committerCezar Pendarovski2014-09-05 09:38:54 +0200
commit6106701c063ea2efab7dbe82bbdfc02f9eb40421 (patch)
treedb51d1797c0e817246f97f587e101c066a844fa7 /rest_framework/templates
parent3bc858c30b04a1c042d1b0d5196994a2e1e3fe64 (diff)
downloaddjango-rest-framework-6106701c063ea2efab7dbe82bbdfc02f9eb40421.tar.bz2
Input fields get hightlighted if login fails and username is persisted
Diffstat (limited to 'rest_framework/templates')
-rw-r--r--rest_framework/templates/rest_framework/login_base.html23
1 files changed, 15 insertions, 8 deletions
diff --git a/rest_framework/templates/rest_framework/login_base.html b/rest_framework/templates/rest_framework/login_base.html
index 49dad3ae..7569c77a 100644
--- a/rest_framework/templates/rest_framework/login_base.html
+++ b/rest_framework/templates/rest_framework/login_base.html
@@ -17,25 +17,32 @@
<div class="row-fluid">
<div>
- <form action="{% url 'rest_framework:login' %}" class=" form-inline" method="post">
+ <form action="{% url 'rest_framework:login' %}" role="form" method="post">
{% csrf_token %}
- <div id="div_id_username" class="clearfix control-group">
+ <div id="div_id_username"
+ class="clearfix control-group {% if form.username.errors %}warning{% endif %}">
<div class="controls">
<Label class="span4">Username:</label>
- <input style="height: 25px" type="text" name="username" maxlength="100" autocapitalize="off" autocorrect="off" class="textinput textInput" id="id_username" required>
+ <input style="height: 25px" type="text" name="username" maxlength="100"
+ autocapitalize="off" autocorrect="off" class="textinput textInput"
+ id="id_username"
+ {% if form.username.value %}value="{{ form.username.value }}"{% endif %}>
{% if form.username.errors %}
- <p class="alert" style="margin-top: 10px">
+ <p class="text-warning" style="margin-top: 10px">
{{ form.username.errors|striptags }}
</p>
{% endif %}
</div>
</div>
- <div id="div_id_password" class="clearfix control-group">
+ <div id="div_id_password"
+ class="clearfix control-group {% if form.password.errors %}warning{% endif %}">
<div class="controls">
<Label class="span4">Password:</label>
- <input style="height: 25px" type="password" name="password" maxlength="100" autocapitalize="off" autocorrect="off" class="textinput textInput" id="id_password" required>
+ <input style="height: 25px" type="password" name="password" maxlength="100"
+ autocapitalize="off" autocorrect="off" class="textinput textInput"
+ id="id_password">
{% if form.password.errors %}
- <p class="alert" style="margin-top: 10px">
+ <p class="text-warning" style="margin-top: 10px">
{{ form.password.errors|striptags }}
</p>
{% endif %}
@@ -44,7 +51,7 @@
<input type="hidden" name="next" value="{{ next }}" />
{% if form.non_field_errors %}
{% for error in form.non_field_errors %}
- <div class="alert" style="margin-top: 10px">{{ error }}</div>
+ <div class="text-warning" style="margin: 10px 0">{{ error }}</div>
{% endfor %}
{% endif %}
<div class="form-actions-no-box">