Release / build-and-push (push) Successful in 3m31s
templ does not interpolate { expr } inside quoted attribute values — the
braces ship as literal text (AGENTS.md gotcha #1). Swept every templ
source for the pattern and fixed all of it:
Body theme classes: 22 page bodies rendered class="theme-{ user.Theme }"
literally, so every page first-painted the :root default (Tokyo Night)
and flashed when main.js applied the real theme. All now render
class={ "theme-" + user.Theme } server-side.
Attribute interpolations (26 across 8 files):
- api_explorer: initAPIExplorerDoc path/body/response and the Copy
Request/Response buttons (invalid JS, silently dead)
- collections: book-selection :checked/@change/@click ids and four
hx-get search URLs (collection_id={ collection.ID })
- conflicts: Resolve button id
- devices: Kobo sync-url/auth-token element ids (copy lookups only
worked because the id and the lookup were the same literal)
- unlinked_books: search-matches/manual-link clicks and container ids
- queue: status/priority badge classes never matched their CSS
- dashboard: Restore-section tooltip text
- collection_rules/collections: collection icon color
Free text goes through the new templates.JSONArg (json.Marshal) —
templ.JSONString in this templ version returns (string, error) and
cannot compose in attribute expressions; uuids via device.ID.String().
Includes regen-only drift from running templ generate (error-path
normalization) on files with no source change.
50 lines
1.9 KiB
Templ
50 lines
1.9 KiB
Templ
package templates
|
|
|
|
templ Profile(user User) {
|
|
<!DOCTYPE html>
|
|
<html lang="en">
|
|
<head>
|
|
<meta charset="UTF-8"/>
|
|
<meta name="viewport" content="width=device-width, initial-scale=1.0"/>
|
|
<title>Profile Settings - Bookhoard</title>
|
|
<script src="/static/htmx.min.js"></script>
|
|
<link href="/static/style.css" rel="stylesheet"/>
|
|
<link rel="icon" type="image/svg+xml" href="/static/favicon.svg"/>
|
|
</head>
|
|
<body class={ "theme-" + user.Theme } x-data="profile">
|
|
@Header(user, "/profile")
|
|
<main class="mx-auto max-w-4xl px-4 sm:px-6 lg:px-8 py-8">
|
|
<div class="mb-8 flex items-center gap-3">
|
|
<span class="grid place-items-center h-10 w-10 rounded-xl shrink-0" style="background-color: var(--accent-muted); color: var(--accent);">
|
|
@Icon("user", "h-5 w-5")
|
|
</span>
|
|
<div>
|
|
<h1 class="text-2xl font-bold tracking-tight" style="color: var(--text-primary)">Profile Settings</h1>
|
|
<p class="text-sm mt-0.5" style="color: var(--text-secondary)">Manage your account information and preferences</p>
|
|
</div>
|
|
</div>
|
|
<div class="space-y-6">
|
|
<div class="card p-6">
|
|
@ProfileForm(user, "/api/auth/profile", true, false, false)
|
|
</div>
|
|
<div class="card p-6">
|
|
<div class="flex items-start gap-3 mb-4">
|
|
<span class="grid place-items-center h-10 w-10 rounded-xl shrink-0" style="background-color: color-mix(in srgb, var(--status-danger) 18%, transparent); color: var(--status-danger);">
|
|
@Icon("alert", "h-5 w-5")
|
|
</span>
|
|
<div>
|
|
<h3 class="text-lg font-semibold" style="color: var(--text-primary)">Danger Zone</h3>
|
|
<p class="text-sm mt-0.5" style="color: var(--text-secondary)">Once you delete your account, there is no going back. Please be certain.</p>
|
|
</div>
|
|
</div>
|
|
<button @click="confirmDeleteAccount()" class="btn btn-danger">
|
|
@Icon("trash", "h-4 w-4")
|
|
Remove My Account
|
|
</button>
|
|
</div>
|
|
</div>
|
|
</main>
|
|
</body>
|
|
</html>
|
|
}
|