1
0
mirror of https://github.com/haiwen/seahub.git synced 2025-08-16 14:08:12 +00:00
seahub/templates/add_user_form.html

44 lines
1.7 KiB
HTML
Raw Normal View History

2012-06-20 11:39:21 +00:00
{% extends base_template %}
2012-11-01 07:09:14 +00:00
{% load i18n %}
{% block title %}{% trans "Add User" %}{% endblock %}
2012-03-22 12:33:27 +00:00
{% block nav_useradmin_class %}class="cur"{% endblock %}
{% block main_panel %}
<div class="narrow-panel">
2012-11-01 07:09:14 +00:00
<h3>{% trans "Add User" %}</h3>
<form action="" method="post">
2012-11-01 07:09:14 +00: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 11:39:21 +00:00
<p class="error hide" id="error"></p>
2012-11-01 07:09:14 +00:00
<input type="submit" value="{% trans "Submit" %}" class="submit" />
</form>
</div>
{% endblock %}
{% block extra_script %}
<script type="text/javascript">
2012-11-01 07:09:14 +00: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;
}
});
</script>
{% endblock %}