2012-06-20 19:39:21 +08:00
|
|
|
{% extends base_template %}
|
2012-11-01 15:09:14 +08:00
|
|
|
{% load i18n %}
|
|
|
|
{% block title %}{% trans "Add User" %}{% endblock %}
|
2012-03-22 20:33:27 +08:00
|
|
|
{% block nav_useradmin_class %}class="cur"{% endblock %}
|
2012-03-09 10:31:35 +08:00
|
|
|
{% block main_panel %}
|
2012-05-22 16:21:16 +08:00
|
|
|
<div class="narrow-panel">
|
2012-11-01 15:09:14 +08:00
|
|
|
<h3>{% trans "Add User" %}</h3>
|
2012-05-22 16:21:16 +08:00
|
|
|
<form action="" method="post">
|
2012-11-01 15:09:14 +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-06-20 19:39:21 +08:00
|
|
|
<p class="error hide" id="error"></p>
|
2012-05-22 16:21:16 +08:00
|
|
|
|
2012-11-01 15:09:14 +08:00
|
|
|
<input type="submit" value="{% trans "Submit" %}" class="submit" />
|
2012-05-17 20:39:37 +08:00
|
|
|
</form>
|
2012-05-22 16:21:16 +08:00
|
|
|
</div>
|
|
|
|
{% endblock %}
|
|
|
|
|
|
|
|
{% block extra_script %}
|
|
|
|
<script type="text/javascript">
|
2012-11-01 15:09:14 +08:00
|
|
|
$('input[type="submit"]').click(function(){
|
|
|
|
if (!$.trim($('input[name="email"]').attr('value'))) {
|
|
|
|
$('.error').removeClass('hide').html('{% trans "Email cannot be blank" %}');
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
if (!$.trim($('input[name="password1"]').attr('value'))) {
|
|
|
|
$('.error').removeClass('hide').html('{% trans "Password cannot be blank" %}');
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
if (!$.trim($('input[name="password2"]').attr('value'))) {
|
|
|
|
$('.error').removeClass('hide').html('{% trans "Confirm password cannot be blank" %}');
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
if ($.trim($('input[name="password1"]').attr('value')) != $.trim($('input[name="password2"]').attr('value'))) {
|
|
|
|
$('.error').removeClass('hide').html('{% trans "The two password fields not match" %}');
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
});
|
2012-05-22 16:21:16 +08:00
|
|
|
</script>
|
2012-03-09 10:31:35 +08:00
|
|
|
{% endblock %}
|