mirror of
https://github.com/haiwen/seahub.git
synced 2025-08-16 06:03:35 +00:00
44 lines
1.7 KiB
HTML
44 lines
1.7 KiB
HTML
{% extends base_template %}
|
|
{% load i18n %}
|
|
{% block title %}{% trans "Add User" %}{% endblock %}
|
|
{% block nav_useradmin_class %}class="cur"{% endblock %}
|
|
{% block main_panel %}
|
|
<div class="narrow-panel">
|
|
<h3>{% trans "Add User" %}</h3>
|
|
<form action="" method="post">
|
|
<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 }}
|
|
<p class="error hide" id="error"></p>
|
|
|
|
<input type="submit" value="{% trans "Submit" %}" class="submit" />
|
|
</form>
|
|
</div>
|
|
{% endblock %}
|
|
|
|
{% block extra_script %}
|
|
<script type="text/javascript">
|
|
$('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;
|
|
}
|
|
});
|
|
</script>
|
|
{% endblock %}
|