Files
supermarket/internal/web/templates/invite.html
T
davidandClaude Opus 5.5 47a504b7b2 Phase 10, part 4: inviting users, and what admins can change
Settings → Users lists everyone with their access and status. Admins
invite people by email (a link for 7 days), as admins or as members with
modules each to view or edit; the invitation's page sets the password,
profile and emails wanted. Admins can resend or withdraw invitations,
change access, turn accounts off and on, unlock, reset two-factor, sign
someone out, and remove them; never the owner, nor themselves. Your
account gets the emails wanted and a photo.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-25 09:07:32 -07:00

29 lines
1.9 KiB
HTML

{{define "content"}}{{with .Data}}
{{if .U}}
<h1>Join {{.Company}}</h1>
<p class="lede">You're invited to Supermarket as <strong>{{.U.Email}}</strong>. Choose a password, and tell the team a little about you.</p>
{{with .Problem}}<p class="error" role="alert">{{.}}</p>{{end}}
<form class="card" method="post" action="/invite/{{.Token}}">
<input type="text" name="username" value="{{.U.Email}}" autocomplete="username" hidden>
<label>Your name <input name="name" value="{{.U.Name}}" autocomplete="name" required></label>
<label>Title <input name="title" value="{{.U.Title}}" placeholder="e.g. Content writer" autocomplete="organization-title"></label>
<label>Time zone <input name="time_zone" value="{{.U.TimeZone}}" list="zones" placeholder="e.g. Europe/Paris"></label>
<datalist id="zones">{{range .Zones}}<option value="{{.}}">{{end}}</datalist>
<label>Choose a password <input type="password" name="password" autocomplete="new-password" minlength="10" required>
<span class="help">At least 10 characters. A few unrelated words make a good one.</span></label>
<label>The same password again <input type="password" name="password2" autocomplete="new-password" minlength="10" required></label>
{{if .Emails}}<fieldset>
<legend>Emails you'd like</legend>
{{$u := .U}}{{range .Emails}}<label class="check"><input type="checkbox" name="emails" value="{{.ID}}" {{if has $u.Emails .ID}}checked{{end}}> <span>{{.Name}} <span class="help">{{.Help}}</span></span></label>{{end}}
</fieldset>{{end}}
<button type="submit">Join</button>
</form>
{{else}}
<h1>This invitation doesn't work</h1>
<section class="card">
<p>It has expired (an invitation lasts 7 days), was already used, or was withdrawn or replaced by a newer one.</p>
<p class="help">Ask whoever invited you to send it again. If you've joined already, <a href="/signin">sign in</a>.</p>
</section>
{{end}}
{{end}}{{end}}