Files
ryan cf2ef77bb0 Add yes/no RSVP answers with required login
RSVPs now carry a status ('yes'/'no'). When auth is enabled, answering
requires login for all events, not just capped ones. Answers are deduped
one per user and re-answering updates in place. A 'no' zeroes plus_one,
is excluded from Going counts and cap math, frees the person's slot
claims, and shows in a separate "Can't make it" list.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-08-26 07:59:33 -04:00

35 lines
1.4 KiB
HTML

{{define "edit-rsvp"}}
<div class="modal-backdrop" onclick="if(event.target===this)document.getElementById('edit-modal').innerHTML=''">
<div class="modal-card">
<div class="form-title">Edit RSVP</div>
<form hx-put="/e/{{.Slug}}/rsvp/{{.Rsvp.ID}}"
hx-target="#slots-container"
hx-swap="innerHTML settle:0.1s">
<div class="form-row">
<label>Your name</label>
<input type="text" name="name" value="{{.Rsvp.Name}}" required>
</div>
<div class="form-row">
<label>Coming?</label>
<select name="status">
<option value="yes" {{if ne .Rsvp.Status "no"}}selected{{end}}>Yes, I'm going</option>
<option value="no" {{if eq .Rsvp.Status "no"}}selected{{end}}>Can't make it</option>
</select>
</div>
<div class="form-row">
<label>Bringing anyone?</label>
<input type="number" name="plus_one" value="{{.Rsvp.PlusOne}}" min="0" max="10">
</div>
<div class="form-row">
<label>Note (optional)</label>
<input type="text" name="note" value="{{.Rsvp.Note}}">
</div>
<button class="btn-submit" type="submit">Save</button>
<div style="text-align:center;margin-top:12px;">
<button type="button" class="btn-cancel" onclick="document.getElementById('edit-modal').innerHTML=''">Cancel</button>
</div>
</form>
</div>
</div>
{{end}}