summaryrefslogtreecommitdiff
path: root/templates/pages/show.jinja
diff options
context:
space:
mode:
authorRené 'Necoro' Neumann <necoro@necoro.net>2013-04-12 01:32:37 +0200
committerRené 'Necoro' Neumann <necoro@necoro.net>2013-04-12 01:32:37 +0200
commitabfc1005db0f256ca60823f61b8a904304eb9a4c (patch)
tree87c1f13512cae335759d9bf43dab7fc60c3afec0 /templates/pages/show.jinja
parent978f1a4999937a56bd3861a219bb2d9082ba5de6 (diff)
downloadkosten-abfc1005db0f256ca60823f61b8a904304eb9a4c.tar.gz
kosten-abfc1005db0f256ca60823f61b8a904304eb9a4c.tar.bz2
kosten-abfc1005db0f256ca60823f61b8a904304eb9a4c.zip
In Flask/Jinja: Show / Categories
Diffstat (limited to 'templates/pages/show.jinja')
-rw-r--r--templates/pages/show.jinja59
1 files changed, 59 insertions, 0 deletions
diff --git a/templates/pages/show.jinja b/templates/pages/show.jinja
new file mode 100644
index 0000000..e7d340e
--- /dev/null
+++ b/templates/pages/show.jinja
@@ -0,0 +1,59 @@
+{% extends "page.jinja" %}
+
+{% block heading %}
+ {% if exps | length > 1 %}
+ Aktuelle Kosten
+ {% else %}
+ Kosten für {{exps[0]|date}}
+ {% endif %}
+{% endblock %}
+
+{% block js %}
+ {{ super() }}
+ <script type="text/javascript" src="{{ "js/show.js" | static_url }}"></script>
+{% endblock %}
+
+{% block content %}
+ {% for e in exps %}
+ {% if exps | length > 1 %}<h2>{{e|date}}</h2>{% endif %}
+ {% for c in e.catexps | sort(attribute="cat.name") %}
+ {% call(exp) detail(name=c.cat.name, sum=c.expense, set=c.all) %}
+ <a href="{{ url_for(".edit", id = exp.id) }}">{{exp.day}}.{{exp.month}}. -- {{exp.description}}: {{exp.expense | eur }}</a>
+ {% endcall %}
+ {% endfor %}
+
+ {% call(exp) detail(name="Constant", sum=e.constsum, set=e.consts) %}
+ <a href="{{ url_for("consts.show", id = exp.id) }}">{{exp.monthly}} -- {{exp.description}}</a>
+ {% endcall %}
+
+ {% call(exp) detail(name="In Summa", sum=e.sum, set=e.all, color="#ff2d2d") %}
+ <a href="{{ url_for(".edit", id = exp.id) }}">{{exp.day}}.{{exp.month}}. -- {{exp.description}}: {{exp.expense | eur}}</a>
+ {% endcall %}
+ <br>
+ {% endfor %}
+
+ {% set d = prev_date(exps | last) %}
+ {{ left_arrow(url_for(".show_date", **d), d | date) }}
+
+ {% if not is_last %}
+ {% set d = next_date(exps | last) %}
+ {{ right_arrow(url_for(".show_date", **d), d | date) }}
+ {% endif %}
+{% endblock content %}
+
+{% macro detail(name, sum, set, color=None) %}
+ <div class="detail">
+ <img class="mark" src="{{ "images/closed.png" | static_url }}">
+ {% call colorize(fgcolor=color) %}
+ <span class="heading">{{name}}:</span> <span class="sum">{{sum | eur}}</span><br>
+ {% endcall %}
+ <div class="details">
+ <ul>
+ {% for exp in set %}
+ <li class="expense">{{ caller(exp) }}</li>
+ {% endfor %}
+ </ul>
+ </div>
+ </div>
+{% endmacro %}
+