summaryrefslogtreecommitdiff
path: root/templates/consts/list.jinja
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--templates/consts/list.jinja10
1 files changed, 6 insertions, 4 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 %}