Files
bbq/templates/login.html
T
ryan d005080aca Add attendee cap with required login for capped events
Hosts can optionally cap total attendance (RSVPs + plus-ones) when
creating an event. Capped events require guests to log in via the
existing email code flow; RSVPs are tied to accounts and deduped per
user. The event page shows spots left and replaces the form with a
full notice when the cap is reached; the server rejects over-cap
RSVPs and edits with 409 as a race backstop.

Also threads a safeNext-validated ?next= param through the login and
name-setup flow so guests land back on the event after signing in.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-06-10 19:36:57 -04:00

45 lines
1.6 KiB
HTML

{{template "layout" .}}
{{define "title"}}bbq — log in{{end}}
{{define "content"}}
<div class="event-header">
<div class="event-tag">Account</div>
<h1 class="event-title">Log in</h1>
<p style="font-family:'DM Mono',monospace;font-size:0.8rem;color:#555;margin-top:8px;">
Enter your email to receive a login code.
</p>
</div>
<div class="claim-form-wrapper">
{{if eq .Step "identify"}}
<form method="POST" action="/login">
{{if .Next}}<input type="hidden" name="next" value="{{.Next}}">{{end}}
<div class="form-row">
<label>Email</label>
<input type="email" name="identifier" placeholder="you@example.com" required autofocus>
</div>
<button class="btn-submit" type="submit">Send code &#8599;</button>
</form>
{{else}}
<form method="POST" action="/login/verify">
<input type="hidden" name="identifier" value="{{.Identifier}}">
{{if .Next}}<input type="hidden" name="next" value="{{.Next}}">{{end}}
<p style="font-family:'DM Mono',monospace;font-size:0.78rem;color:#555;margin-bottom:16px;">
Code sent to <strong>{{.Identifier}}</strong>
</p>
{{if .Error}}
<p style="color:#c44;font-size:0.85rem;margin-bottom:12px;">{{.Error}}</p>
{{end}}
<div class="form-row">
<label>6-digit code</label>
<input type="text" name="code" placeholder="000000" required autofocus
inputmode="numeric" pattern="[0-9]{6}" maxlength="6"
style="font-family:'DM Mono',monospace;font-size:1.5rem;letter-spacing:8px;text-align:center;">
</div>
<button class="btn-submit" type="submit">Verify &#8599;</button>
</form>
{{end}}
</div>
{{end}}