1
0
mirror of https://github.com/haiwen/seahub.git synced 2025-09-19 01:44:13 +00:00

Add authentication and registration to seahub

This commit is contained in:
plt
2011-04-30 13:18:32 +08:00
parent 8b357aedae
commit e8d2300473
128 changed files with 4893 additions and 6 deletions

3
templates/accounts.html Normal file
View File

@@ -0,0 +1,3 @@
{% extends "myhome_base.html" %}
{% block title %}帐号设置{% endblock %}

View File

@@ -0,0 +1,3 @@
{% extends "accounts.html" %}
{% block title %}个人头像{% endblock %}

View File

@@ -0,0 +1,31 @@
{% extends "avatar/base.html" %}
{% load avatar_tags %}
{% block content %}
<div class="avatar_op">
<h2>添加或修改头像</h2>
<div class="pic">
<h3>当前头像:</h3>
{% avatar user %}
</div>
<div class="text">
{% if not avatars %}
<p>您还没有自己的头像。</p>
{% else %}
<h3>从已有头像中选择:</h3>
<form method="POST" action="">
<ul>
{{ primary_avatar_form.as_ul }}
</ul>
<div class="clear"></div>
<input type="submit" value="确定" />
</form>
{% endif %}
<h3>上传新头像:</h3>
<form enctype="multipart/form-data" method="POST" action="">
<input type="file" name="avatar" value="Avatar Image" /><br />
<input type="submit" value="提交" />
</form>
</div>
</div>
{% endblock %}

View File

@@ -0,0 +1,18 @@
{% extends "avatar/base.html" %}
{% block content %}
<div class="avatar_op">
<h2>删除头像</h2>
{% if not avatars %}
<p>您还没有上传自己的头像。现在 <a href="{% url avatar_change %}">上传一个</a>.</p>
{% else %}
<form method="POST" action="">
<ul>
{{ delete_avatar_form.as_ul }}
</ul>
<div class="clear"></div>
<input type="submit" value="删除" />
</form>
{% endif %}
</div>
{% endblock %}

View File

@@ -15,8 +15,24 @@
<div id="wrapper">
<div id="header">
<div class="top_operation">
{% if request.user.is_authenticated %}
欢迎, {{ request.user }}.
<a href="{{ SITE_ROOT }}home/my/">我的页面</a>
<a href="{{ SITE_ROOT }}home/">社区</a>
<a href="{{ SITE_ROOT }}profile/">设置</a>
{% if request.user.is_staff %}
<a href="{{ SITE_ROOT }}admin/">管理</a>
{% endif %}
<a href="{{ SITE_ROOT }}accounts/logout/">退出</a>
{% else %}
<a href="{{ SITE_ROOT }}accounts/login/">登录</a>
<a href="{{ SITE_ROOT }}accounts/register/">注册</a>
{% endif %}
</div>
<img id="logo" src="{{ MEDIA_URL }}img/logo.png" title="Seafile" />
<div class="navs">
{% block nav %}
<ul class="nav">
<li>
<a href="{{ SITE_ROOT }}home/">Home</a>
@@ -28,6 +44,7 @@
<a href="{{ SITE_ROOT }}groups/">Groups</a>
</li>
</ul>
{% endblock %}
</div>
<div class="nav-separator"></div>
</div>
@@ -39,6 +56,7 @@
{% block right_panel %}{% endblock %}
</div>
<div id="main-panel">
{% block content %}{% endblock %}
</div>
<div class="clear"></div>

1
templates/myhome.html Normal file
View File

@@ -0,0 +1 @@
{% extends "myhome_base.html" %}

View File

@@ -0,0 +1,17 @@
{% extends "base.html" %}
{% block nav %}
<ul class="nav">
<li>
<a href="{{ SITE_ROOT }}home/my/">Home</a>
</li>
<li>
<a href="{{ SITE_ROOT }}files/">Files</a>
</li>
<li>
<a href="{{ SITE_ROOT }}peers/">Peers</a>
</li>
<li>
<a href="{{ SITE_ROOT }}groups/">Groups</a>
</li>
</ul>
{% endblock %}

View File

@@ -0,0 +1,8 @@
{% extends "base.html" %}
{% block title %}Create an account{% endblock %}
{% block content %}
你的帐号已经激活。 <a href="{{ SITE_ROOT }}accounts/login/">登录</a>
{% endblock %}

