From e166ea9dd833f5d22f8a32d36fd4ed539c902410 Mon Sep 17 00:00:00 2001 From: Weitian LI Date: Sat, 26 Apr 2014 23:57:55 +0800 Subject: * implemented 'password_reset' function based on django auth views * added password_reset related templates and email templates * updated account urls.py --- account/templates/account/login.html | 3 ++ .../templates/account/password_reset_complete.html | 20 ++++++++++++ .../templates/account/password_reset_confirm.html | 36 ++++++++++++++++++++++ account/templates/account/password_reset_done.html | 20 ++++++++++++ .../templates/account/password_reset_email.html | 12 ++++++++ account/templates/account/password_reset_form.html | 25 +++++++++++++++ .../templates/account/password_reset_subject.txt | 1 + 7 files changed, 117 insertions(+) create mode 100644 account/templates/account/password_reset_complete.html create mode 100644 account/templates/account/password_reset_confirm.html create mode 100644 account/templates/account/password_reset_done.html create mode 100644 account/templates/account/password_reset_email.html create mode 100644 account/templates/account/password_reset_form.html create mode 100644 account/templates/account/password_reset_subject.txt (limited to 'account/templates') diff --git a/account/templates/account/login.html b/account/templates/account/login.html index 4fee972..fb14550 100644 --- a/account/templates/account/login.html +++ b/account/templates/account/login.html @@ -18,6 +18,9 @@ {% bootstrap_form form layout='horizontal' %} {% buttons submit='提交' reset='重置' layout='horizontal' %}{% endbuttons %} + +
+

忘记密码了? 重置密码

{% endblock %} diff --git a/account/templates/account/password_reset_complete.html b/account/templates/account/password_reset_complete.html new file mode 100644 index 0000000..f4705e9 --- /dev/null +++ b/account/templates/account/password_reset_complete.html @@ -0,0 +1,20 @@ +{% extends 'base.html' %} +{% load staticfiles %} +{% load url from future %} +{% load bootstrap3 %} + +{# step4: password reset complete template #} + +{% block title %} +成功设置新密码 | 2014 SKA Summer School +{% endblock %} + +{% block content %} +
+

成功设置新密码

+
+

您已成功设置了新的登录密码。 登录

+
+{% endblock %} + +{# vim: set ts=8 sw=2 tw=0 fenc=utf-8 ft=htmldjango.html: #} diff --git a/account/templates/account/password_reset_confirm.html b/account/templates/account/password_reset_confirm.html new file mode 100644 index 0000000..2ae2711 --- /dev/null +++ b/account/templates/account/password_reset_confirm.html @@ -0,0 +1,36 @@ +{% extends 'base.html' %} +{% load staticfiles %} +{% load url from future %} +{% load bootstrap3 %} + +{# step3: password reset confirm template #} + +{% block title %} +{% if validlink %} +设置新密码 | 2014 SKA Summer School +{% else %} +重置密码失败 | 2014 SKA Summer School +{% endif %} +{% endblock %} + +{% block content %} +
+ {% if validlink %} +

设置新密码

+
+

请在以下为您的账户设置新登录密码。

+
+ {% csrf_token %} + {% bootstrap_form form layout='horizontal' %} + {% buttons submit='提交' reset='重置' layout='horizontal' %}{% endbuttons %} +
+ {% else %} +

重置密码失败

+
+

很抱歉,您使用的链接无效,可能该链接已被使用过,您可以尝试重新请求重置密码。

+

如果仍有问题,请与我们联系:skaschool2014@163.com

+ {% endif %} +
+{% endblock %} + +{# vim: set ts=8 sw=2 tw=0 fenc=utf-8 ft=htmldjango.html: #} diff --git a/account/templates/account/password_reset_done.html b/account/templates/account/password_reset_done.html new file mode 100644 index 0000000..98c513b --- /dev/null +++ b/account/templates/account/password_reset_done.html @@ -0,0 +1,20 @@ +{% extends 'base.html' %} +{% load staticfiles %} +{% load url from future %} +{% load bootstrap3 %} + +{# step2: password reset done template #} + +{% block title %} +已发送重置邮件 | 2014 SKA Summer School +{% endblock %} + +{% block content %} +
+

已发送重置邮件

+

我们已经向您的邮件发送了重置密码邮件,请留意查收,并使用其中的链接重置密码。

+

如果您未能收到邮件,请确认是否正确输入您当时注册使用的邮箱。如果仍有问题,请与我们联系:skaschool2014@163.com

+
+{% endblock %} + +{# vim: set ts=8 sw=2 tw=0 fenc=utf-8 ft=htmldjango.html: #} diff --git a/account/templates/account/password_reset_email.html b/account/templates/account/password_reset_email.html new file mode 100644 index 0000000..7ea9da6 --- /dev/null +++ b/account/templates/account/password_reset_email.html @@ -0,0 +1,12 @@ +Hello, + +您收到这封邮件是因为您请求重置您在网站 {{ site_name }} (2014 SKA Summer School)上的账户密码。 + +请打开以下链接来重新设置新密码: + +{{ protocol }}://{{ domain }}{% url 'password_reset_confirm' uidb64=uid token=token %} + +您的登录用户名为:{{ user.get_username }} + + +2014 SKA Summer School Team diff --git a/account/templates/account/password_reset_form.html b/account/templates/account/password_reset_form.html new file mode 100644 index 0000000..ec8491d --- /dev/null +++ b/account/templates/account/password_reset_form.html @@ -0,0 +1,25 @@ +{% extends 'base.html' %} +{% load staticfiles %} +{% load url from future %} +{% load bootstrap3 %} + +{# step1: password reset template #} + +{% block title %} +重置密码 | 2014 SKA Summer School +{% endblock %} + +{% block content %} +
+

重置密码

+
+

请在下面输入您注册时使用的邮箱地址,然后我们将发送邮件以帮助您重新设置密码。

+
+ {% csrf_token %} + {% bootstrap_form form layout='horizontal' %} + {% buttons submit='提交' layout='horizontal' %}{% endbuttons %} +
+
+{% endblock %} + +{# vim: set ts=8 sw=2 tw=0 fenc=utf-8 ft=htmldjango.html: #} diff --git a/account/templates/account/password_reset_subject.txt b/account/templates/account/password_reset_subject.txt new file mode 100644 index 0000000..e36ec12 --- /dev/null +++ b/account/templates/account/password_reset_subject.txt @@ -0,0 +1 @@ +重置您的账户密码 -- cgit v1.2.2