Add snapshot list

This commit is contained in:
Edgar P. Burkhart 2022-05-22 08:37:52 +02:00
parent 29484e3c02
commit a3797bb7fb
Signed by: edpibu
GPG key ID: 9833D3C5A25BD227
3 changed files with 42 additions and 15 deletions

View file

@ -10,7 +10,7 @@
<h1>Nummi</h1>
{% if transactions %}
<div id="transactions">
<div id="transactions" class="table col6">
<div class="header">
<strong class="date center">Date</strong>
<strong class="name">Nom</strong>
@ -23,7 +23,7 @@
<div class="transaction {% cycle 'w' 'g' %}">
<span class="date num center">{{ trans.date|date:"Y-m-d" }}</span>
<span class="name text"><a href="{% url 'transaction' trans.id %}">{{ trans.name }}</a></span>
<span class="value num">{% if trans.value > 0 %}+{% endif %}{{ trans.value|floatformat:"2g" }} €</span>
<span class="value num right">{% if trans.value > 0 %}+{% endif %}{{ trans.value|floatformat:"2g" }} €</span>
<span class="trader text center">{{ trans.trader|default_if_none:"" }}</span>
<span class="category text center">
{% if trans.category %}
@ -41,6 +41,22 @@
</div>
{% endif %}
{% if snapshots %}
<h2>Relevés</h2>
<div id="snapshots" class="table col2">
<div class="header">
<strong class="date center">Date</strong>
<strong class="value center">Valeur</strong>
</div>
{% for snap in snapshots %}
<div class="snapshot {% cycle 'w' 'g' %}">
<span class="date num center">{{ snap.date|date:"Y-m-d" }}</span>
<span class="value num right">{{ snap.value }} €</span>
</div>
{% endfor %}
</div>
{% endif %}
{% if categories %}
<h2>Catégories</h2>
<div id="categories">