Fix OAuth page

This commit is contained in:
Joren de Graaf
2026-10-19 16:51:53 +02:00
parent a8418cdba7
commit 743785c2e0
54 changed files with 1794 additions and 27 deletions
@@ -0,0 +1,4 @@
/* Keep the expanded navigation inside tablet widths as sections are added. */
@media (min-width: 701px) and (max-width: 960px) {
.primary-nav { gap: 8px; font-size: .82rem; }
}
+4 -1
View File
@@ -1,4 +1,4 @@
{% load vite %}
{% load vite static %}
<!doctype html>
<html lang="en">
<head>
@@ -7,6 +7,7 @@
<meta name="description" content="A calm, focused personal task planner.">
<title>{% block title %}Tasknest{% endblock %}</title>
{% vite_asset 'src/main.js' %}
<link rel="stylesheet" href="{% static 'planner/nav_spacing.css' %}?v=1">
</head>
<body data-theme="{{ user_appearance }}">
<div class="app-shell">
@@ -23,6 +24,8 @@
<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 href="{% url 'stress:journal' %}"{% if request.resolver_match.namespace == 'stress' %} aria-current="page"{% endif %}>Stress</a>
<a href="{% url 'dreams:journal' %}"{% if request.resolver_match.namespace == 'dreams' %} aria-current="page"{% endif %}>Dreams</a>
<a href="{% url 'food:diary' %}">Food</a>
<a href="{% url 'recipes:list' %}"{% if request.resolver_match.namespace == 'recipes' %} aria-current="page"{% endif %}>Recipes</a>
<a href="{% url 'food:inventory' %}">Kitchen Inventory</a>
@@ -5,6 +5,7 @@
{% block content %}
<link rel="stylesheet" href="{% static 'planner/checkin_sections.css' %}?v=2">
<link rel="stylesheet" href="{% static 'planner/severity_scale.css' %}?v=1">
<link rel="stylesheet" href="{% static 'stress/widget.css' %}?v=3">
<section class="hero" aria-labelledby="health-heading">
<div>
<p class="eyebrow">Personal health tracking</p>
@@ -18,6 +19,7 @@
{% include 'planner/partials/bowel_health_checkin.html' %}
</div>
<aside class="health-layout__sidebar" aria-label="Health routines">
{% include 'stress/_daily_widget.html' with widget_id='health-stress-widget' return_to='health' %}
{% include 'planner/partials/fasting_widget.html' %}
{% include 'planner/partials/hydration_widget.html' %}
</aside>
@@ -42,6 +42,7 @@
<form class="checkin-form checkin-form--sleep" method="post" action="{% url 'planner:sleep-checkin-save' %}" hx-post="{% url 'planner:sleep-checkin-save' %}" hx-target="#neck-headache-checkin" hx-swap="outerHTML" novalidate>
{% csrf_token %}
<h3 class="checkin-form__heading">Sleep</h3>
<p class="sleep-dream-link">{% if selected_dream %}<a href="{% url 'dreams:detail' selected_dream.pk %}">Dream logged · {{ selected_dream.title }}</a>{% else %}<a href="{% url 'dreams:journal' %}?date={{ check_in_selected_date|date:'Y-m-d' }}">Log a dream for {{ check_in_selected_date|date:'j M Y' }}</a>{% endif %}</p>
{% if sleep_check_in_form.non_field_errors %}<div class="form-errors">{{ sleep_check_in_form.non_field_errors }}</div>{% endif %}
<div class="field{% if sleep_check_in_form.wake_up_date.errors %} field--error{% endif %}">{{ sleep_check_in_form.wake_up_date.label_tag }}{{ sleep_check_in_form.wake_up_date }}{% for error in sleep_check_in_form.wake_up_date.errors %}<p class="field-error">{{ error }}</p>{% endfor %}</div>
<details class="checkin-score-details checkin-score-details--sleep" data-checkin-summary-panel data-checkin-kind="sleep"{% if sleep_check_in_form.rested_score.errors or sleep_check_in_form.watch_sleep_score.errors or sleep_check_in_form.note.errors %} open{% endif %}><summary><span class="checkin-score-details__title">Sleep scores</span><span class="checkin-score-details__summary" data-checkin-summary>No scores recorded</span></summary><div class="checkin-score-details__sleep-fields">
@@ -1,8 +1,10 @@
{% extends 'planner/base.html' %}
{% extends 'planner/base.html' %}{% load static %}
{% block title %}My tasks · Tasknest{% endblock %}
{% block content %}
<link rel="stylesheet" href="{% static 'planner/severity_scale.css' %}?v=1">
<link rel="stylesheet" href="{% static 'stress/widget.css' %}?v=3">
<section class="hero" aria-labelledby="tasks-heading">
<div>
<p class="eyebrow">Personal planning</p>
@@ -13,7 +15,7 @@
{% 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 %}
{% if user.is_authenticated %}<div class="mobile-weather-slot">{% include 'planner/partials/weather_widget.html' with weather_heading_id='mobile-weather-heading' %}{% include 'stress/_daily_widget.html' with widget_id='mobile-stress-widget' return_to='mobile' %}</div>{% endif %}
<div class="home-layout">
<div class="home-main">
@@ -49,11 +51,12 @@
</div>
{% if user.is_authenticated %}
<aside class="homepage-sidebar" aria-label="Personal routines">
<div class="desktop-weather-slot">{% include 'planner/partials/weather_widget.html' %}</div>
<div class="desktop-weather-slot">{% include 'planner/partials/weather_widget.html' %}{% include 'stress/_daily_widget.html' with widget_id='desktop-stress-widget' return_to='home' %}</div>
{% include 'planner/partials/tooth_brushing_widget.html' %}
{% include 'planner/partials/hydration_widget.html' %}
{% include 'planner/partials/fasting_widget.html' %}
</aside>
{% endif %}
</div>
<script src="{% static 'planner/severity_scale.js' %}?v=2" defer></script>
{% endblock %}
+6
View File
@@ -24,6 +24,8 @@ from .forms import (
)
from .models import BowelHealthCheckIn, FastingPeriod, FastingSettings, NeckHeadacheCheckIn, SickDaySettings, SleepCheckIn, Task, ToothBrushing, UserSettings, Workout, WaterIntakeEntry
from .services.hydration import hydration_context
from stress.services import daily_widget_context
from dreams.models import DreamEntry
from .services.gitea_activity import activity_context
from .services.notifications import NotificationError, send_ntfy_notification
from .services.checkins import (
@@ -191,6 +193,7 @@ def check_in_context(user, selected_date=None, form=None, sleep_form=None, activ
sleep_check_in_by_date = {check_in.wake_up_date: check_in for check_in in sleep_check_ins}
selected_check_in = check_in_by_date.get(selected_date)
selected_sleep_check_in = sleep_check_in_by_date.get(selected_date)
selected_dream = DreamEntry.objects.filter(user=user, wake_up_date=selected_date).first()
if form is None:
form = NeckHeadacheCheckInForm(
@@ -248,6 +251,7 @@ def check_in_context(user, selected_date=None, form=None, sleep_form=None, activ
return {
'check_in_form': form,
'sleep_check_in_form': sleep_form,
'selected_dream': selected_dream,
'check_in_selected_date': selected_date,
'check_in_today': today,
'check_in_calendar_weeks': calendar_weeks,
@@ -521,6 +525,7 @@ class TaskListView(LoginRequiredMixin, ListView):
context.update(workout_context(self.request.user))
context.update(brushing_context(self.request.user))
context.update(hydration_context(self.request.user))
context.update(daily_widget_context(self.request.user))
context['gitea_activity_enabled'] = bool(settings.GITEA_USERNAME)
profile, _ = UserSettings.objects.get_or_create(user=self.request.user)
context['onboarding_tour'] = onboarding_context(profile)
@@ -547,6 +552,7 @@ class HealthView(LoginRequiredMixin, TemplateView):
))
context.update(fasting_widget_context(self.request.user))
context.update(hydration_context(self.request.user))
context.update(daily_widget_context(self.request.user))
return context