diff options
author | Marian Sigler <m@qjym.de> | 2012-09-26 03:47:57 +0200 |
---|---|---|
committer | Marian Sigler <m@qjym.de> | 2012-09-26 03:47:57 +0200 |
commit | bf5d684c05a26787de0de80b0894b9d2d031c6ad (patch) | |
tree | 384a98a46061d04cc5064059f89215886b208dbc /templates | |
parent | 1d149b55d57632c41bb3d0d60805f3552cde3a22 (diff) | |
download | web-bf5d684c05a26787de0de80b0894b9d2d031c6ad.tar.gz web-bf5d684c05a26787de0de80b0894b9d2d031c6ad.tar.bz2 web-bf5d684c05a26787de0de80b0894b9d2d031c6ad.zip |
Implement password recovery functionality.
Diffstat (limited to 'templates')
-rw-r--r-- | templates/index.html | 7 | ||||
-rw-r--r-- | templates/lost_password.html | 16 | ||||
-rw-r--r-- | templates/lost_password_complete.html | 19 | ||||
-rw-r--r-- | templates/mail/lost_password.txt | 11 | ||||
-rw-r--r-- | templates/register.html | 2 | ||||
-rw-r--r-- | templates/register_complete.html | 2 | ||||
-rw-r--r-- | templates/settings.html | 2 |
7 files changed, 54 insertions, 5 deletions
diff --git a/templates/index.html b/templates/index.html index abcbb1d..cbbaa44 100644 --- a/templates/index.html +++ b/templates/index.html @@ -5,9 +5,12 @@ {%- if session.username %} <p>Hallo {{ session.username }}. <a href="{{ url_for('settings') }}">Einstellungen</a></p> {%- else %} -<p><a href="/register">Account erstellen</a></p> +<p> + <a href="/register">Account erstellen</a> | + <a href="/lost_password">Passwort vergessen</a> +</p> <form action="{{ url_for('index') }}" method="post" class="form-horizontal"> - {{ render_field(form.username) }} + {{ render_field(form.username, autofocus="autofocus") }} {{ render_field(form.password) }} {{ form.csrf_token }} <div class="form-actions"><input type="submit" value="Login" /></div> diff --git a/templates/lost_password.html b/templates/lost_password.html new file mode 100644 index 0000000..391af0d --- /dev/null +++ b/templates/lost_password.html @@ -0,0 +1,16 @@ +{%- extends 'base.html' %} +{%- from '_macros.html' import render_field %} +{%- set title = 'Passwort vergessen' %} +{%- set no_login_message = true %} +{%- block content %} +<form action="{{ url_for('lost_password') }}" method="post" class="form-horizontal"> + <p> + Du hast dein Passwort vergessen? Kein Problem. + Gib einfach unten deinen Benutzernamen ein, und wir schicken dir einen Link, + mit dem du dir ein neues setzen kannst. + </p> + {{ render_field(form.username, autofocus="autofocus") }} + {{ form.csrf_token }} + <div class="form-actions"><input type="submit" value="Weiter" /></div> +</form> +{%- endblock %} diff --git a/templates/lost_password_complete.html b/templates/lost_password_complete.html new file mode 100644 index 0000000..828bd6d --- /dev/null +++ b/templates/lost_password_complete.html @@ -0,0 +1,19 @@ +{%- extends 'base.html' %} +{%- from '_macros.html' import render_field %} +{%- set title = 'Passwort vergessen' %} +{%- set no_login_message = true %} +{%- block content %} +<form action="{{ url_for('lost_password_complete', token=token) }}" method="post" class="form-horizontal"> + <p> + Hier kannst du jetzt ein neues Passwort setzen. + </p> + <div class="control-group"> + <div class="control-label">Benutzername</div> + <div class="controls"><input readonly="readonly" value="{{ username }}" /></div> + </div> + {{ render_field(form.password, autofocus="autofocus") }} + {{ render_field(form.password_confirm) }} + {{ form.csrf_token }} + <div class="form-actions"><input type="submit" value="Registrieren" /></div> +</form> +{%- endblock %} diff --git a/templates/mail/lost_password.txt b/templates/mail/lost_password.txt new file mode 100644 index 0000000..af51ae4 --- /dev/null +++ b/templates/mail/lost_password.txt @@ -0,0 +1,11 @@ +Hallo {{ username }}, + +Jemand, vermutlich du, hat auf spline accounts einen Link zum Ändern +deines Passworts angefordert. + +Hier kannst du dein Passwort ändern: + <{{ link }}> + + +Wenn du diese Mail nicht angefordert hast, brauchst du nichts +weiter zu tun. Dein altes Passwort bleibt weiter gültig. diff --git a/templates/register.html b/templates/register.html index ab785ea..d8ef800 100644 --- a/templates/register.html +++ b/templates/register.html @@ -4,7 +4,7 @@ {%- set no_login_message = true %} {%- block content %} <form action="{{ url_for('register') }}" method="post" class="form-horizontal"> - {{ render_field(form.username) }} + {{ render_field(form.username, autofocus="autofocus") }} {{ render_field(form.mail) }} {{ form.csrf_token }} <div class="form-actions"><input type="submit" value="E-Mail-Adresse bestätigen" /></div> diff --git a/templates/register_complete.html b/templates/register_complete.html index 9320995..629f9c9 100644 --- a/templates/register_complete.html +++ b/templates/register_complete.html @@ -17,7 +17,7 @@ <div class="control-label">E-Mail-Adresse</div> <div class="controls"><input readonly="readonly" value="{{ mail }}" /></div> </div> - {{ render_field(form.password) }} + {{ render_field(form.password, autofocus="autofocus") }} {{ render_field(form.password_confirm) }} {{ form.csrf_token }} <div class="form-actions"><input type="submit" value="Registrieren" /></div> diff --git a/templates/settings.html b/templates/settings.html index 1d112d8..c672493 100644 --- a/templates/settings.html +++ b/templates/settings.html @@ -3,7 +3,7 @@ {%- set title = 'Einstellungen' %} {%- block content %} <form action="{{ url_for('settings') }}" method="post" class="form-horizontal"> - {{ render_field(form.old_password) }} + {{ render_field(form.old_password, autofocus="autofocus") }} <h3>Globale Einstellungen ändern</h3> {{ render_field(form.mail) }} {{ render_field(form.password) }} |