Files
bookhoard/templates/profile.templ
T
John O'Keefe 300866ca67 fix(web): viewport meta on all admin/profile pages; admin users page reworked for mobile
- The desktop-on-Android bug: 8 page templates (admin, admin_settings,
  admin_users, admin_library, admin_archived, admin_hash_conflicts,
  admin_processing_issues, profile) lacked the viewport meta, so mobile
  browsers fell back to a ~980px layout viewport and rendered the
  desktop layout. Added the same meta the other 21 pages already had —
  partials without a head were skipped deliberately.
- Admin Users page: the create-user form no longer dominates the page —
  it is hidden behind an explicit '+ Create User' button (Alpine
  x-show/x-cloak, the site-wide convention) with a Close control.
- The user list is responsive: table on md+, stacked per-user cards
  below. Role/delete controls are shared partials with DOM-id suffixes
  so both renderings keep unique swap targets (last-admin protections
  preserved in both).
2026-10-13 12:24:12 -04:00

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>
}