Add edit RSVP modal, plus-one tracking, and unified signup form
Merge RSVP + slot claim into a single form. Add plus_one field to RSVPs. Add clickable RSVP names that open a modal to edit name/note/plus_one. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
+12
-27
@@ -51,43 +51,28 @@
|
||||
<label>Your name</label>
|
||||
<input type="text" name="name" placeholder="e.g. Sam" required value="{{if .User}}{{.User.Name}}{{end}}">
|
||||
</div>
|
||||
{{if .Slots}}
|
||||
<div class="form-row">
|
||||
<label>Note (optional)</label>
|
||||
<input type="text" name="note" placeholder="e.g. +1, arriving late, etc.">
|
||||
</div>
|
||||
<button class="btn-submit" type="submit">Count me in ↗</button>
|
||||
</form>
|
||||
</div>
|
||||
|
||||
{{if .Slots}}
|
||||
<div class="section-label" style="margin-top:40px">I'll bring something</div>
|
||||
|
||||
<div class="claim-form-wrapper">
|
||||
<div class="form-title">Claim a slot →</div>
|
||||
<form hx-post="/e/{{.Event.Slug}}/claim"
|
||||
hx-target="#slots-container"
|
||||
hx-swap="innerHTML settle:0.1s"
|
||||
hx-on::after-request="if(event.detail.successful) this.reset()">
|
||||
<div class="form-row">
|
||||
<label>Your name</label>
|
||||
<input type="text" name="name" placeholder="e.g. Sam" required value="{{if .User}}{{.User.Name}}{{end}}">
|
||||
</div>
|
||||
<div class="form-row">
|
||||
<label>Slot</label>
|
||||
<select name="slot_id">
|
||||
<label>Bringing something?</label>
|
||||
<select name="slot_id" onchange="document.getElementById('claim-note').style.display = this.value ? '' : 'none'; document.getElementById('claim-note-input').placeholder = this.value ? 'e.g. bringing sparkling water + lemonade' : 'e.g. +1, arriving late, etc.'">
|
||||
<option value="">Just myself</option>
|
||||
{{range .Slots}}{{if not .IsFull}}
|
||||
<option value="{{.Slot.ID}}">{{.Slot.Emoji}} {{.Slot.Name}} ({{$left := sub .Slot.MaxClaims .ClaimCount}}{{$left}} spot{{if ne $left 1}}s{{end}} left)</option>
|
||||
{{end}}{{end}}
|
||||
</select>
|
||||
</div>
|
||||
{{end}}
|
||||
<div class="form-row">
|
||||
<label>Note (optional)</label>
|
||||
<input type="text" name="note" placeholder="e.g. bringing sparkling water + lemonade">
|
||||
<label>Bringing anyone?</label>
|
||||
<input type="number" name="plus_one" value="0" min="0" max="10">
|
||||
</div>
|
||||
<button class="btn-submit" type="submit">Claim ↗</button>
|
||||
<div class="form-row" id="claim-note">
|
||||
<label>Note (optional)</label>
|
||||
<input type="text" id="claim-note-input" name="note" placeholder="e.g. arriving late, dietary restrictions, etc.">
|
||||
</div>
|
||||
<button class="btn-submit" type="submit">Count me in ↗</button>
|
||||
</form>
|
||||
</div>
|
||||
{{end}}
|
||||
|
||||
{{if .IsAdmin}}
|
||||
<div class="section-label" style="margin-top:40px">Admin: Description</div>
|
||||
|
||||
Reference in New Issue
Block a user