Track five things a day for seventy-five days
The workout, the protein, the calories, the water, and three lines of gratitude. One page per day, a card of seventy-five tiles that fill by how many of the five landed, and a missed day left as a gap rather than a reset. Single Go binary with no dependencies. The log is one JSON file on a mounted volume, written atomically and never silently replaced when it fails to parse, since it is the one thing here that cannot be recreated. Auth is Traefik basic auth at the ingress; the app has no login of its own, so every POST checks Sec-Fetch-Site to stop another origin posting with those credentials. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
35
internal/web/templates/settings.html
Normal file
35
internal/web/templates/settings.html
Normal file
@@ -0,0 +1,35 @@
|
||||
{{template "head" .}}
|
||||
<main class="page page-narrow">
|
||||
|
||||
<header class="masthead">
|
||||
<div class="masthead-day">
|
||||
<p class="eyebrow">Settings</p>
|
||||
<p class="masthead-count">{{.Settings.Length}}</p>
|
||||
<p class="masthead-of">days from {{.Settings.StartDate}}</p>
|
||||
</div>
|
||||
</header>
|
||||
|
||||
{{if .Error}}<p class="alert">{{.Error}}</p>{{end}}
|
||||
{{if .Flash}}<p class="flash">{{.Flash}}</p>{{end}}
|
||||
|
||||
<form class="sheet" method="post" action="/settings">
|
||||
{{template "settings-fields" .}}
|
||||
<button class="save" type="submit">Save settings</button>
|
||||
<p class="sheet-note">Targets apply to the whole challenge, past days included. Move day 1 and every entry keeps its date but changes its number.</p>
|
||||
</form>
|
||||
|
||||
<section class="sheet">
|
||||
<h2 class="sheet-heading">Backup</h2>
|
||||
<p class="sheet-note">The log lives in one file on the server. Download a copy before you change anything you cannot retype.</p>
|
||||
<p><a class="save save-quiet" href="/export.json">Download the log</a></p>
|
||||
|
||||
<form method="post" action="/import" enctype="multipart/form-data" class="restore"
|
||||
data-confirm="Restoring replaces every day currently in the log. Continue?">
|
||||
<label for="backup">Restore from a download</label>
|
||||
<input id="backup" name="backup" type="file" accept="application/json,.json" required>
|
||||
<button class="save save-quiet" type="submit">Restore</button>
|
||||
</form>
|
||||
</section>
|
||||
|
||||
</main>
|
||||
{{template "foot" .}}
|
||||
Reference in New Issue
Block a user