From 75209aeed0140c804047b4f3466d329b9eb246b9 Mon Sep 17 00:00:00 2001 From: Alexis Metaireau Date: Sat, 8 Oct 2011 15:52:12 +0200 Subject: Add a password recovery feature. Fix #32 --- budget/templates/authenticate.html | 4 ---- budget/templates/forms.html | 12 +++++++++++- budget/templates/home.html | 1 + budget/templates/password_reminder | 8 ++++++++ budget/templates/password_reminder.html | 8 ++++++++ 5 files changed, 28 insertions(+), 5 deletions(-) create mode 100644 budget/templates/password_reminder create mode 100644 budget/templates/password_reminder.html (limited to 'budget/templates') diff --git a/budget/templates/authenticate.html b/budget/templates/authenticate.html index 9852d6a..83839e1 100644 --- a/budget/templates/authenticate.html +++ b/budget/templates/authenticate.html @@ -2,10 +2,6 @@ {% block content %}

Authentication

-{% for errors in form.errors.values() %} -

{{ ", ".join(errors) }}

-{% endfor %} - {% if create_project %}

The project you are trying to access do not exist, do you want to create it? diff --git a/budget/templates/forms.html b/budget/templates/forms.html index 80a0d17..beb714b 100644 --- a/budget/templates/forms.html +++ b/budget/templates/forms.html @@ -21,7 +21,7 @@

{% if home %} - Go back Home + Can't remember the password? {% endif %} {% if cancel %} @@ -32,6 +32,7 @@ {% macro authenticate(form, home=False) %} {% include "display_errors.html" %} + {{ form.hidden_tag() }} {{ input(form.id) }} {{ input(form.password) }} @@ -111,3 +112,12 @@
{% endmacro %} + +{% macro remind_password(form) %} + + {% include "display_errors.html" %} + {{ form.hidden_tag() }} + {{ input(form.id) }} + {{ submit(form.submit) }} + +{% endmacro %} diff --git a/budget/templates/home.html b/budget/templates/home.html index ceb3b57..bf74767 100644 --- a/budget/templates/home.html +++ b/budget/templates/home.html @@ -26,6 +26,7 @@

Log to an existing project...

{{ forms.authenticate(auth_form, home=True) }} + can't remember your password?
diff --git a/budget/templates/password_reminder b/budget/templates/password_reminder new file mode 100644 index 0000000..fc24a6f --- /dev/null +++ b/budget/templates/password_reminder @@ -0,0 +1,8 @@ +Hi, + +You requested to be reminded about your password for "{{ project.name }}". + +You can access it here: {{ config['SITE_URL'] }}{{ url_for(".list_bills", project_id=project.id) }}, the private code is "{{ project.password }}". + +Hope this helps, +Some weird guys (with beards) diff --git a/budget/templates/password_reminder.html b/budget/templates/password_reminder.html new file mode 100644 index 0000000..0110cb8 --- /dev/null +++ b/budget/templates/password_reminder.html @@ -0,0 +1,8 @@ +{% extends "layout.html" %} + +{% block content %} +

Password reminder

+
+{{ forms.remind_password(form) }} +
+{% endblock %} -- cgit v1.1