summaryrefslogtreecommitdiff
path: root/templates
diff options
context:
space:
mode:
authorRené 'Necoro' Neumann <necoro@necoro.net>2010-05-04 16:07:19 +0200
committerRené 'Necoro' Neumann <necoro@necoro.net>2010-05-04 16:07:19 +0200
commitfc2b648989cd5afaff3c563dea739e90c19be331 (patch)
tree6163e99ad09f42423b0899ce74c1918632efedb1 /templates
parent4b4905db5f4123a88dca9f0164a3a35679a9dc13 (diff)
downloadkosten-fc2b648989cd5afaff3c563dea739e90c19be331.tar.gz
kosten-fc2b648989cd5afaff3c563dea739e90c19be331.tar.bz2
kosten-fc2b648989cd5afaff3c563dea739e90c19be331.zip
First working 'Show'
Diffstat (limited to 'templates')
-rw-r--r--templates/404.mako4
-rw-r--r--templates/page.mako9
-rw-r--r--templates/show.mako25
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>