View File

@@ -0,0 +1,4 @@
您好, 感谢注册 {{ site.name }}。
请点击下面的链接激活您的帐号
http://{{ site.name }}{{ SITE_ROOT }}accounts/activate/{{ activation_key }}/

View File

@@ -0,0 +1 @@
请激活你的帐号,完成注册

View File

@@ -0,0 +1,30 @@
{% extends "base.html" %}
{% block title %}用户登录{% endblock %}
{% block content %}
<h2>用户登录</h2>
<form action="" method="post" class="login">
<label for="username">帐 号:</label>
<input type="text" name="username" value="" id="username"><br />
<label for="password">密 码:</label>
<input type="password" name="password" value="" id="password"><br />
{% if form.errors %}
<p class="error">抱歉,您输入的用户名或密码不正确</p>
{% endif %}
<input type="submit" value="提交" class="lo-reg" />
<a href="{{ SITE_ROOT }}accounts/password/reset/">忘记密码?</a>
{% if next %}
<input type="hidden" name="next" value="{{ next|escape }}" />
{% else %}
<input type="hidden" name="next" value="{{ SITE_ROOT }}" />
{% endif %}
</form>
<script type="text/javascript">
document.getElementById('username').value = '用户名或注册邮箱';
document.getElementById('username').style.color = '#666';
document.getElementById('username').onclick = function() {
document.getElementById('username').value = '';
document.getElementById('username').style.color = '#000';
}
</script>
{% endblock %}

View File

@@ -0,0 +1,11 @@
{% extends "base.html" %}
{% block title %}退出{% endblock %}
{% block content %}
<p>感谢参与.</p>
<p><a href="{{ SITE_ROOT }}accounts/login/" class="re_login">重新登录</a></p>
{% endblock %}

View File

@@ -0,0 +1,14 @@
{% extends "accounts.html" %}
{% load i18n %}<!--
{% block userlinks %}{% url django-admindocs-docroot as docsroot %}{% if docsroot %}<a href="{{ docsroot }}">{% trans 'Documentation' %}</a> / {% endif %}{% trans 'Change password' %} / <a href="../../logout/">{% trans 'Log out' %}</a>{% endblock %}
{% block breadcrumbs %}<div class="breadcrumbs"><a href="../../">{% trans 'Home' %}</a> &rsaquo; {% trans 'Password change' %}</div>{% endblock %}-->
{% block title %}{% trans 'Password change successful' %}{% endblock %}
{% block content %}
<h2>{% trans 'Password change successful' %}</h2>
<p>{% trans 'Your password was changed.' %}</p>
{% endblock %}

View File

@@ -0,0 +1,17 @@
{% extends "accounts.html" %}
{% load i18n %}
{% block title %}{% trans 'Password change' %}{% endblock %}
{% block content %}
<div class="pwd_change">
<h2>{% trans 'Password change' %}</h2>
<form action="" method="post">
{{ form.old_password.errors }}
<p><label for="id_old_password">当前密码:</label>{{ form.old_password }}</p>
{{ form.new_password1.errors }}
<p><label for="id_new_password1">新密码:</label>{{ form.new_password1 }}</p>
{{ form.new_password2.errors }}
<p><label for="id_new_password2">新密码确认:</label>{{ form.new_password2 }}</p>
<p><input type="submit" value="提交" class="submit" /></p>
</form>
</div>
{% endblock %}

View File

@@ -0,0 +1,16 @@
{% extends "base.html" %}
{% load i18n %}
{% block breadcrumbs %}<div class="breadcrumbs"><a href="../../">{% trans 'Home' %}</a> &rsaquo; {% trans 'Password reset' %}</div>{% endblock %}
{% block title %}{% trans 'Password reset complete' %}{% endblock %}
{% block content %}
<h2>{% trans 'Password reset complete' %}</h2>
<p>{% trans "Your password has been set. You may go ahead and log in now." %}</p>
<p><a href="{{ login_url }}">{% trans 'Log in' %}</a></p>
{% endblock %}

View File

