diff options
author | René 'Necoro' Neumann <necoro@necoro.net> | 2011-02-15 03:19:21 +0100 |
---|---|---|
committer | René 'Necoro' Neumann <necoro@necoro.net> | 2011-02-15 03:19:21 +0100 |
commit | 01444a8e45b7bd5b846ebc1a26afb87ee18f8265 (patch) | |
tree | ceb2fcc0b90663eb02a8271fdc2427cd869771d4 /templates | |
parent | a69e90c161e0a476f81efe907631c4c26c4fd88e (diff) | |
download | kosten-01444a8e45b7bd5b846ebc1a26afb87ee18f8265.tar.gz kosten-01444a8e45b7bd5b846ebc1a26afb87ee18f8265.tar.bz2 kosten-01444a8e45b7bd5b846ebc1a26afb87ee18f8265.zip |
More nice things for constant expenses
Diffstat (limited to '')
-rw-r--r-- | templates/menu.mako | 2 | ||||
-rw-r--r-- | templates/page.mako | 15 | ||||
-rw-r--r-- | templates/pages/const.mako | 26 | ||||
-rw-r--r-- | templates/pages/constlist.mako | 19 | ||||
-rw-r--r-- | templates/pages/show.mako | 12 |
5 files changed, 64 insertions, 10 deletions
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> + +<%def name="left_arrow(target,label)"> + <a id="left" href=${"/%s" % target | url}> + <img src=${"/static/images/arrow_left.png" | url} /> + <span class="navdate">${label}</span> + </a> +</%def> + +<%def name="right_arrow(target,label)"> + <a id="right" href=${"/%s" % target | url}> + <img src=${"/static/images/arrow_right.png" | url} /> + <span class="navdate">${label}</span> + </a> +</%def> + 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" /> + +<ul class="arrow"> + <li><span class="heading">Description:</span> ${exp.description}</li> + <li><span class="heading">Expense:</span> ${exp.expense}</li> + <li><span class="heading">Monthly expense:</span> ${exp.monthly}</li> + <li><span class="heading">Start Date:</span> ${dformat(exp.start)}</li> + <li><span class="heading">End Date:</span> ${dformat(exp.end)}</li> + <li><span class="heading">Occurrence (every x months):</span> ${exp.months}</li> +</ul> +<p><a href=${"/const/edit/%s" % exp.id | url}>Edit</a> <a href=${"/const/add/from/%s" % exp.id | url}>Create new based on this</a></p> + +<% + 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 +</%def> 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" /> + +<h2>Current</h2> +<ul class="arrow"> + % for c in current: + <li><a href=${"/const/%s" % c.id | url}>${c.description} (${c.expense})</a></li> + % endfor +</ul> + +<h2>Outdated</h2> +<ul class="arrow"> + % for c in old: + <li><a href=${"/const/%s" % c.id | url}>${c.description} (${c.expense})</a></li> + % endfor +</ul> + +<%def name="heading()"> + Constant Expenses +</%def> 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"> - <a href=${"/const/edit/%s" % exp.id | url}>${exp.monthly} -- ${exp.description}</a> + <a href=${"/const/%s" % exp.id | url}>${exp.monthly} -- ${exp.description}</a> </%self:detail> <%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) %> -<a id="left" href=${"/" + date | url}> - <img src=${"/static/images/arrow_left.png" | url} /> - <span class="navdate">${date}</span> -</a> +${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)) %> - <a id="right" href=${"/" + date | url}> - <span class="navdate">${date}</span> - <img src=${"/static/images/arrow_right.png" | url}/> - </a> + ${self.right_arrow(date, date)} % endif <%def name="heading()"> |