From b3203a7506c07e8ef05026088372837e601e9aeb Mon Sep 17 00:00:00 2001 From: Ryan Chen Date: Sun, 17 May 2026 08:12:09 -0400 Subject: [PATCH] Include slot claimers in the Going list MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The Going section now shows both RSVPs and people who claimed slots, deduplicated by name (case-insensitive). Claim-only people don't get a remove button—they unclaim from the slot card instead. Co-Authored-By: Claude Opus 4.6 --- handlers.go | 22 ++++++++++++++++++++++ templates/slots.html | 10 ++++++---- 2 files changed, 28 insertions(+), 4 deletions(-) diff --git a/handlers.go b/handlers.go index 62705e4..b9bf4f4 100644 --- a/handlers.go +++ b/handlers.go @@ -121,10 +121,17 @@ type SlotView struct { Pct int64 } +type GoingPerson struct { + Name string + Note string + RsvpID int64 +} + type EventPageData struct { Event db.Event Slots []SlotView Rsvps []db.Rsvp + GoingList []GoingPerson TotalGoing int64 IsAdmin bool BaseURL string @@ -180,6 +187,20 @@ func (s *Server) loadEventPage(r *http.Request, slug string, isAdmin bool) (*Eve } totalGoing += int64(len(rsvps)) + // Build deduplicated GoingList: RSVPs first, then claim-only people + var goingList []GoingPerson + seen := make(map[string]bool) + for _, r := range rsvps { + goingList = append(goingList, GoingPerson{Name: r.Name, Note: r.Note, RsvpID: r.ID}) + seen[strings.ToLower(r.Name)] = true + } + for _, c := range claims { + if !seen[strings.ToLower(c.Name)] { + goingList = append(goingList, GoingPerson{Name: c.Name}) + seen[strings.ToLower(c.Name)] = true + } + } + var descHTML template.HTML if event.Description != "" { descHTML = RenderMarkdown(event.Description) @@ -189,6 +210,7 @@ func (s *Server) loadEventPage(r *http.Request, slug string, isAdmin bool) (*Eve Event: event, Slots: slotViews, Rsvps: rsvps, + GoingList: goingList, TotalGoing: totalGoing, IsAdmin: isAdmin, BaseURL: s.baseURL, diff --git a/templates/slots.html b/templates/slots.html index bff8576..3171d5c 100644 --- a/templates/slots.html +++ b/templates/slots.html @@ -32,17 +32,19 @@ {{end}} - +
- {{if .Rsvps}} - {{range .Rsvps}} + {{if .GoingList}} + {{range .GoingList}} {{.Name}}{{if .Note}} ({{.Note}}){{end}} - + {{end}} {{end}} {{else}}