summaryrefslogtreecommitdiff
path: root/templates/consts/show.jinja
blob: c09fc3bd04e33c9bd11dc6abe399e5f06862c2fa (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
{% extends "layout.jinja" %}
{% from "macros.jinja" import left_arrow, right_arrow %}
{% set fmt="%m.%Y" %}

{% block heading %}
    Konstante Kosten
{% endblock %}

{% block content %}
    <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 | eur}}</li>
        <li><span class="heading">Betrag pro Monat:</span> {{exp.monthly | eur}}</li>
        <li><span class="heading">Start:</span> {{exp.start | date(format=fmt)}}</li>
        <li><span class="heading">Ende:</span> {{exp.end | date(format=fmt)}}</li>
        <li><span class="heading">Zahlungsrhythmus:</span> 
        {% if exp.months == 1 %}
            monatlich
        {% elif exp.months == 6 %}
            halbjährlich
        {% elif exp.months == 12 %}
            jährlich
        {% else %}
            alle {{exp.months}} Monate
        {% endif %}
    </ul>
    <p>
        <a href="{{ url_for(".edit", id = exp.id) }}">Bearbeiten</a>&nbsp;
        <a href="{{ url_for(".add_from", other = exp.id) }}">Erstelle neuen auf dem jetzigen basierenden Eintrag</a>
    </p>
    {% if exp.prev %} {{ left_arrow(url_for(".show", id = exp.prev.id), target(exp.prev)) }} {% endif %}
    {% if exp.next %} {{ right_arrow(url_for(".show", id = exp.next.id), target(exp.next)) }} {% endif %}
{% endblock %}

{% macro target(p) -%}
    {{ p.description }} ({{ p.start | date(fmt) ~ "-" ~ p.end | date(fmt) }})<br>
    {{ p.expense | eur }}
{%- endmacro %}