From ea136b506b20ec3856f9c32832e461cbdd944648 Mon Sep 17 00:00:00 2001 From: Alexis Metaireau Date: Sat, 30 Jul 2011 15:47:51 +0200 Subject: [PATCH] List existing sessions on the home. Also factorize the code to display errors in forms. --- budget/templates/home.html | 27 +++++++++++++++++---------- budget/templates/layout.html | 4 +--- budget/templates/member_form.html | 6 +----- 3 files changed, 19 insertions(+), 18 deletions(-) diff --git a/budget/templates/home.html b/budget/templates/home.html index 7d4dc327..7a0cafcf 100644 --- a/budget/templates/home.html +++ b/budget/templates/home.html @@ -2,16 +2,23 @@ {% block content %}

Welcome on the budget manager

- -
-

Log to an existing project...

- - {{ auth_form.hidden_tag() }} - -

{{ auth_form.id.label }}
{{ auth_form.id }}

-

{{ auth_form.password.label }}
{{ auth_form.password }}

-

{{ auth_form.submit }}

-
+
+
+

Log to an existing project...

+ + {{ auth_form.hidden_tag() }} + +

{{ auth_form.id.label }}
{{ auth_form.id }}

+

{{ auth_form.password.label }}
{{ auth_form.password }}

+

{{ auth_form.submit }}

+
+

Recently visisted projects

+ +

...or create a new one

diff --git a/budget/templates/layout.html b/budget/templates/layout.html index 79240b3c..25c5dd74 100644 --- a/budget/templates/layout.html +++ b/budget/templates/layout.html @@ -8,10 +8,8 @@
- -
+
{% block top_menu %}{% endblock %}
diff --git a/budget/templates/member_form.html b/budget/templates/member_form.html index 75b3efe1..6eb4575d 100644 --- a/budget/templates/member_form.html +++ b/budget/templates/member_form.html @@ -1,8 +1,4 @@ -{% for errors in form.errors.values() %} - {% for error in errors %} -

{{error}}

- {% endfor %} -{% endfor %} +{% include "display_errors.html" %} {{ form.hidden_tag() }}

{{ form.name.label }}
{{ form.name }}