Flag each event as Singles or Team Event
Investigated BCP's API for a team-size field (5-man vs 8-man, etc.) — there isn't one. The only candidate, totalPlayers / totalTeamPlayers, tracks live registration progress rather than the event's configured format, so it's unreliable for upcoming events with thin early signups (verified: "TEO-8 - All in.", an event explicitly branded as an 8-man format, currently shows 21/8 ≈ 2.6 via that ratio — would round to a wrong "3-Man Teams"). Sticking to the one field BCP does report reliably (teamEvent) rather than shipping a specific size that's sometimes confidently wrong. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01SBzcNkW7JcYipnAX6HfgmK
This commit is contained in:
@@ -131,6 +131,16 @@ function locationOf(ev) {
|
||||
return parts.length ? parts.join(", ") : (ev.formatted_address || "Location TBD");
|
||||
}
|
||||
|
||||
// BCP's only reliable format signal is the teamEvent flag. There's no
|
||||
// dedicated "team size" field — the closest candidate (totalPlayers /
|
||||
// totalTeamPlayers) reflects live registration progress, not the event's
|
||||
// configured format, so it's noisy/wrong for events with thin early
|
||||
// signups (which is most upcoming events). Deliberately not guessing a
|
||||
// specific team size here.
|
||||
function formatOf(ev) {
|
||||
return ev.teamEvent ? "Team Event" : "Singles";
|
||||
}
|
||||
|
||||
function eventCard(ev) {
|
||||
const capacity = ev.numTickets
|
||||
? `<span class="badge badge-ghost badge-sm">${ev.checkedInPlayers ?? 0}/${ev.numTickets} checked in</span>`
|
||||
@@ -138,6 +148,7 @@ function eventCard(ev) {
|
||||
const system = ev.gameSystemName
|
||||
? `<span class="badge badge-outline badge-sm">${esc(ev.gameSystemName)}</span>`
|
||||
: "";
|
||||
const format = `<span class="badge badge-warning badge-sm">${formatOf(ev)}</span>`;
|
||||
return `
|
||||
<a href="${BCP_ORIGIN}/event/${esc(ev.id)}" target="_blank" rel="noopener"
|
||||
class="card card-border bg-base-200 hover:border-warning transition-colors">
|
||||
@@ -145,7 +156,7 @@ function eventCard(ev) {
|
||||
<div class="min-w-0">
|
||||
<div class="font-semibold truncate">${esc(ev.name)}</div>
|
||||
<div class="text-sm opacity-60 mt-1">${esc(locationOf(ev))}</div>
|
||||
<div class="flex gap-2 mt-2">${system}${capacity}</div>
|
||||
<div class="flex gap-2 mt-2">${format}${system}${capacity}</div>
|
||||
</div>
|
||||
<div class="text-right shrink-0">
|
||||
<div class="font-mono text-sm text-warning">${fmtDateRange(ev.eventDate, ev.eventEndDate)}</div>
|
||||
|
||||
Reference in New Issue
Block a user