enhanced uploader

This commit is contained in:
Joren de Graaf
2026-10-02 15:48:06 +02:00
parent 943dc2280f
commit 184e9d18f3
16 changed files with 532 additions and 43 deletions
+5 -1
View File
@@ -12,14 +12,17 @@
<div class="app-shell">
<header class="site-header">
<div class="site-header__inner">
<button class="mobile-nav-toggle" type="button" aria-label="Open menu" aria-controls="primary-navigation" aria-expanded="false" data-nav-toggle><span class="mobile-nav-toggle__bars" aria-hidden="true"><span></span><span></span><span></span></span></button>
<a class="brand" href="{% url 'planner:task-list' %}" aria-label="Tasknest home">
<span class="brand__mark" aria-hidden="true">✓</span>
<span>tasknest</span>
</a>
<nav class="primary-nav" aria-label="Primary navigation">
<nav class="primary-nav" id="primary-navigation" aria-label="Primary navigation">
<button class="mobile-nav-close" type="button" data-nav-close>Close menu <span aria-hidden="true">×</span></button>
{% if user.is_authenticated %}
<a href="{% url 'planner:task-list' %}">My tasks</a>
<a id="daily-planner-nav" class="{% if onboarding_tour.target == 'daily-planner' %}onboarding-highlight{% endif %}" href="{% url 'planner:daily-planner' %}">Daily planner</a>
<a id="health-nav" class="{% if onboarding_tour.target == 'wellbeing' %}onboarding-highlight{% endif %}" href="{% url 'planner:health' %}">Health</a>
<a id="settings-nav" class="{% if onboarding_tour.target == 'settings' %}onboarding-highlight{% endif %}" href="{% url 'planner:user-settings' %}">Settings</a>
<form method="post" action="{% url 'planner:user-settings' %}" class="theme-toggle">{% csrf_token %}<input type="hidden" name="section" value="appearance"><input type="hidden" name="next" value="{{ request.path }}">{% if user_appearance == 'dark' %}<input type="hidden" name="appearance" value="light"><button type="submit" aria-label="Use light mode" title="Use light mode"><span aria-hidden="true">☀</span><span class="sr-only">Use light mode</span></button>{% else %}<input type="hidden" name="appearance" value="dark"><button type="submit" aria-label="Use dark mode" title="Use dark mode"><span aria-hidden="true">☾</span><span class="sr-only">Use dark mode</span></button>{% endif %}</form>
<form method="post" action="{% url 'planner:logout' %}" class="nav-logout">{% csrf_token %}<button type="submit">Log out</button></form>
@@ -30,6 +33,7 @@
</nav>
</div>
</header>
<div class="mobile-nav-backdrop" data-nav-backdrop hidden></div>
<main class="page-content">
{% if messages %}{% for message in messages %}<p class="flash-message" role="status">{{ message }}</p>{% endfor %}{% endif %}
{% block content %}{% endblock %}
@@ -0,0 +1,17 @@
{% extends 'planner/base.html' %}
{% block title %}Health · Tasknest{% endblock %}
{% block content %}
<section class="hero" aria-labelledby="health-heading">
<div>
<p class="eyebrow">Personal health tracking</p>
<h1 id="health-heading">Health</h1>
<p class="hero__copy">Record symptoms and review earlier days.</p>
</div>
</section>
<div class="health-layout">
{% include 'planner/partials/neck_headache_checkin.html' %}
{% include 'planner/partials/bowel_health_checkin.html' %}
</div>
{% endblock %}
@@ -10,8 +10,8 @@
</div><div class="form-actions"><button class="button button--compact" type="submit">Save bowel check-in</button></div>
</form>
<section class="checkin-calendar" aria-labelledby="bowel-calendar-heading"><header class="checkin-calendar__header">
<a class="text-link" href="{% url 'planner:task-list' %}?bowel_date={{ bowel_previous_month|date:'Y-m-d' }}#bowel-health-checkin" hx-get="{% url 'planner:bowel-health-panel' %}?date={{ bowel_previous_month|date:'Y-m-d' }}" hx-target="#bowel-health-checkin" hx-swap="outerHTML" aria-label="Previous month">←</a><h3 id="bowel-calendar-heading">{{ bowel_selected_date|date:'F Y' }}</h3><a class="text-link" href="{% url 'planner:task-list' %}?bowel_date={{ bowel_next_month|date:'Y-m-d' }}#bowel-health-checkin" hx-get="{% url 'planner:bowel-health-panel' %}?date={{ bowel_next_month|date:'Y-m-d' }}" hx-target="#bowel-health-checkin" hx-swap="outerHTML" aria-label="Next month">→</a>
</header><div class="checkin-calendar__weekdays" aria-hidden="true"><span>Mon</span><span>Tue</span><span>Wed</span><span>Thu</span><span>Fri</span><span>Sat</span><span>Sun</span></div>
<div class="checkin-calendar__grid">{% for week in bowel_calendar_weeks %}{% for day in week %}<a class="checkin-day{% if day.is_today %} checkin-day--today{% endif %}{% if day.is_selected %} checkin-day--selected{% endif %}{% if day.is_outside_month %} checkin-day--outside{% endif %}" href="{% url 'planner:task-list' %}?bowel_date={{ day.date|date:'Y-m-d' }}#bowel-health-checkin" hx-get="{% url 'planner:bowel-health-panel' %}?date={{ day.date|date:'Y-m-d' }}" hx-target="#bowel-health-checkin" hx-swap="outerHTML" aria-label="{{ day.label }}"><span class="checkin-day__number">{{ day.date|date:'j' }}</span><span class="checkin-day__periods" aria-hidden="true">{% for period in day.periods %}<span class="checkin-day__period checkin-day__period--{{ period.level }}"><span>{{ period.short_label }}</span><strong>{% if period.score is not None %}{{ period.score }}{% else %}—{% endif %}</strong></span>{% endfor %}</span></a>{% endfor %}{% endfor %}</div>
<a class="text-link" href="{% url 'planner:health' %}?bowel_date={{ bowel_previous_month|date:'Y-m-d' }}#bowel-health-checkin" hx-get="{% url 'planner:bowel-health-panel' %}?date={{ bowel_previous_month|date:'Y-m-d' }}" hx-target="#bowel-health-checkin" hx-swap="outerHTML" aria-label="Previous month">←</a><h3 id="bowel-calendar-heading">{{ bowel_selected_date|date:'F Y' }}</h3><a class="text-link" href="{% url 'planner:health' %}?bowel_date={{ bowel_next_month|date:'Y-m-d' }}#bowel-health-checkin" hx-get="{% url 'planner:bowel-health-panel' %}?date={{ bowel_next_month|date:'Y-m-d' }}" hx-target="#bowel-health-checkin" hx-swap="outerHTML" aria-label="Next month">→</a>
</header><div class="checkin-calendar__exports" aria-label="Export bowel tracker data"><a class="button button--secondary button--compact" href="{% url 'planner:bowel-export' 'week' %}?date={{ bowel_selected_date|date:'Y-m-d' }}">Export week</a><a class="button button--secondary button--compact" href="{% url 'planner:bowel-export' 'month' %}?date={{ bowel_selected_date|date:'Y-m-d' }}">Export month</a></div><div class="checkin-calendar__weekdays" aria-hidden="true"><span>Mon</span><span>Tue</span><span>Wed</span><span>Thu</span><span>Fri</span><span>Sat</span><span>Sun</span></div>
<div class="checkin-calendar__grid">{% for week in bowel_calendar_weeks %}{% for day in week %}<a class="checkin-day{% if day.is_today %} checkin-day--today{% endif %}{% if day.is_selected %} checkin-day--selected{% endif %}{% if day.is_outside_month %} checkin-day--outside{% endif %}" href="{% url 'planner:health' %}?bowel_date={{ day.date|date:'Y-m-d' }}#bowel-health-checkin" hx-get="{% url 'planner:bowel-health-panel' %}?date={{ day.date|date:'Y-m-d' }}" hx-target="#bowel-health-checkin" hx-swap="outerHTML" aria-label="{{ day.label }}"><span class="checkin-day__number">{{ day.date|date:'j' }}</span><span class="checkin-day__periods" aria-hidden="true">{% for period in day.periods %}<span class="checkin-day__period checkin-day__period--{{ period.level }}"><span>{{ period.short_label }}</span><strong>{% if period.score is not None %}{{ period.score }}{% else %}—{% endif %}</strong></span>{% endfor %}</span></a>{% endfor %}{% endfor %}</div>
<p class="checkin-calendar__legend">M = morning · A = afternoon · E = evening · 0 = no symptoms · 10 = worst symptoms</p></section>
</section>
@@ -15,8 +15,8 @@
</header>
<nav class="checkin-tabs" role="tablist" aria-label="Wellbeing check-ins">
<a class="checkin-tabs__tab{% if check_in_active_tab == 'pain' %} is-active{% endif %}" id="pain-checkin-tab" role="tab" aria-selected="{% if check_in_active_tab == 'pain' %}true{% else %}false{% endif %}" aria-controls="pain-checkin-panel" href="{% url 'planner:task-list' %}?check_in_date={{ check_in_selected_date|date:'Y-m-d' }}&wellbeing_tab=pain" hx-get="{% url 'planner:neck-headache-checkin-panel' %}?date={{ check_in_selected_date|date:'Y-m-d' }}&tab=pain" hx-target="#neck-headache-checkin" hx-swap="outerHTML">Neck &amp; headache</a>
<a class="checkin-tabs__tab{% if check_in_active_tab == 'sleep' %} is-active{% endif %}" id="sleep-checkin-tab" role="tab" aria-selected="{% if check_in_active_tab == 'sleep' %}true{% else %}false{% endif %}" aria-controls="sleep-checkin-panel" href="{% url 'planner:task-list' %}?check_in_date={{ check_in_selected_date|date:'Y-m-d' }}&wellbeing_tab=sleep" hx-get="{% url 'planner:neck-headache-checkin-panel' %}?date={{ check_in_selected_date|date:'Y-m-d' }}&tab=sleep" hx-target="#neck-headache-checkin" hx-swap="outerHTML">Sleep</a>
<a class="checkin-tabs__tab{% if check_in_active_tab == 'pain' %} is-active{% endif %}" id="pain-checkin-tab" role="tab" aria-selected="{% if check_in_active_tab == 'pain' %}true{% else %}false{% endif %}" aria-controls="pain-checkin-panel" href="{% url 'planner:health' %}?check_in_date={{ check_in_selected_date|date:'Y-m-d' }}&wellbeing_tab=pain" hx-get="{% url 'planner:neck-headache-checkin-panel' %}?date={{ check_in_selected_date|date:'Y-m-d' }}&tab=pain" hx-target="#neck-headache-checkin" hx-swap="outerHTML">Neck &amp; headache</a>
<a class="checkin-tabs__tab{% if check_in_active_tab == 'sleep' %} is-active{% endif %}" id="sleep-checkin-tab" role="tab" aria-selected="{% if check_in_active_tab == 'sleep' %}true{% else %}false{% endif %}" aria-controls="sleep-checkin-panel" href="{% url 'planner:health' %}?check_in_date={{ check_in_selected_date|date:'Y-m-d' }}&wellbeing_tab=sleep" hx-get="{% url 'planner:neck-headache-checkin-panel' %}?date={{ check_in_selected_date|date:'Y-m-d' }}&tab=sleep" hx-target="#neck-headache-checkin" hx-swap="outerHTML">Sleep</a>
</nav>
{% if check_in_active_tab == 'pain' %}
@@ -54,10 +54,11 @@
<section class="checkin-calendar" aria-labelledby="checkin-calendar-heading">
<header class="checkin-calendar__header">
<a class="text-link" href="{% url 'planner:task-list' %}?check_in_date={{ check_in_previous_month|date:'Y-m-d' }}&wellbeing_tab={{ check_in_active_tab }}" hx-get="{% url 'planner:neck-headache-checkin-panel' %}?date={{ check_in_previous_month|date:'Y-m-d' }}&tab={{ check_in_active_tab }}" hx-target="#neck-headache-checkin" hx-swap="outerHTML" aria-label="Previous month">←</a><h3 id="checkin-calendar-heading">{{ check_in_selected_date|date:"F Y" }}</h3><a class="text-link" href="{% url 'planner:task-list' %}?check_in_date={{ check_in_next_month|date:'Y-m-d' }}&wellbeing_tab={{ check_in_active_tab }}" hx-get="{% url 'planner:neck-headache-checkin-panel' %}?date={{ check_in_next_month|date:'Y-m-d' }}&tab={{ check_in_active_tab }}" hx-target="#neck-headache-checkin" hx-swap="outerHTML" aria-label="Next month">→</a>
<a class="text-link" href="{% url 'planner:health' %}?check_in_date={{ check_in_previous_month|date:'Y-m-d' }}&wellbeing_tab={{ check_in_active_tab }}" hx-get="{% url 'planner:neck-headache-checkin-panel' %}?date={{ check_in_previous_month|date:'Y-m-d' }}&tab={{ check_in_active_tab }}" hx-target="#neck-headache-checkin" hx-swap="outerHTML" aria-label="Previous month">←</a><h3 id="checkin-calendar-heading">{{ check_in_selected_date|date:"F Y" }}</h3><a class="text-link" href="{% url 'planner:health' %}?check_in_date={{ check_in_next_month|date:'Y-m-d' }}&wellbeing_tab={{ check_in_active_tab }}" hx-get="{% url 'planner:neck-headache-checkin-panel' %}?date={{ check_in_next_month|date:'Y-m-d' }}&tab={{ check_in_active_tab }}" hx-target="#neck-headache-checkin" hx-swap="outerHTML" aria-label="Next month">→</a>
</header>
<div class="checkin-calendar__exports" aria-label="Export pain tracker data"><a class="button button--secondary button--compact" href="{% url 'planner:pain-export' 'week' %}?date={{ check_in_selected_date|date:'Y-m-d' }}">Export week</a><a class="button button--secondary button--compact" href="{% url 'planner:pain-export' 'month' %}?date={{ check_in_selected_date|date:'Y-m-d' }}">Export month</a></div>
<div class="checkin-calendar__weekdays" aria-hidden="true"><span>Mon</span><span>Tue</span><span>Wed</span><span>Thu</span><span>Fri</span><span>Sat</span><span>Sun</span></div>
<div class="checkin-calendar__grid">{% for week in check_in_calendar_weeks %}{% for day in week %}<a class="checkin-day{% if day.is_today %} checkin-day--today{% endif %}{% if day.is_selected %} checkin-day--selected{% endif %}{% if day.is_outside_month %} checkin-day--outside{% endif %}" href='{% url "planner:task-list" %}?check_in_date={{ day.date|date:"Y-m-d" }}&wellbeing_tab={{ check_in_active_tab }}' hx-get='{% url "planner:neck-headache-checkin-panel" %}?date={{ day.date|date:"Y-m-d" }}&tab={{ check_in_active_tab }}' hx-target="#neck-headache-checkin" hx-swap="outerHTML" aria-label="{{ day.label }}"><span class="checkin-day__number">{{ day.date|date:"j" }}</span><span class="checkin-day__periods" aria-hidden="true">{% for period in day.periods %}<span class="checkin-day__period checkin-day__period--{{ period.level }}"><span>{{ period.short_label }}</span><strong>{% if period.score is not None %}{{ period.score }}{% else %}—{% endif %}</strong></span>{% endfor %}</span>{% if day.check_in and day.check_in.had_physiotherapy %}<span class="checkin-day__physio" aria-hidden="true">✚</span>{% endif %}{% if day.sleep_check_in %}<span class="checkin-day__sleep" aria-hidden="true">☾</span>{% endif %}</a>{% endfor %}{% endfor %}</div>
<div class="checkin-calendar__grid">{% for week in check_in_calendar_weeks %}{% for day in week %}<a class="checkin-day{% if day.is_today %} checkin-day--today{% endif %}{% if day.is_selected %} checkin-day--selected{% endif %}{% if day.is_outside_month %} checkin-day--outside{% endif %}" href='{% url "planner:health" %}?check_in_date={{ day.date|date:"Y-m-d" }}&wellbeing_tab={{ check_in_active_tab }}' hx-get='{% url "planner:neck-headache-checkin-panel" %}?date={{ day.date|date:"Y-m-d" }}&tab={{ check_in_active_tab }}' hx-target="#neck-headache-checkin" hx-swap="outerHTML" aria-label="{{ day.label }}"><span class="checkin-day__number">{{ day.date|date:"j" }}</span><span class="checkin-day__periods" aria-hidden="true">{% for period in day.periods %}<span class="checkin-day__period checkin-day__period--{{ period.level }}"><span>{{ period.short_label }}</span><strong>{% if period.score is not None %}{{ period.score }}{% else %}—{% endif %}</strong></span>{% endfor %}</span>{% if day.check_in and day.check_in.had_physiotherapy %}<span class="checkin-day__physio" aria-hidden="true">✚</span>{% endif %}{% if day.sleep_check_in %}<span class="checkin-day__sleep" aria-hidden="true">☾</span>{% endif %}</a>{% endfor %}{% endfor %}</div>
<p class="checkin-calendar__legend"><span><i class="checkin-legend checkin-legend--unrecorded"></i> Unrecorded period</span><span><i class="checkin-legend checkin-legend--zero"></i> Recorded: 0</span><span>Three bands: morning, afternoon, evening</span><span><i class="checkin-legend checkin-legend--sleep">☾</i> Sleep check-in</span></p>
</section>
@@ -18,15 +18,17 @@
<p class="subtask-count"><span aria-hidden="true">↳</span> {{ task.subtasks.count }} subtask{{ task.subtasks.count|pluralize }}{% if task.is_completed %} unlocked{% else %} — complete this task to unlock{% endif %}</p>
{% endif %}
<footer class="task-card__footer">
<form method="post" action="{% url 'planner:task-toggle-completed' task.pk %}" hx-post="{% url 'planner:task-toggle-completed' task.pk %}" hx-target="#task-{{ task.pk }}" hx-swap="outerHTML">
<form method="post" action="{% url 'planner:task-toggle-completed' task.pk %}" hx-post="{% url 'planner:task-toggle-completed' task.pk %}" hx-target="#task-list" hx-swap="innerHTML">
{% csrf_token %}
<input type="hidden" name="status" value="{{ current_filter|default:'active' }}">
<button class="{% if task.is_completed %}status-button{% else %}button button--compact{% endif %} task-completion-button" type="submit">
{% if task.is_completed %}<span class="status-button__dot" aria-hidden="true"></span>{% endif %}
{% if task.is_completed %}Completed — reopen{% else %}Mark complete{% endif %}
</button>
</form>
<form method="post" action="{% url 'planner:task-toggle-active' task.pk %}" hx-post="{% url 'planner:task-toggle-active' task.pk %}" hx-target="#task-{{ task.pk }}" hx-swap="outerHTML">
<form method="post" action="{% url 'planner:task-toggle-active' task.pk %}" hx-post="{% url 'planner:task-toggle-active' task.pk %}" hx-target="#task-list" hx-swap="innerHTML">
{% csrf_token %}
<input type="hidden" name="status" value="{{ current_filter|default:'active' }}">
<button class="status-button" type="submit" aria-label="Mark {{ task.title }} as {% if task.is_active %}inactive{% else %}active{% endif %}">
{% if task.is_active %}Active{% else %}Paused{% endif %}
</button>
@@ -1,4 +1,4 @@
<section class="weather-widget" aria-labelledby="weather-heading">
<div class="weather-widget__topline"><div><p class="eyebrow">Your forecast</p><h2 id="weather-heading">Weather</h2></div>{% if weather_forecast %}<span class="weather-widget__icon" aria-hidden="true">{{ weather_icon }}</span>{% endif %}</div>
<section class="weather-widget" aria-labelledby="{{ weather_heading_id|default:'weather-heading' }}">
<div class="weather-widget__topline"><div><p class="eyebrow">Your forecast</p><h2 id="{{ weather_heading_id|default:'weather-heading' }}">Weather</h2></div>{% if weather_forecast %}<span class="weather-widget__icon" aria-hidden="true">{{ weather_icon }}</span>{% endif %}</div>
{% if weather_forecast %}<p class="weather-widget__reading"><strong>{% if weather_forecast.temperature_max_c is not None %}{{ weather_forecast.temperature_max_c|floatformat:0 }} °C{% else %}—{% endif %}</strong> {{ weather_label }}</p><p class="weather-widget__detail">{% if weather_forecast.precipitation_probability is not None %}{{ weather_forecast.precipitation_probability|floatformat:0 }}% chance of precipitation{% else %}Daily forecast{% endif %}</p>{% elif weather_location_configured %}<p class="weather-widget__detail">Forecast temporarily unavailable. Your tasks will continue as normal.</p>{% else %}<p class="weather-widget__detail">Add a location to see weather-aware plans.</p><a class="text-link" href="{% url 'planner:user-settings' %}">Set location</a>{% endif %}
</section>
</section>
@@ -13,6 +13,8 @@
{% if onboarding_tour %}{% include 'planner/partials/onboarding_tour.html' %}{% endif %}
{% if user.is_authenticated %}<div class="mobile-weather-slot">{% include 'planner/partials/weather_widget.html' with weather_heading_id='mobile-weather-heading' %}</div>{% endif %}
<div class="home-layout">
<div class="home-main">
<section class="task-panel{% if onboarding_tour.target == 'tasks' %} onboarding-highlight{% endif %}" aria-label="Task list">
@@ -20,9 +22,9 @@
<div>
<label for="status-filter">Show</label>
<select id="status-filter" name="status">
<option value="all" {% if current_filter == 'all' %}selected{% endif %}>All tasks</option>
<option value="active" {% if current_filter == 'active' %}selected{% endif %}>Active tasks</option>
<option value="inactive" {% if current_filter == 'inactive' %}selected{% endif %}>Inactive tasks</option>
<option value="all" {% if current_filter == 'all' %}selected{% endif %}>All tasks</option>
<option value="past" {% if current_filter == 'past' %}selected{% endif %}>Past tasks</option>
</select>
</div>
<div class="task-filters__actions">
@@ -39,12 +41,10 @@
</section>
{% include 'planner/partials/workout_section.html' %}
{% include 'planner/partials/neck_headache_checkin.html' %}
{% include 'planner/partials/bowel_health_checkin.html' %}
</div>
{% if user.is_authenticated %}
<aside class="homepage-sidebar" aria-label="Personal routines">
{% include 'planner/partials/weather_widget.html' %}
<div class="desktop-weather-slot">{% include 'planner/partials/weather_widget.html' %}</div>
{% include 'planner/partials/tooth_brushing_widget.html' %}
{% include 'planner/partials/fasting_widget.html' %}
</aside>