tuxedo notes: photo upload, username/email display + confirm-email, favicon; verified owner-only edit

This commit is contained in:
2026-08-07 19:46:08 +10:00
parent f7e018cf64
commit 0ee211d156
10 changed files with 105 additions and 4 deletions

View File

@@ -4,6 +4,7 @@
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="icon" href="/static/favicon.svg" type="image/svg+xml">
<title>{{.Title}} · Where Woof !</title>
<script src="https://cdn.tailwindcss.com"></script>
<script src="https://unpkg.com/htmx.org@1.9.12"></script>
@@ -24,7 +25,10 @@
<a href="/" class="text-lg font-bold tracking-tight">🐕 Where Woof</a>
<div class="flex items-center gap-4 text-sm">
{{if .CurrentUser}}
<span class="text-stone-300">Hi, {{.CurrentUser.Name}}</span>
<div class="text-right leading-tight">
<span class="text-stone-300">Hi, {{.CurrentUser.Name}}</span>
<span class="block text-xs text-stone-500" title="Your username / email">{{.CurrentUser.Email}}</span>
</div>
<a href="/account" class="hover:underline">My Tags</a>
<form method="post" action="/logout" class="inline">
<button class="hover:underline">Log out</button>

View File

@@ -11,9 +11,13 @@
<input id="name" name="name" type="text" class="mt-1 w-full rounded border border-stone-300 px-3 py-2" required>
</div>
<div>
<label class="block text-sm font-medium" for="email">Email</label>
<label class="block text-sm font-medium" for="email">Email (your username)</label>
<input id="email" name="email" type="email" class="mt-1 w-full rounded border border-stone-300 px-3 py-2" required>
</div>
<div>
<label class="block text-sm font-medium" for="confirm_email">Confirm email</label>
<input id="confirm_email" name="confirm_email" type="email" class="mt-1 w-full rounded border border-stone-300 px-3 py-2" required>
</div>
<div>
<label class="block text-sm font-medium" for="password">Password</label>
<input id="password" name="password" type="password" class="mt-1 w-full rounded border border-stone-300 px-3 py-2" minlength="8" required>

View File

@@ -25,8 +25,15 @@
<textarea name="description" rows="3" class="mt-1 w-full rounded border border-stone-300 px-3 py-2">{{if .Data.Description.Valid}}{{.Data.Description.String}}{{end}}</textarea>
</div>
<div>
<label class="block text-sm font-medium">Photo URL</label>
<input name="photo_url" type="url" value="{{if .Data.PhotoUrl.Valid}}{{.Data.PhotoUrl.String}}{{end}}" class="mt-1 w-full rounded border border-stone-300 px-3 py-2" placeholder="https://…">
<label class="block text-sm font-medium">Photo</label>
{{if .Data.PhotoUrl.Valid}}<img src="{{.Data.PhotoUrl.String}}" alt="Current photo" class="mb-2 h-32 w-32 rounded-lg object-cover">{{end}}
<input name="photo_url" type="url" value="{{if .Data.PhotoUrl.Valid}}{{.Data.PhotoUrl.String}}{{end}}" class="mt-1 w-full rounded border border-stone-300 px-3 py-2" placeholder="https://… or upload below">
<form hx-encoding="multipart/form-data" hx-post="/account/tags/{{.Data.ID}}/photo" hx-target="#upload-area" hx-swap="innerHTML" class="mt-2 flex gap-2" id="upload-area">
<input type="file" name="photo" accept="image/*" class="text-sm">
<button type="submit" class="rounded bg-stone-200 px-3 py-1 text-xs font-medium hover:bg-stone-300">Upload</button>
<span class="htmx-indicator self-center text-xs text-stone-400">Uploading…</span>
</form>
<p class="mt-1 text-xs text-stone-500">Upload a photo, or paste a URL above.</p>
</div>
<div>
<label class="block text-sm font-medium">Phone number (shown to finders)</label>