fitness-web/app/templates/dashboard.html
Jacob Hinkle 0b67939a53 Fix chat UI, add weekly plan view to dashboard
- Chat: textarea instead of single-line input, compact send button
- Chat: show status messages and better error handling
- Dashboard: new 'This Week' section showing planned workouts
- Chat: Enter sends, Shift+Enter adds newline
2026-06-29 10:57:49 -04:00

96 lines
2.8 KiB
HTML

{% extends "base.html" %}
{% block title %}Dashboard{% endblock %}
{% block content %}
<h1>Welcome, {{ user.display_name or user.username }}</h1>
<div class="grid">
<article>
<h3>Weight</h3>
<p style="font-size: 2rem;">{{ user.weight_lb or '—' }} lb</p>
</article>
<article>
<h3>Calorie Goal</h3>
<p style="font-size: 2rem;">{{ user.calorie_goal or '—' }}</p>
</article>
<article>
<h3>Step Goal</h3>
<p style="font-size: 2rem;">{{ user.step_goal or '—' }}</p>
</article>
</div>
{% if current_phase %}
<article>
<h3>Current Phase: {{ current_phase.name }}</h3>
<p>{{ current_phase.description }}</p>
{% if current_phase.notes %}<p><em>{{ current_phase.notes }}</em></p>{% endif %}
{% if current_phase.start_date %}<small>Started {{ current_phase.start_date }}</small>{% endif %}
</article>
{% endif %}
<h2>This Week ({{ week_start }} — {{ week_end }})</h2>
{% if this_week %}
<table>
<thead>
<tr>
<th>Day</th>
<th>Name</th>
<th>Status</th>
<th></th>
</tr>
</thead>
<tbody>
{% for w in this_week %}
<tr>
<td>{{ w.date }}</td>
<td>{{ w.name }}</td>
<td>{{ w.status }}</td>
<td><a href="/workouts/{{ w.id }}">View</a></td>
</tr>
{% endfor %}
</tbody>
</table>
{% else %}
<p>No workouts planned this week. Ask the <a href="/chat">AI Coach</a> to plan your week.</p>
{% endif %}
{% if latest_checkin %}
<article>
<h3>Latest Morning Check-in</h3>
<p>{{ latest_checkin.date }} — {{ latest_checkin.feeling or 'No feeling recorded' }}</p>
<p>Weight: {{ latest_checkin.weight_lb or '—' }} lb | Calories <small>(yesterday)</small>: {{ latest_checkin.calories or '—' }} | Steps <small>(yesterday)</small>: {{ latest_checkin.steps or '—' }} | Sleep: {{ latest_checkin.sleep_hours or '—' }}h</p>
</article>
{% endif %}
<h2>Past Workouts</h2>
{% if recent_workouts %}
<table>
<thead>
<tr>
<th>Date</th>
<th>Name</th>
<th>Status</th>
<th></th>
</tr>
</thead>
<tbody>
{% for w in recent_workouts %}
<tr>
<td>{{ w.date }}</td>
<td>{{ w.name }}</td>
<td>{{ w.status }}</td>
<td><a href="/workouts/{{ w.id }}">View</a></td>
</tr>
{% endfor %}
</tbody>
</table>
{% else %}
<p>No workouts yet. Ask the <a href="/chat">AI Coach</a> to plan one.</p>
{% endif %}
<div class="grid">
<a href="/chat" role="button" class="secondary">AI Coach</a>
<a href="/workouts" role="button" class="secondary">All Workouts</a>
<a href="/checkins" role="button" class="secondary">All Check-ins</a>
</div>
{% endblock %}