From 47c0ab4982cb9ee9c15ce0d055ad830b1ec9e5b6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ren=C3=A9=20=27Necoro=27=20Neumann?= Date: Mon, 5 Jul 2010 22:58:43 +0200 Subject: Add month navigation --- templates/pages/show.mako | 23 ++++++++++++++++++++++- templates/root.mako | 2 +- 2 files changed, 23 insertions(+), 2 deletions(-) (limited to 'templates') diff --git a/templates/pages/show.mako b/templates/pages/show.mako index 054c287..cf14638 100644 --- a/templates/pages/show.mako +++ b/templates/pages/show.mako @@ -20,13 +20,34 @@
% endfor +<% + if e.date.month == 1: + date = "%s/12" % (e.date.year - 1) + else: + date = "%s/%s" % (e.date.year, e.date.month - 1) +%> + + + ${date} + + +<% + if e.date.month == 13 - len(exps): + date = "%s/1" % (e.date.year + 1) + else: + date = "%s/%s" % (e.date.year, e.date.month + len(exps)) +%> + + ${date} + + + <%def name="heading()"> % if len(exps) > 1: Current expenses % else: Expenses for ${get_d(exps[0])} % endif - <%def name="get_d(e)"> diff --git a/templates/root.mako b/templates/root.mako index 6092242..e789df5 100644 --- a/templates/root.mako +++ b/templates/root.mako @@ -27,7 +27,7 @@
${next.body()}
-
 
+