From 01444a8e45b7bd5b846ebc1a26afb87ee18f8265 Mon Sep 17 00:00:00 2001 From: René 'Necoro' Neumann Date: Tue, 15 Feb 2011 03:19:21 +0100 Subject: More nice things for constant expenses --- templates/menu.mako | 2 +- templates/page.mako | 15 +++++++++++++++ templates/pages/const.mako | 26 ++++++++++++++++++++++++++ templates/pages/constlist.mako | 19 +++++++++++++++++++ templates/pages/show.mako | 12 +++--------- 5 files changed, 64 insertions(+), 10 deletions(-) create mode 100644 templates/pages/const.mako create mode 100644 templates/pages/constlist.mako (limited to 'templates') diff --git a/templates/menu.mako b/templates/menu.mako index 2d4dc5e..98e5904 100644 --- a/templates/menu.mako +++ b/templates/menu.mako @@ -2,7 +2,7 @@ menu = [ ("/", "Kosten"), ("/add", "Neu"), - ("/const/add", "Konstante Kosten"), + ("/const", "Konstante Kosten"), ("/categories", "Kategorien") ] %> diff --git a/templates/page.mako b/templates/page.mako index 8e30cf3..e08207c 100644 --- a/templates/page.mako +++ b/templates/page.mako @@ -8,3 +8,18 @@ ${next.body()} ## functions <%def name="heading()"> + +<%def name="left_arrow(target,label)"> + + + ${label} + + + +<%def name="right_arrow(target,label)"> + + + ${label} + + + diff --git a/templates/pages/const.mako b/templates/pages/const.mako new file mode 100644 index 0000000..a65a260 --- /dev/null +++ b/templates/pages/const.mako @@ -0,0 +1,26 @@ +<%inherit file="/page.mako" /> + + +

Edit Create new based on this

+ +<% + p = exp.prev + if p: + context.write(self.left_arrow("const/%s" % p.id, p.description)) + + p = exp.next + if p: + context.write(self.right_arrow("const/%s" % p.id, p.description)) +%> + + +<%def name="heading()"> + Constant Expense + diff --git a/templates/pages/constlist.mako b/templates/pages/constlist.mako new file mode 100644 index 0000000..83fd9f3 --- /dev/null +++ b/templates/pages/constlist.mako @@ -0,0 +1,19 @@ +<%inherit file="/page.mako" /> + +

Current

+ + +

Outdated

+ + +<%def name="heading()"> + Constant Expenses + diff --git a/templates/pages/show.mako b/templates/pages/show.mako index 4a8f9ff..ea9f2e2 100644 --- a/templates/pages/show.mako +++ b/templates/pages/show.mako @@ -11,7 +11,7 @@ % endfor <%self:detail name="Constant" sum="${e.constsum}" set="${e.consts}" args="exp"> - ${exp.monthly} -- ${exp.description} + ${exp.monthly} -- ${exp.description} <%self:detail name="In Summa" sum="${e.sum}" set="${e.all}" args="exp"> @@ -26,10 +26,7 @@ else: date = "%s/%s" % (e.date.year, e.date.month - 1) %> - - - ${date} - +${self.left_arrow(date, date)} % if not is_last: <% @@ -38,10 +35,7 @@ else: date = "%s/%s" % (e.date.year, e.date.month + len(exps)) %> - - ${date} - - + ${self.right_arrow(date, date)} % endif <%def name="heading()"> -- cgit v1.2.3-54-g00ecf