From 63a5a69c6701910c76d4753d4fd26f27500dc2fe Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lo=C3=AFc=20Gremaud?= Date: Fri, 17 Jul 2026 17:19:26 +0200 Subject: [PATCH] feat: add recap page --- templates/tracker/recap.html | 129 +++++++++++++++++++++++++++++++++++ templates/tracker/today.html | 47 ++----------- tracker/api.py | 64 ++++++++++++++++- tracker/tests.py | 66 ++++++++++++++++-- tracker/urls.py | 1 + tracker/views.py | 32 ++++++--- 6 files changed, 281 insertions(+), 58 deletions(-) create mode 100644 templates/tracker/recap.html diff --git a/templates/tracker/recap.html b/templates/tracker/recap.html new file mode 100644 index 0000000..87a7e17 --- /dev/null +++ b/templates/tracker/recap.html @@ -0,0 +1,129 @@ +{% extends "admin/base_site.html" %} + +{% block title %}Osiris — Recap{% endblock %} + +{% block extrastyle %} +{{ block.super }} + +{% endblock %} + +{% block breadcrumbs %}{% endblock %} + +{% block content %} +
+

Doses — last 14 days

+ + + + + + + + + + {% for row in recap_days %} + + + + + + {% endfor %} + +
DayGivenPulse
+ {{ row.date|date:"D j M" }} + {% if forloop.first %}today{% endif %} + + {% if row.complete %} + ✅ + {% else %} + {{ row.taken }}/{{ row.expected }} + {% endif %} + {% if row.bpm %}{{ row.bpm }}{% else %}{% endif %}
+

+ ✅ means every active dose was ticked off that day; otherwise the count given + out of expected. Tap a day to fill it in. +

+
+ +
+

Pulse — last 90 days

+ {% if chart %} + + + + + {% for point in chart.points %} + + {{ point.reading.date }} — {{ point.reading.bpm }} bpm + + {% endfor %} + {{ chart.high }} + {{ chart.low }} + +
+
Average{{ chart.average }} bpm
+
Range{{ chart.low }}–{{ chart.high }}
+
Readings{{ reading_count }}
+
+ Trend + + {% if chart.trend > 0 %}↑ +{{ chart.trend }}{% elif chart.trend < 0 %}↓ {{ chart.trend }}{% else %}→ steady{% endif %} + {% if chart.trend %}bpm/day{% endif %} + +
+
+ {% else %} +

Record the pulse on at least two days to see the graph.

+ {% endif %} +
+ +
+

Daily notes

+ {% for note in daily_notes %} +
+ + {{ note.date|date:"l j F" }} + +

{{ note.body }}

+
+ {% empty %} +

No notes yet — write one on the Today page.

+ {% endfor %} +
+ +

← Back to today

+{% endblock %} diff --git a/templates/tracker/today.html b/templates/tracker/today.html index 8a2c38c..3df2595 100644 --- a/templates/tracker/today.html +++ b/templates/tracker/today.html @@ -54,10 +54,6 @@ border: none; border-radius: 10px; cursor: pointer; background: var(--button-bg); color: var(--button-fg); } - .osiris-stats { display: flex; gap: 18px; flex-wrap: wrap; margin-top: 12px; } - .osiris-stats div { font-size: 0.85rem; color: var(--body-quiet-color); } - .osiris-stats strong { display: block; font-size: 1.15rem; color: var(--body-fg); } - .osiris-chart { width: 100%; height: auto; overflow: visible; } .osiris-empty { color: var(--body-quiet-color); font-style: italic; } {% endblock %} @@ -134,43 +130,7 @@ -
-

Pulse — last 90 days

- {% if chart %} - - - - - {% for point in chart.points %} - - {{ point.reading.date }} — {{ point.reading.bpm }} bpm - - {% endfor %} - {{ chart.high }} - {{ chart.low }} - -
-
Average{{ chart.average }} bpm
-
Range{{ chart.low }}–{{ chart.high }}
-
Readings{{ reading_count }}
-
- Trend - - {% if chart.trend > 0 %}↑ +{{ chart.trend }}{% elif chart.trend < 0 %}↓ {{ chart.trend }}{% else %}→ steady{% endif %} - {% if chart.trend %}bpm/day{% endif %} - -
-
- {% else %} -

Record the pulse on at least two days to see the graph.

- {% endif %} -
- -
+

Reminders

Checking…

@@ -200,7 +160,10 @@
-

Manage medication & history →

+

+ Recap: doses, pulse & notes →
+ Manage medication & history → +