summaryrefslogtreecommitdiff
path: root/templates
diff options
context:
space:
mode:
authorRené 'Necoro' Neumann <necoro@necoro.net>2010-07-05 21:02:54 +0200
committerRené 'Necoro' Neumann <necoro@necoro.net>2010-07-05 21:02:54 +0200
commitea14f46429fc6262f3806ecec748f1945a0e6169 (patch)
treefb03ad87f31934ad2d893344c1df855a935bfbce /templates
parentf2f2229d7fb0e5edf8039f9911f25b9e7c8d9c8e (diff)
downloadkosten-ea14f46429fc6262f3806ecec748f1945a0e6169.tar.gz
kosten-ea14f46429fc6262f3806ecec748f1945a0e6169.tar.bz2
kosten-ea14f46429fc6262f3806ecec748f1945a0e6169.zip
Some restructuring
Diffstat (limited to 'templates')
-rw-r--r--templates/pages/show.mako50
1 files changed, 26 insertions, 24 deletions
diff --git a/templates/pages/show.mako b/templates/pages/show.mako
index dc23b9c..054c287 100644
--- a/templates/pages/show.mako
+++ b/templates/pages/show.mako
@@ -5,31 +5,18 @@
<h2>${get_d(e)}</h2>
% endif
% for c in e.catexps:
- <strong class="details_heading">${c.cat.name}</strong> ${c.expense}<br/>
- <div class="details">
- <ul>
- % for exp in c.all:
- <li><a href=${"/edit/%s" % exp.id | url}>${exp.day}.${exp.month}. -- ${exp.description}: ${exp.expense}</a></li>
- % endfor
- </ul>
- </div>
+ <%self:detail name="${c.cat.name}" sum="${c.expense}" set="${c.all}" args="exp">
+ <a href=${"/edit/%s" % exp.id | url}>${exp.day}.${exp.month}. -- ${exp.description}: ${exp.expense}</a>
+ </%self:detail>
% endfor
- <strong class="details_heading">Constant:</strong> ${e.constsum}<br/>
- <div class="details">
- <ul>
- % for c in e.consts:
- <li>${c.monthly} -- ${c.description}</li>
- % endfor
- </ul>
- </div>
- <strong class="details_heading">In Summa:</strong> ${e.sum}<br />
- <div class="details">
- <ul>
- % for exp in e.all:
- <li><a href=${"/edit/%s" % exp.id | url}>${exp.day}.${exp.month}. -- ${exp.description}: ${exp.expense}</a></li>
- % endfor
- </ul>
- </div>
+
+ <%self:detail name="Constant" sum="${e.constsum}" set="${e.consts}" args="exp">
+ ${exp.monthly} -- ${exp.description}
+ </%self:detail>
+
+ <%self:detail name="In Summa" sum="${e.sum}" set="${e.all}" args="exp">
+ <a href=${"/edit/%s" % exp.id | url}>${exp.day}.${exp.month}. -- ${exp.description}: ${exp.expense}</a>
+ </%self:detail>
<br/>
% endfor
@@ -50,3 +37,18 @@
${parent.js()}
<script type="text/javascript" src=${"/static/js/show.js" | url}></script>
</%def>
+
+<%def name="detail(name, sum, set)">
+ <div class="detail">
+ <img class="mark" src=${"/static/images/closed.png" | url} />
+ <span class="heading">${name}:</span> <span class="sum">${sum}</span><br/>
+ <div class="details">
+ <ul>
+ % for exp in set:
+ <li class="expense">${caller.body(exp)}</li>
+ % endfor
+ </ul>
+ </div>
+ </div>
+</%def>
+