2012-02-24 15:38:04 +08:00
|
|
|
{% extends "myhome_base.html" %}
|
2012-10-26 19:15:52 +08:00
|
|
|
{% load i18n %}
|
|
|
|
{% block title %}{% trans "Register" %}{% endblock %}
|
2011-11-27 17:52:14 +08:00
|
|
|
{% block main_panel %}
|
2012-05-22 16:21:16 +08:00
|
|
|
<div class="narrow-panel">
|
2012-06-04 21:27:32 +08:00
|
|
|
{% if request.user.is_authenticated %}
|
2012-10-26 19:15:52 +08:00
|
|
|
<h2>{% trans "Welcome back, you are already signed in." %}</h2>
|
2012-06-04 21:27:32 +08:00
|
|
|
{% else %}
|
2012-10-27 21:12:28 +08:00
|
|
|
<h2>{% trans "Signup" %}</h2>
|
2012-05-22 16:21:16 +08:00
|
|
|
<form action="" method="post">
|
2012-10-26 19:15:52 +08:00
|
|
|
<label for="id_email">{% trans "Email" %}</label>
|
|
|
|
{{ form.email }} {{ form.email.errors }}
|
|
|
|
<label for="id_password1">{% trans "Password" %}</label>
|
|
|
|
{{ form.password1 }} {{ form.password1.errors }}
|
|
|
|
<label for="id_password2">{% trans "Confirm Password" %}</label>
|
|
|
|
{{ form.password2 }} {{ form.password2.errors }}
|
2012-05-22 16:21:16 +08:00
|
|
|
<p class="error hide"></p>
|
2012-10-26 19:15:52 +08:00
|
|
|
<input type="submit" value="{% trans "Submit" %}" class="submit" />
|
2012-05-18 21:50:48 +08:00
|
|
|
</form>
|
2012-06-04 21:27:32 +08:00
|
|
|
{% endif %}
|
2012-05-18 21:50:48 +08:00
|
|
|
</div>
|
2011-04-30 13:18:32 +08:00
|
|
|
{% endblock %}
|
2012-05-22 16:21:16 +08:00
|
|
|
|
|
|
|
{% block extra_script %}
|
|
|
|
<script type="text/javascript">
|
|
|
|
$('input[type="submit"]').click(function(){
|
|
|
|
if (!$.trim($('input[name="email"]').attr('value'))) {
|
2012-10-31 16:14:55 +08:00
|
|
|
$('.error').removeClass('hide').html('{% trans "Email cannot be blank" %}');
|
2012-05-22 16:21:16 +08:00
|
|
|
return false;
|
|
|
|
}
|
|
|
|
if (!$.trim($('input[name="password1"]').attr('value'))) {
|
2012-10-31 16:14:55 +08:00
|
|
|
$('.error').removeClass('hide').html('{% trans "Password cannot be blank" %}');
|
2012-05-22 16:21:16 +08:00
|
|
|
return false;
|
|
|
|
}
|
|
|
|
if (!$.trim($('input[name="password2"]').attr('value'))) {
|
2012-10-31 16:14:55 +08:00
|
|
|
$('.error').removeClass('hide').html('{% trans "Confirm password cannot be blank" %}');
|
2012-05-22 16:21:16 +08:00
|
|
|
return false;
|
|
|
|
}
|
|
|
|
if ($.trim($('input[name="password1"]').attr('value')) != $.trim($('input[name="password2"]').attr('value'))) {
|
2012-10-31 16:14:55 +08:00
|
|
|
$('.error').removeClass('hide').html('{% trans "The two password fields not match" %}');
|
2012-05-22 16:21:16 +08:00
|
|
|
return false;
|
|
|
|
}
|
|
|
|
});
|
|
|
|
</script>
|
|
|
|
{% endblock %}
|