Skip to content

Commit

Permalink
the login form shows errors now
Browse files Browse the repository at this point in the history
  • Loading branch information
ramseyg committed Oct 31, 2013
1 parent b73b4b9 commit fcc5439
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 11 deletions.
13 changes: 13 additions & 0 deletions main/c2g/static/css/_forms.scss
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,19 @@ form{
}
}

form.form_login{
fieldset{
border-bottom-left-radius: 0px;
border-bottom-right-radius: 0px;
border-bottom: 0px;
}
input[type="submit"]{
border-top-right-radius: 0px;
border-top-left-radius: 0px;
}

}

a.button, input.button{
box-shadow: none;
-webkit-transition: none;
Expand Down
19 changes: 9 additions & 10 deletions main/templates/registration/login.html
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,7 @@
{% block m_column_content %}


{% if login_form.errors %}
<div class="cross-bar-alert">
<h1>
{% trans "Uh-oh. We couldn't find username and password you entered." %}
</h1>
</div>
{% endif %}


{% if user.is_authenticated %}

Expand All @@ -25,13 +19,18 @@ <h1>
<div class="form-info">
<h2>{% trans 'Sign in to ' %} {{ SITE_TITLE }}</h2>
<h6>Welcome back! Enter your username and password to get started.</h6>
{% if form.errors %}
<div class="alert-box secondary">
{% trans "Uh-oh. We couldn't find username and password you entered." %}
</div>
{% endif %}
</div>
<div class="form-body">
<form action="{% url 'default_login' %}?next={{ next }}" method="post" class="custom">
<form action="{% url 'default_login' %}?next={{ next }}" method="post" class="custom form_login">
{% csrf_token %}
<fieldset>
<div class="control-group">
<label for="id_username" class="control-label">{{ form.username.label_tag }}</label>
<label for="id_username" class="control-label onload-focus">{{ form.username.label_tag }}</label>
<div class="controls">
{{ form.username }}
</div>
Expand All @@ -45,7 +44,7 @@ <h6>Welcome back! Enter your username and password to get started.</h6>
</fieldset>
<div class="form-actions">
<input type="submit" value="{% trans 'Sign In' %}" id="submit"/>
<a id="alternative" href="{% url 'auth_login' %}?next=/{{request.GET.pre}}/{{request.GET.post}}">
<a id="alternative" href="{% url 'registration_register' %}?next=/{{request.GET.pre}}/{{request.GET.post}}">
{% trans 'Need to register for an account?' %}
</a>
<a id="alternative" href="{% url 'auth_password_reset' %}">
Expand Down
2 changes: 1 addition & 1 deletion main/templates/registration/registration_form.html
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ <h6 class="subheader">SOLUTION</h6>
<div class="modal-form">
<div class="form-info">
{% if form.errors %}
<div class="alert-box alert">
<div class="alert-box alert secondary">
{% trans 'Please correct the errors below.' %}
</div>
{% endif %}
Expand Down

0 comments on commit fcc5439

Please sign in to comment.