Files
plumber/templates/profile.html
T
codegirl007 7412069ca6 Add nested posts UI (#5)
## Summary
- Cut hunt, question, submission, voting, hiding, and profile flows over to unified posts
- Render nested replies with permission-aware inline Reply/Edit controls and edited markers
- Add post profile queries and the author index migration they depend on

Co-authored-by: codegirl-007 <s.raide@gmail.com>
2026-08-27 15:53:01 +00:00

62 lines
2.3 KiB
HTML
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
{{define "profile"}}
{{template "header" .}}
<main id="main" class="wrap profile-page">
<p class="eyebrow">Account</p>
<h1>Profile</h1>
{{if .Error}}<p class="banner error" role="alert">{{.Error}}</p>{{end}}
<form class="profile-form" method="post" action="/profile" enctype="multipart/form-data">
<input type="hidden" name="_csrf" value="{{.CSRF}}">
<div class="profile-avatar">
{{if .User.AvatarURL}}
<img class="avatar" src="{{.User.AvatarURL}}" alt="" width="96" height="96">
{{else}}
<div class="avatar avatar-empty" aria-hidden="true">{{slice .User.Username 0 1}}</div>
{{end}}
<div class="avatar-fields">
<label for="avatar">Profile picture</label>
{{if .UploadsEnabled}}
<input id="avatar" name="avatar" type="file" accept="image/jpeg,image/png,image/webp,.jpg,.jpeg,.png,.webp">
<p class="hint">JPEG, PNG, or WebP · max 2MB</p>
{{else}}
<p class="hint">Avatar uploads are not configured on this server.</p>
{{end}}
</div>
</div>
<label for="email">Email</label>
<input id="email" name="email" type="email" required maxlength="254" autocomplete="email" value="{{.EmailVal}}">
<p class="hint">Required. Well email you when a plumber answers your question.</p>
<label for="state">State</label>
<select id="state" name="state">
<option value=""{{if eq .StateVal ""}} selected{{end}}>Prefer not to say</option>
{{range .States}}
<option value="{{.Code}}"{{if eq $.StateVal .Code}} selected{{end}}>{{.Name}}</option>
{{end}}
</select>
<p class="hint">Optional. Sharing your state helps answers line up with local plumbing codes.</p>
<button type="submit" class="btn btn-primary">Save profile</button>
</form>
<section class="profile-questions" aria-labelledby="profile-q-heading">
<h2 id="profile-q-heading">{{.QuestionsLabel}}</h2>
{{if .Posts}}
<ul class="profile-q-list">
{{range .Posts}}
<li>
<a href="/questions/{{.ID}}">{{.Title}}</a>
<span class="meta">{{.PostDate}}</span>
</li>
{{end}}
</ul>
{{else}}
<p class="muted">Nothing here yet.</p>
{{end}}
</section>
</main>
{{template "footer" .}}
{{end}}