diff --git a/nummi/main/templates/main/snapshot.html b/nummi/main/templates/main/snapshot.html
index b6d60aa..54289d6 100644
--- a/nummi/main/templates/main/snapshot.html
+++ b/nummi/main/templates/main/snapshot.html
@@ -1,13 +1,25 @@
{% extends "main/base.html" %}
{% load static %}
+{% load main_extras %}
{% block link %}
{{ block.super }}
+
{% endblock %}
{% block body %}
-
{{ snapshot }}
+{% with sum=snapshot.sum %}
+
+ {% if snapshot.previous is not None %}
+ {% if sum == snapshot.diff %}
+
+ {% else %}
+
+ {% endif %}
+ {% endif %}
+ {{ snapshot }}
+
+{% if transactions %}
+Transactions ({{ sum|floatformat:"2g"|pm }} € / {{ snapshot.diff|floatformat:"2g"|pm }} €)
+
+
+
+ {% for trans in transactions %}
+
+
{{ trans.date|date:"Y-m-d" }}
+
{{ trans.name }}
+
{{ trans.value|floatformat:"2g"|pm }} €
+
{{ trans.trader|default_if_none:"–" }}
+
+ {% if trans.category %}
+
+
+ {{ trans.category }}
+
+ {% else %}
+ –
+ {% endif %}
+
+
{{ trans.description }}
+
+ {% endfor %}
+
+{% endif %}
+{% endwith %}
{% endblock %}
diff --git a/nummi/main/views.py b/nummi/main/views.py
index 0489190..724a404 100644
--- a/nummi/main/views.py
+++ b/nummi/main/views.py
@@ -120,14 +120,19 @@ def update_category(request, uuid):
def snapshot(request, date=None):
if date is None:
_snapshot = Snapshot()
+ _transactions = None
else:
_snapshot = get_object_or_404(Snapshot, date=date)
+ _transactions = Transaction.objects.filter(
+ date__lt=_snapshot.date, date__gte=_snapshot.previous.date
+ )
return render(
request,
"main/snapshot.html",
{
"snapshot": _snapshot,
"form": SnapshotForm(instance=_snapshot),
+ "transactions": _transactions,
},
)