diff options
Diffstat (limited to '')
-rw-r--r-- | templates/404.mako | 4 | ||||
-rw-r--r-- | templates/page.mako | 9 | ||||
-rw-r--r-- | templates/show.mako | 25 |
3 files changed, 34 insertions, 4 deletions
diff --git a/templates/404.mako b/templates/404.mako index aeb95e3..c47aee3 100644 --- a/templates/404.mako +++ b/templates/404.mako @@ -5,3 +5,7 @@ <p> Sorry - the requested page <i>${page}</i> cannot be found. </p> + +<%def name="heading()"> + 404 -- Page not found! +</%def> diff --git a/templates/page.mako b/templates/page.mako index cc9911f..8e30cf3 100644 --- a/templates/page.mako +++ b/templates/page.mako @@ -1,9 +1,10 @@ -<%! - title = "" -%> <%inherit file="/root.mako" /> ## content -<h1 class="title">${self.attr.title}</h1> +<h1 class="title">${self.heading()}</h1> ${next.body()} + +## functions +<%def name="heading()"> +</%def> diff --git a/templates/show.mako b/templates/show.mako new file mode 100644 index 0000000..270477a --- /dev/null +++ b/templates/show.mako @@ -0,0 +1,25 @@ +<%inherit file="/page.mako" /> + +% for e in exps: + % if len(exps) > 1: + <h2>${get_d(e)}</h2> + % endif + % for c in e.catexps: + <strong>${c.cat.name}</strong> ${c.expense}<br> + % endfor + <strong>Constant:</strong> ${e.const}<br> + <strong>In Summa:</strong> ${e.sum}<br><br> +% endfor + +<%def name="heading()"> + % if len(exps) > 1: + Current expenses + % else: + Expenses for ${get_d(exps[0])} + % endif + +</%def> + +<%def name="get_d(e)"> + ${e.date.year}/${e.date.month} +</%def> |