mirror of
https://github.com/haiwen/seahub.git
synced 2025-09-18 00:00:00 +00:00
48 lines
1.6 KiB
HTML
48 lines
1.6 KiB
HTML
{% extends "myhome_base.html" %}
|
|
{% block title %}注册{% endblock %}
|
|
{% block main_panel %}
|
|
<div class="narrow-panel">
|
|
{% if request.user.is_authenticated %}
|
|
<h2>欢迎回来,您已登录。</h2>
|
|
{% else %}
|
|
<h2>注册</h2>
|
|
<form action="" method="post">
|
|
<label for="id_email">邮箱:</label>
|
|
{{ form.email }}
|
|
<label for="id_password1">密码:</label>
|
|
{{ form.password1 }}
|
|
<label for="id_password2">确认密码:</label>
|
|
{{ form.password2 }}
|
|
<p class="error hide"></p>
|
|
{{ form.email.errors }}
|
|
{{ form.password1.errors }}
|
|
{{ form.password2.errors }}
|
|
<input type="submit" value="提交" class="submit" />
|
|
</form>
|
|
{% endif %}
|
|
</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('请输入邮箱。');
|
|
return false;
|
|
}
|
|
if (!$.trim($('input[name="password1"]').attr('value'))) {
|
|
$('.error').removeClass('hide').html('请输入密码。');
|
|
return false;
|
|
}
|
|
if (!$.trim($('input[name="password2"]').attr('value'))) {
|
|
$('.error').removeClass('hide').html('请确认密码。');
|
|
return false;
|
|
}
|
|
if ($.trim($('input[name="password1"]').attr('value')) != $.trim($('input[name="password2"]').attr('value'))) {
|
|
$('.error').removeClass('hide').html('两次输入的密码不一致。');
|
|
return false;
|
|
}
|
|
});
|
|
</script>
|
|
{% endblock %}
|