@@ -0,0 +1,32 @@
{% extends "base.html" %}
{% load i18n %}
{% block breadcrumbs %}<div class="breadcrumbs"><a href="../">{% trans 'Home' %}</a> &rsaquo; {% trans 'Password reset confirmation' %}</div>{% endblock %}
{% block title %}{% trans 'Password reset' %}{% endblock %}
{% block content %}
{% if validlink %}
<h2>{% trans 'Enter new password' %}</h2>
<p>{% trans "Please enter your new password twice so we can verify you typed it in correctly." %}</p>
<form action="" method="post">
{{ form.new_password1.errors }}
<p class="aligned wide"><label for="id_new_password1">{% trans 'New password:' %}</label>{{ form.new_password1 }}</p>
{{ form.new_password2.errors }}
<p class="aligned wide"><label for="id_new_password2">{% trans 'Confirm password:' %}</label>{{ form.new_password2 }}</p>
<p><input type="submit" value="{% trans 'Change my password' %}" /></p>
</form>
{% else %}
<h1>{% trans 'Password reset unsuccessful' %}</h1>
<p>{% trans "The password reset link was invalid, possibly because it has already been used. Please request a new password reset." %}
{% endif %}
{% endblock %}

View File

@@ -0,0 +1,14 @@
{% extends "base.html" %}
{% load i18n %}
{% block breadcrumbs %}<div class="breadcrumbs"><a href="../">{% trans 'Home' %}</a> &rsaquo; {% trans 'Password reset' %}</div>{% endblock %}
{% block title %}{% trans 'Password reset successful' %}{% endblock %}
{% block content %}
<h2>{% trans 'Password reset successful' %}</h2>
<p>{% trans "We've e-mailed you instructions for setting your password to the e-mail address you submitted. You should be receiving it shortly." %}</p>
{% endblock %}

View File

@@ -0,0 +1,15 @@
{% load i18n %}{% autoescape off %}
{% trans "You're receiving this e-mail because you requested a password reset" %}
{% blocktrans %}for your user account at {{ site_name }}{% endblocktrans %}.
{% trans "Please go to the following page and choose a new password:" %}
{% block reset_link %}
{{ protocol }}://{{ domain }}{% url django.contrib.auth.views.password_reset_confirm uidb36=uid, token=token %}
{% endblock %}
{% trans "Your username, in case you've forgotten:" %} {{ user.username }}
{% trans "Thanks for using our site!" %}
{% blocktrans %}The {{ site_name }} team{% endblocktrans %}
{% endautoescape %}

View File

@@ -0,0 +1,14 @@
{% extends "base.html" %}
{% load i18n %}
{% block breadcrumbs %}<div class="breadcrumbs"><a href="../">{% trans 'Home' %}</a> &rsaquo; {% trans 'Password reset' %}</div>{% endblock %}
{% block title %}{% trans "Password reset" %}{% endblock %}
{% block content %}
<h2>{% trans "Password reset" %}</h2>
<p>请在下面输入您的 e-mail 地址,我们会把新密码设置说明通过邮件发送给您。</p>
<form action="" method="post">
<label for="id_email">{% trans 'E-mail address:' %}</label> {{ form.email }}
<input type="submit" value="提交" />
{{ form.email.errors }}
</form>
{% endblock %}

View File

@@ -0,0 +1,8 @@
{% extends "base.html" %}
{% block title %}Create an account{% endblock %}
{% block content %}
Closed.
{% endblock %}

View File

@@ -0,0 +1,6 @@
{% extends "base.html" %}
{% block title %}感谢注册{% endblock %}
{% block content %}
<p>感谢注册,激活邮件已发往您的邮箱,请查收。如果您在收件箱里没找到,请检查下是否被当成垃圾邮件了。</p>
{% endblock %}

View File

@@ -0,0 +1,26 @@
{% extends "base.html" %}
{% block title %}用户注册{% endblock %}
{% block content %}
<h2>用户注册</h2>
<form action="" method="post" class="reg">
<label for="id_username">用户名:</label>
{{ form.username }}
{% if form.username.errors %}
{{ form.username.errors }}
{% endif %}<br />
<label for="id_email">邮箱:</label>
{{ form.email }}<span>(我们将给您发送帐号激活邮件.)</span>
{% if form.email.errors %}
{{ form.email.errors }}
{% endif %}<br />
<label for="id_password1">密码:</label>
{{ form.password1 }}
{% if form.password1.errors %}
{{ form.password1.errors }}
{% endif %}<br />
<label for="id_password2">确认密码:</label>
{{ form.password2 }}<br />
<input type="submit" value="提交" class="submit" />
</form>
{% endblock %}