Skip to content
Open
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
71 changes: 36 additions & 35 deletions userprofile/templates/userprofile/account/login.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,46 +6,47 @@

{% block extrajs %}
<script type="text/javascript">
$(function() {
$("input[type='text'], input[type='password']").addClass("text");
$("#id_username").focus();
});
$(function() {
$("input[type='text'], input[type='password']").addClass("text");
$("#id_username").focus();
});
</script>
{% endblock %}

{% block userprofile_content %}
<form action="{% if next %}?next={{ next }}{% endif %}" method="post" accept-charset="utf-8">
<fieldset>
<legend>{% trans "User login" %}</legend>
<label for="id_username">{% trans "Username" %}</label>
<p>{{ form.username }}
{% if form.username.errors %}
<span class="quiet red">{{ form.username.html_error_list }}</span>
{% endif %}
</p>
<label for="id_password">{% trans "Password" %}</label>
<p>{{ form.password }}
{% if form.password.errors %}
<span class="quiet red">{{ form.password.html_error_list }}</span>
{% endif %}
</p>
{% if form.non_field_errors %}
<ul class="quiet red">{{ form.non_field_errors.as_ul }}</ul>
{% endif %}
</fieldset>
<p><input type="submit" value="{% trans 'Login' %}" /></p>
</form>
<form action="{% if next %}?next={{ next }}{% endif %}" method="post" accept-charset="utf-8">
{% csrf_token %}
<fieldset>
<legend>{% trans "User login" %}</legend>
<label for="id_username">{% trans "Username" %}</label>
<p>{{ form.username }}
{% if form.username.errors %}
<span class="quiet red">{{ form.username.html_error_list }}</span>
{% endif %}
</p>
<label for="id_password">{% trans "Password" %}</label>
<p>{{ form.password }}
{% if form.password.errors %}
<span class="quiet red">{{ form.password.html_error_list }}</span>
{% endif %}
</p>
{% if form.non_field_errors %}
<ul class="quiet red">{{ form.non_field_errors.as_ul }}</ul>
{% endif %}
</fieldset>
<p><input type="submit" value="{% trans 'Login' %}" /></p>
</form>
{% endblock %}

{% block userprofile_content_related %}
<div class="box">
<h3>{% trans "Utilities" %}:</h3>
{# http://code.djangoproject.com/ticket/7239 #}
<a href="{% url password_reset %}">{% trans "Lost your password?" %}</a>
<br />
<a href="{% url email_validation_reset %}">{% trans "Resend validation e-mail" %}</a>
<br />
<a href="{% url signup %}">{% trans "Sign up!" %}</a>
<br />
</div>
<div class="box">
<h3>{% trans "Utilities" %}:</h3>
{# http://code.djangoproject.com/ticket/7239 #}
<a href="{% url password_reset %}">{% trans "Lost your password?" %}</a>
<br />
<a href="{% url email_validation_reset %}">{% trans "Resend validation e-mail" %}</a>
<br />
<a href="{% url signup %}">{% trans "Sign up!" %}</a>
<br />
</div>
{% endblock %}
11 changes: 6 additions & 5 deletions userprofile/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@
from django.http import HttpResponseRedirect, HttpResponse
from django.shortcuts import render_to_response, get_object_or_404
from django.utils.translation import ugettext as _
from userprofile.forms import AvatarForm, AvatarCropForm, EmailValidationForm, \
ProfileForm, RegistrationForm, LocationForm, \
ResendEmailValidationForm, PublicFieldsForm
from userprofile.forms import (AvatarForm, AvatarCropForm, EmailValidationForm,
ProfileForm, RegistrationForm, LocationForm,
ResendEmailValidationForm, PublicFieldsForm)
from userprofile.models import BaseProfile
from django.http import Http404
from django.core.exceptions import ObjectDoesNotExist
Expand All @@ -14,8 +14,9 @@
from django.utils import simplejson
from django.db import models
from django.contrib.auth.models import User, SiteProfileNotAvailable
from userprofile.models import EmailValidation, Avatar, UserProfileMediaNotFound, \
GoogleDataAPINotFound, S3BackendNotFound
from userprofile.models import (EmailValidation, Avatar,
UserProfileMediaNotFound, GoogleDataAPINotFound,
S3BackendNotFound)
from django.template import RequestContext
from cStringIO import StringIO
from django.core.files.base import ContentFile
Expand Down