summaryrefslogtreecommitdiff
path: root/templates
diff options
context:
space:
mode:
authorRené 'Necoro' Neumann <necoro@necoro.net>2016-04-30 22:29:46 +0200
committerRené 'Necoro' Neumann <necoro@necoro.net>2016-07-08 23:36:35 +0200
commitd5c4984fda9819e84c8c97979f95e5b5cc5e2eb1 (patch)
treed092384fb32f1395cc09c2008a1d8d230fe42d46 /templates
parent667a7a4285d4e97ed5242e60df909f3ecdd35d59 (diff)
downloadkosten-const_groups.tar.gz
kosten-const_groups.tar.bz2
kosten-const_groups.zip
current_expensesconst_groups
Diffstat (limited to '')
-rw-r--r--templates/consts/list.jinja10
-rw-r--r--templates/consts/show.jinja4
2 files changed, 8 insertions, 6 deletions
diff --git a/templates/consts/list.jinja b/templates/consts/list.jinja
index 7fef344..80d22ad 100644
--- a/templates/consts/list.jinja
+++ b/templates/consts/list.jinja
@@ -7,18 +7,20 @@
{% block content %}
<p><a href="{{ url_for(".add") }}">Neuen Eintrag hinzufügen</a></p>
- {{ list(current, "Aktuell") }}
+ {{ list(current, "Aktuell", True) }}
{% if last_month %} {{ list(last_month, "Endeten letzten Monat") }} {% endif %}
{% if future %} {{ list(future, "Zukünftige") }} {% endif %}
{% if old %} {{ list(old, "Veraltet") }} {% endif %}
{% endblock %}
-{% macro list(list, h) %}
+{% macro list(list, h, use_current = False) %}
<h2>{{ h }}</h2>
<ul class="arrow">
- {% for c in list -%}
- <li><a href="{{ url_for(".show", id = c.id) }}">{{c.description}} ({{c.expense | eur}})</a></li>
+ {% for group in list -%}
+ {% for e in (group.current_expenses() if use_current else group.expenses) -%}
+ <li><a href="{{ url_for(".show", id = e.id) }}">{{group.description}} {% if e.description %}({{e.description}}) {% endif %} ({{e.expense | eur}})</a></li>
+ {% endfor %}
{% endfor %}
</ul>
{% endmacro %}
diff --git a/templates/consts/show.jinja b/templates/consts/show.jinja
index c09fc3b..5ae5319 100644
--- a/templates/consts/show.jinja
+++ b/templates/consts/show.jinja
@@ -3,12 +3,12 @@
{% set fmt="%m.%Y" %}
{% block heading %}
- Konstante Kosten
+ Konstante Kosten: {{ exp.group.description }}
{% endblock %}
{% block content %}
<ul class="arrow">
- <li><span class="heading">Beschreibung:</span> {{exp.description}}</li>
+ {% if exp.description %} <li><span class="heading">Beschreibung:</span> {{exp.description}}</li> {% endif %}
<li><span class="heading">Kategorie:</span> {{exp.category.name}}</li>
<li><span class="heading">Betrag:</span> {{exp.expense | eur}}</li>
<li><span class="heading">Betrag pro Monat:</span> {{exp.monthly | eur}}</li>