package pages
import (
"strconv"
"atmoquest/features/common/layouts"
)
// AdminEventsView is the data for /admin/events.
type AdminEventsView struct {
PublicURL string
Events []AdminEventRow
}
// AdminEventRow is a single row in the admin event list.
type AdminEventRow struct {
URI string
Name string
Location string
StartTime string
EndTime string
ExpectedAttendees int
QRToken string
QRPublicURL string
}
templ AdminEvents(v AdminEventsView) {
@layouts.Base("admin · events", "Manage atmo.quest events.") {
@adminShell("events", "") {
}
}
}
}
// eventLinksFieldset renders the "links (up to 5)" editor, mirroring the
// profile links editor. Always renders MaxEventLinks rows so an organizer can
// add new links; populated rows are pre-filled from v.Links.
templ eventLinksFieldset(links []EventLink) {
}
// eventLinkRow renders a single label+URL row of the links editor.
templ eventLinkRow(idx int, l EventLink) {
#{ strconv.Itoa(idx + 1) }
}
// eventLinkAt returns the link at index i, or a zero EventLink if out of range.
func eventLinkAt(links []EventLink, i int) EventLink {
if i < len(links) {
return links[i]
}
return EventLink{}
}
// AdminEventBadgeView feeds the badge designer page.
type AdminEventBadgeView struct {
EventURI string
EventName string
Token string
Shapes []string
Primary []string
Accent []string
Ribbon []string
Design AdminBadgeDesign
SVGPreview string
QRPublicURL string
EventBadges []EventBadgeOverview // all badge types for this event
SelectedBadgeType string // which badge type is being edited
}
// EventBadgeOverview shows the status of a badge type for an event.
type EventBadgeOverview struct {
Slug string
Name string
Description string
Designed bool // true if a design has been saved
Label string // the label on the badge (if designed)
}
// AdminBadgeDesign is the current state of the badge being designed.
type AdminBadgeDesign struct {
Shape string
PrimaryColor string
AccentColor string
RibbonColor string
Label string
MessageTemplate string
Signature string
SigningKeyID string
}
templ AdminEventBadge(v AdminEventBadgeView) {
@layouts.Base("admin · badge designer", "Design an event badge.") {
@adminShell("events", "") {