|
|
|
@@ -7,7 +7,7 @@
|
|
|
|
|
</div>
|
|
|
|
|
{% if check_in_active_tab == 'pain' %}
|
|
|
|
|
<dl class="checkin-streaks" aria-label="Pain check-in summary">
|
|
|
|
|
<div><dt>Current <span class="checkin-tooltip" tabindex="0" aria-label="A confirmed day has both pain scores at {{ check_in_streak_threshold }} or below">ⓘ<span class="checkin-tooltip__content" role="tooltip">A confirmed day has both scores at {{ check_in_streak_threshold }} or below.</span></span></dt><dd>{{ check_in_streaks.current }} day{{ check_in_streaks.current|pluralize }}</dd></div>
|
|
|
|
|
<div><dt>Current <span class="checkin-tooltip" tabindex="0" aria-label="A confirmed day has both scores in morning, afternoon, and evening at {{ check_in_streak_threshold }} or below">ⓘ<span class="checkin-tooltip__content" role="tooltip">A confirmed day has both scores in every time period at {{ check_in_streak_threshold }} or below.</span></span></dt><dd>{{ check_in_streaks.current }} day{{ check_in_streaks.current|pluralize }}</dd></div>
|
|
|
|
|
<div><dt>Longest</dt><dd>{{ check_in_streaks.longest }} day{{ check_in_streaks.longest|pluralize }}</dd></div>
|
|
|
|
|
<div><dt>Physio sessions this year</dt><dd>{{ physio_sessions_this_year }}/{{ annual_physio_session_allowance }}</dd></div>
|
|
|
|
|
</dl>
|
|
|
|
@@ -21,15 +21,19 @@
|
|
|
|
|
|
|
|
|
|
{% if check_in_active_tab == 'pain' %}
|
|
|
|
|
<div id="pain-checkin-panel" role="tabpanel" aria-labelledby="pain-checkin-tab" tabindex="0">
|
|
|
|
|
<form class="checkin-form" method="post" action="{% url 'planner:neck-headache-checkin-save' %}" hx-post="{% url 'planner:neck-headache-checkin-save' %}" hx-target="#neck-headache-checkin" hx-swap="outerHTML" novalidate>
|
|
|
|
|
<form class="checkin-form checkin-form--pain" method="post" action='{% url "planner:neck-headache-checkin-save" %}' hx-post='{% url "planner:neck-headache-checkin-save" %}' hx-target="#neck-headache-checkin" hx-swap="outerHTML" novalidate>
|
|
|
|
|
{% csrf_token %}
|
|
|
|
|
<h3 class="checkin-form__heading">Neck & headache</h3>
|
|
|
|
|
{% if check_in_form.non_field_errors %}<div class="form-errors">{{ check_in_form.non_field_errors }}</div>{% endif %}
|
|
|
|
|
<div class="field{% if check_in_form.check_in_date.errors %} field--error{% endif %}">{{ check_in_form.check_in_date.label_tag }}{{ check_in_form.check_in_date }}{% for error in check_in_form.check_in_date.errors %}<p class="field-error">{{ error }}</p>{% endfor %}</div>
|
|
|
|
|
<div class="field{% if check_in_form.neck_pain_severity.errors %} field--error{% endif %}">{{ check_in_form.neck_pain_severity.label_tag }}{{ check_in_form.neck_pain_severity }}<small>{{ check_in_form.neck_pain_severity.help_text }}</small>{% for error in check_in_form.neck_pain_severity.errors %}<p class="field-error">{{ error }}</p>{% endfor %}</div>
|
|
|
|
|
<div class="field{% if check_in_form.headache_severity.errors %} field--error{% endif %}">{{ check_in_form.headache_severity.label_tag }}{{ check_in_form.headache_severity }}<small>{{ check_in_form.headache_severity.help_text }}</small>{% for error in check_in_form.headache_severity.errors %}<p class="field-error">{{ error }}</p>{% endfor %}</div>
|
|
|
|
|
<div class="field checkin-form__note{% if check_in_form.note.errors %} field--error{% endif %}">{{ check_in_form.note.label_tag }}{{ check_in_form.note }}{% for error in check_in_form.note.errors %}<p class="field-error">{{ error }}</p>{% endfor %}</div>
|
|
|
|
|
<div class="field checkin-form__physio"><label class="checkbox-field">{{ check_in_form.had_physiotherapy }} <span>{{ check_in_form.had_physiotherapy.label }}</span></label></div>
|
|
|
|
|
<div class="checkin-form__topline">
|
|
|
|
|
<div class="field{% if check_in_form.check_in_date.errors %} field--error{% endif %}">{{ check_in_form.check_in_date.label_tag }}{{ check_in_form.check_in_date }}{% for error in check_in_form.check_in_date.errors %}<p class="field-error">{{ error }}</p>{% endfor %}</div>
|
|
|
|
|
<div class="field checkin-form__physio"><label class="checkbox-field">{{ check_in_form.had_physiotherapy }} <span>{{ check_in_form.had_physiotherapy.label }}</span></label></div>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="checkin-periods">
|
|
|
|
|
<section class="checkin-period" aria-labelledby="morning-checkin-heading"><h4 id="morning-checkin-heading">Morning</h4><div class="checkin-period__scores"><div class="field{% if check_in_form.morning_neck_pain_severity.errors %} field--error{% endif %}">{{ check_in_form.morning_neck_pain_severity.label_tag }}{{ check_in_form.morning_neck_pain_severity }}<small>{{ check_in_form.morning_neck_pain_severity.help_text }}</small>{% for error in check_in_form.morning_neck_pain_severity.errors %}<p class="field-error">{{ error }}</p>{% endfor %}</div><div class="field{% if check_in_form.morning_headache_severity.errors %} field--error{% endif %}">{{ check_in_form.morning_headache_severity.label_tag }}{{ check_in_form.morning_headache_severity }}<small>{{ check_in_form.morning_headache_severity.help_text }}</small>{% for error in check_in_form.morning_headache_severity.errors %}<p class="field-error">{{ error }}</p>{% endfor %}</div></div><div class="field{% if check_in_form.morning_note.errors %} field--error{% endif %}">{{ check_in_form.morning_note.label_tag }}{{ check_in_form.morning_note }}{% for error in check_in_form.morning_note.errors %}<p class="field-error">{{ error }}</p>{% endfor %}</div></section>
|
|
|
|
|
<section class="checkin-period" aria-labelledby="afternoon-checkin-heading"><h4 id="afternoon-checkin-heading">Afternoon</h4><div class="checkin-period__scores"><div class="field{% if check_in_form.afternoon_neck_pain_severity.errors %} field--error{% endif %}">{{ check_in_form.afternoon_neck_pain_severity.label_tag }}{{ check_in_form.afternoon_neck_pain_severity }}<small>{{ check_in_form.afternoon_neck_pain_severity.help_text }}</small>{% for error in check_in_form.afternoon_neck_pain_severity.errors %}<p class="field-error">{{ error }}</p>{% endfor %}</div><div class="field{% if check_in_form.afternoon_headache_severity.errors %} field--error{% endif %}">{{ check_in_form.afternoon_headache_severity.label_tag }}{{ check_in_form.afternoon_headache_severity }}<small>{{ check_in_form.afternoon_headache_severity.help_text }}</small>{% for error in check_in_form.afternoon_headache_severity.errors %}<p class="field-error">{{ error }}</p>{% endfor %}</div></div><div class="field{% if check_in_form.afternoon_note.errors %} field--error{% endif %}">{{ check_in_form.afternoon_note.label_tag }}{{ check_in_form.afternoon_note }}{% for error in check_in_form.afternoon_note.errors %}<p class="field-error">{{ error }}</p>{% endfor %}</div></section>
|
|
|
|
|
<section class="checkin-period" aria-labelledby="evening-checkin-heading"><h4 id="evening-checkin-heading">Evening</h4><div class="checkin-period__scores"><div class="field{% if check_in_form.evening_neck_pain_severity.errors %} field--error{% endif %}">{{ check_in_form.evening_neck_pain_severity.label_tag }}{{ check_in_form.evening_neck_pain_severity }}<small>{{ check_in_form.evening_neck_pain_severity.help_text }}</small>{% for error in check_in_form.evening_neck_pain_severity.errors %}<p class="field-error">{{ error }}</p>{% endfor %}</div><div class="field{% if check_in_form.evening_headache_severity.errors %} field--error{% endif %}">{{ check_in_form.evening_headache_severity.label_tag }}{{ check_in_form.evening_headache_severity }}<small>{{ check_in_form.evening_headache_severity.help_text }}</small>{% for error in check_in_form.evening_headache_severity.errors %}<p class="field-error">{{ error }}</p>{% endfor %}</div></div><div class="field{% if check_in_form.evening_note.errors %} field--error{% endif %}">{{ check_in_form.evening_note.label_tag }}{{ check_in_form.evening_note }}{% for error in check_in_form.evening_note.errors %}<p class="field-error">{{ error }}</p>{% endfor %}</div></section>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="form-actions"><button class="button button--compact" type="submit">Save pain check-in</button></div>
|
|
|
|
|
</form>
|
|
|
|
|
</div>
|
|
|
|
@@ -53,8 +57,8 @@
|
|
|
|
|
<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>
|
|
|
|
|
</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 check_in_calendar_weeks %}{% for day in week %}<a class="checkin-day checkin-day--{{ day.level }}{% 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>{% if day.check_in %}<strong class="checkin-day__score">{{ day.highest_score }}</strong>{% if day.check_in.had_physiotherapy %}<span class="checkin-day__physio" aria-hidden="true">✚</span>{% endif %}{% else %}<span class="checkin-day__empty" 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> Pain unrecorded</span><span><i class="checkin-legend checkin-legend--zero"></i> Pain recorded: 0</span><span>Number = highest pain score</span><span><i class="checkin-legend checkin-legend--sleep">☾</i> Sleep check-in</span></p>
|
|
|
|
|
<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>
|
|
|
|
|
<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>
|
|
|
|
|
|
|
|
|
|
{% if check_in_active_tab == 'sleep' %}<section class="sleep-trend" aria-labelledby="sleep-trend-heading"><header><h3 id="sleep-trend-heading">Sleep scores over time</h3><p>Rested and watch scores are shown together for comparison only; neither is presented as causing a change in the other.</p></header>{% if sleep_check_in_trend %}<div class="sleep-trend__table-wrap"><table><thead><tr><th scope="col">Wake-up date</th><th scope="col">Rested</th><th scope="col">Watch</th></tr></thead><tbody>{% for sleep in sleep_check_in_trend %}<tr><th scope="row"><time datetime="{{ sleep.wake_up_date|date:'Y-m-d' }}">{{ sleep.wake_up_date|date:"j M" }}</time></th><td>{{ sleep.rested_score }}/10</td><td>{% if sleep.watch_sleep_score is not None %}{{ sleep.watch_sleep_score }}%{% else %}—{% endif %}</td></tr>{% endfor %}</tbody></table></div>{% else %}<p class="sleep-trend__empty">Save a sleep check-in to start the comparison.</p>{% endif %}</section>{% endif %}
|
|
|
|
|