Add day navigation to daily log view

Updated the daily log route and template to support viewing logs for previous and next days using an offset parameter. The default redirect now points to the daily log instead of the dashboard. The daily_log.html template includes navigation buttons for moving between days.
This commit is contained in:
2025-08-07 20:49:10 +02:00
parent 4b068063ed
commit e3119a69fc
3 changed files with 33 additions and 7 deletions

View File

@@ -9,8 +9,17 @@ Food Nutritional Info
<!-- Daily Overview Section -->
<div class="container">
<div class="mb-4 p-3 border rounded">
<div class="text-center">
<div class="mb-4 p-3 border rounded d-flex align-items-center justify-content-between">
<!-- Previous Day Button -->
<form method="get" action="{{url_for('user.daily_log', offset=offset - 1)}}" class="m-0">
<button type="submit" class="btn btn-outline-primary d-flex align-items-center justify-content-center"
style="width: 40px; height: 40px;">
&laquo;
</button>
</form>
<!-- Main Content -->
<div class="flex-grow-1 text-center">
<h2>Daily Overview ({{date}})</h2>
<!-- Row 1 -->
@@ -33,9 +42,19 @@ Food Nutritional Info
</div>
</div>
</div>
<!-- Next Day Button -->
<form method="get" action="{{url_for('user.daily_log', offset=offset + 1)}}" class="m-0">
<button type="submit" class="btn btn-outline-primary d-flex align-items-center justify-content-center"
style="width: 40px; height: 40px;">
&raquo;
</button>
</form>
</div>
<div class="p-3 border rounded">
<div class="text-center">
<h2>Eaten today</h2>