summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--controller.py6
-rw-r--r--helper.py3
-rw-r--r--renderer.py2
-rw-r--r--templates/pages/const.mako6
-rw-r--r--templates/pages/constlist.mako4
-rw-r--r--templates/pages/show.mako6
6 files changed, 16 insertions, 11 deletions
diff --git a/controller.py b/controller.py
index b7946b1..5ed1c43 100644
--- a/controller.py
+++ b/controller.py
@@ -102,7 +102,8 @@ class Add:
"expense",
form.notnull,
Validator("Keine Dezimalzahl", decimal.Decimal),
- description = "Betrag"
+ description = "Betrag",
+ post = " EUR"
),
form.Textbox(
"description",
@@ -255,7 +256,8 @@ class ConstAdd:
"expense",
form.notnull,
Validator("Not a valid decimal", decimal.Decimal),
- description = "Betrag"
+ description = "Betrag",
+ post = " EUR"
),
form.Textbox(
"description",
diff --git a/helper.py b/helper.py
index 69d6ab2..3ac8625 100644
--- a/helper.py
+++ b/helper.py
@@ -14,3 +14,6 @@ def appdir (*args):
def url (path):
return "\"%s\"" % web.url(path)
+
+def eur (c):
+ return "%s EUR" % c
diff --git a/renderer.py b/renderer.py
index a24aadd..0c14327 100644
--- a/renderer.py
+++ b/renderer.py
@@ -24,7 +24,7 @@ class Renderer:
except mako.exceptions.TopLevelLookupException, e:
raise web.ctx.app_stack[-1].notfound(tpl)
- return t.render(h = helper, url = helper.url, w = web, **kwargs)
+ return t.render(h = helper, eur = helper.eur, url = helper.url, w = web, **kwargs)
__call__ = render
diff --git a/templates/pages/const.mako b/templates/pages/const.mako
index 502cd64..95098ea 100644
--- a/templates/pages/const.mako
+++ b/templates/pages/const.mako
@@ -3,8 +3,8 @@
<ul class="arrow">
<li><span class="heading">Beschreibung:</span> ${exp.description}</li>
<li><span class="heading">Kategorie:</span> ${exp.category.name}</li>
- <li><span class="heading">Betrag:</span> ${exp.expense}</li>
- <li><span class="heading">Betrag pro Monat:</span> ${exp.monthly}</li>
+ <li><span class="heading">Betrag:</span> ${exp.expense | eur}</li>
+ <li><span class="heading">Betrag pro Monat:</span> ${exp.monthly | eur}</li>
<li><span class="heading">Start:</span> ${dformat(exp.start)}</li>
<li><span class="heading">Ende:</span> ${dformat(exp.end)}</li>
<li><span class="heading">Zahlungsrhythmus:</span>
@@ -22,7 +22,7 @@
<%
def create(p):
- return ("const/%s" % p.id, "%s (%s-%s)<br>%s EUR" % (p.description, dformat(p.start), dformat(p.end), p.expense))
+ return ("const/%s" % p.id, "%s (%s-%s)<br>%s" % (p.description, dformat(p.start), dformat(p.end), eur(p.expense)))
p = exp.prev
if p:
diff --git a/templates/pages/constlist.mako b/templates/pages/constlist.mako
index 8446641..6084d11 100644
--- a/templates/pages/constlist.mako
+++ b/templates/pages/constlist.mako
@@ -5,14 +5,14 @@
<h2>Aktuell</h2>
<ul class="arrow">
% for c in current:
- <li><a href=${"/const/%s" % c.id | url}>${c.description} (${c.expense})</a></li>
+ <li><a href=${"/const/%s" % c.id | url}>${c.description} (${c.expense | eur})</a></li>
% endfor
</ul>
<h2>Veraltet</h2>
<ul class="arrow">
% for c in old:
- <li><a href=${"/const/%s" % c.id | url}>${c.description} (${c.expense})</a></li>
+ <li><a href=${"/const/%s" % c.id | url}>${c.description} (${c.expense | eur})</a></li>
% endfor
</ul>
diff --git a/templates/pages/show.mako b/templates/pages/show.mako
index a255fa9..f721f13 100644
--- a/templates/pages/show.mako
+++ b/templates/pages/show.mako
@@ -6,7 +6,7 @@
% endif
% for c in e.catexps:
<%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>
+ <a href=${"/edit/%s" % exp.id | url}>${exp.day}.${exp.month}. -- ${exp.description}: ${exp.expense | eur}</a>
</%self:detail>
% endfor
@@ -15,7 +15,7 @@
</%self:detail>
<%self:detail name="In Summa" sum="${e.sum}" set="${e.all}" args="exp" color="#ff2d2d">
- <a href=${"/edit/%s" % exp.id | url}>${exp.day}.${exp.month}. -- ${exp.description}: ${exp.expense}</a>
+ <a href=${"/edit/%s" % exp.id | url}>${exp.day}.${exp.month}. -- ${exp.description}: ${exp.expense | eur}</a>
</%self:detail>
<br/>
% endfor
@@ -59,7 +59,7 @@ ${self.left_arrow(date, date)}
<div class="detail">
<img class="mark" src=${"/static/images/closed.png" | url} />
<%self:colorize fgcolor="${color}">
- <span class="heading">${name}:</span> <span class="sum">${sum}</span><br/>
+ <span class="heading">${name}:</span> <span class="sum">${sum | eur}</span><br/>
</%self:colorize>
<div class="details">
<ul>