fix per feedback: remove home recent-scans; admin dashboard recent-scans -> tag edit links + item column; inline tag edit gets photo upload; explicit deploy sync (no dir-rsync flakiness)

This commit is contained in:
2026-08-10 13:04:43 +10:00
parent 83d75cb29f
commit e38128c33f
3 changed files with 8 additions and 23 deletions

View File

@@ -29,12 +29,7 @@ func (a *App) Home(w http.ResponseWriter, r *http.Request) {
http.Redirect(w, r, "/t/"+pid, http.StatusFound)
return
}
recent, err := a.Queries.ListRecentScansWithTag(r.Context(), 8)
if err != nil {
// Non-fatal: home still renders without the recent list.
recent = nil
}
a.render(w, r, "index", "Home", recent, "")
a.render(w, r, "index", "Home", nil, "")
}
// PublicTag renders the unauthenticated tag page: setup prompt, return details,

View File

@@ -26,22 +26,5 @@
<a href="/what-is-this" class="hover:underline">What is this?</a> ·
<a href="/contact" class="hover:underline">Get in touch</a>
</p>
{{if .Data}}
<div class="mx-auto mt-12 max-w-2xl">
<h2 class="text-xl font-bold text-left">Recently scanned tags</h2>
<ul class="mt-3 divide-y divide-stone-200 rounded-xl border border-stone-200 bg-white shadow-sm">
{{range .Data}}
<li class="flex items-center justify-between px-4 py-3">
<a href="/t/{{.TagCode}}" class="flex items-center gap-3 hover:opacity-80">
<span class="font-mono text-xs text-stone-500">{{.TagCode}}</span>
<span class="text-sm font-medium text-stone-800">{{if .Description.Valid}}{{.Description.String}}{{else}}{{if .ItemType.Valid}}{{.ItemType.String}}{{else}}Item{{end}}{{end}}</span>
</a>
<span class="text-xs text-stone-400">{{.ScannedAt.Time.Local.Format "2 Jan 3:04 pm"}}{{if .LocationShared}} · 📍{{end}}</span>
</li>
{{end}}
</ul>
</div>
{{end}}
</div>
{{end}}

View File

@@ -30,6 +30,13 @@
<textarea name="notes" rows="1" class="mt-0.5 w-full rounded border border-stone-300 px-2 py-1">{{if .Notes.Valid}}{{.Notes.String}}{{end}}</textarea>
</div>
<div class="col-span-2 flex items-center gap-3">
{{if .PhotoUrl.Valid}}<img src="{{.PhotoUrl.String}}" alt="Photo" class="h-10 w-10 rounded object-cover">{{end}}
<form hx-encoding="multipart/form-data" hx-post="/account/tags/{{.ID}}/photo" hx-target="#account-panel" hx-swap="outerHTML" class="flex items-center gap-2">
<input type="file" name="photo" accept="image/*" class="text-xs">
<button class="rounded bg-stone-200 px-2 py-1 text-xs hover:bg-stone-300">Upload photo</button>
<span class="htmx-indicator text-xs text-stone-400">Uploading…</span>
</form>
<div class="flex-1"></div>
<label class="flex items-center gap-1.5 text-xs">
<input type="checkbox" name="sms_enabled" value="on" {{if .SmsEnabled}}checked{{end}} class="h-3.5 w-3.5">
SMS alerts