From 8a8b2417fd2ff49bd337b580d537b6ea4546487b Mon Sep 17 00:00:00 2001 From: larssand Date: Thu, 5 Nov 2026 22:21:47 +0100 Subject: [PATCH] fix(events): easy setup first in Manage; manual heats and branding folded away (1.67.2) --- CHANGELOG.md | 4 + package-lock.json | 4 +- package.json | 2 +- src/app.js | 4 + src/event_manager_view.js | 326 +++++++++++++++++++------------------- src/styles.css | 7 + 6 files changed, 184 insertions(+), 163 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 44241b4..47f27a9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,6 +8,10 @@ The application version is maintained in `package.json` and displayed in the adm No changes recorded yet. +## 1.67.2 + +- Events → Manage: the easy setup comes first (sponsor setup, or the race steps and tabs), then the list of heats. Adding a heat by hand (type, start, seeding method ...) is folded away under "Add a heat by hand (advanced)", and branding is folded at the bottom. + ## 1.67.1 - Team race: the teams can still be changed while the race runs (a wrong transponder, a broken car swapped for another): laps stay with the team, a change counts from the next passing. Locked only once the race is finished. diff --git a/package-lock.json b/package-lock.json index 2ddeb2d..07bc979 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "rc-racecore", - "version": "1.67.1", + "version": "1.67.2", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "rc-racecore", - "version": "1.67.1", + "version": "1.67.2", "hasInstallScript": true, "dependencies": { "better-sqlite3": "^12.11.1", diff --git a/package.json b/package.json index 395cf22..bae3ec8 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "rc-racecore", - "version": "1.67.1", + "version": "1.67.2", "private": true, "description": "RC RaceCore live timing and race control with AMMC ingest and SQLite persistence", "engines": { diff --git a/src/app.js b/src/app.js index 7f30251..e1d6d46 100644 --- a/src/app.js +++ b/src/app.js @@ -1860,6 +1860,8 @@ const TRANSLATIONS = { "events.bump_reserved_note": "Om bump används kan finalgeneratorn reservera platser i högre finaler redan från start.", "events.actions": "Åtgärder", "events.manage_title": "Hantera", + "events.sessions_heading": "Heat och sessioner", + "events.manual_session_add": "Lägg till heat manuellt (avancerat)", "events.wizard_hint": "Bygg upp racet i fyra steg: grunddata, deltagare, sessionsplan och bekräftelse. Finjustering sker sedan i Hantera.", "events.wizard_step_1": "Grunddata", "events.wizard_step_2": "Deltagare", @@ -3933,6 +3935,8 @@ const TRANSLATIONS = { "events.bump_reserved_note": "If bump-up is used, finals can reserve slots in upper mains from the start.", "events.actions": "Actions", "events.manage_title": "Manage", + "events.sessions_heading": "Heats and sessions", + "events.manual_session_add": "Add a heat by hand (advanced)", "events.wizard_hint": "Build the race in four steps: basics, participants, session plan and confirmation. Fine tuning happens later in Manage.", "events.wizard_step_1": "Basics", "events.wizard_step_2": "Participants", diff --git a/src/event_manager_view.js b/src/event_manager_view.js index 3537f3c..fc2b2f9 100644 --- a/src/event_manager_view.js +++ b/src/event_manager_view.js @@ -111,166 +111,7 @@ export function renderEventManagerMarkup(context) { `) .join(""); return ` -
-
-

${t("events.manage_title")}: ${escapeHtml(event.name)}

-
-
-
- - - - - - - - - -
- -
-
-

${t("events.seed_best_laps_hint")}

-

${t("events.free_practice_note")}

-

${t("events.open_practice_note")}

- -
- ${groupSessionsBySteps(sessions).map((group) => { - const title = group.step.id === "practice" ? t("events.step_practice") - : group.step.round ? t("events.step_qual_round", { round: group.step.round }) - : group.step.id === "qual" ? t("events.step_qual") - : group.step.id === "final" ? t("events.step_finals") - : getSessionTypeLabel(group.step.type); - const open = group.state !== "done" || isSessionGroupOpen(event.id, group.step.id); - return ` -
- - ${group.state === "done" ? "✓ " : group.state === "live" ? ' ' : ""}${escapeHtml(title)} - ${escapeHtml(t("events.step_count", { done: group.done, total: group.items.length }))} - - ${renderTable( - [t("table.session"), t("table.type"), t("table.duration"), t("table.start_mode"), t("table.seeding"), t("table.status"), t(event.mode === "track" ? "events.assignments" : "events.participants"), t("events.actions")], - group.items.map(({ session: s, index: sessionIndex }) => { - const assignCount = - s.mode === "track" - ? (s.assignments || []).length - : s.type === "team_race" - ? raceTeams.length - : getSessionEntrants(s).length; - return ` - - ${escapeHtml(s.name)} - ${escapeHtml(getSessionTypeLabel(s.type))} - ${s.type === "open_practice" ? t("events.open_practice_untimed") : `${s.durationMin} min`} - ${escapeHtml(getStartModeLabel(s.startMode))} - ${s.seedBestLapCount > 0 ? `${s.seedBestLapCount}` : "-"} - ${escapeHtml(getStatusLabel(s.status))} - ${assignCount || (s.mode === "track" ? t("events.na") : "-")} - - - - - -
- ⋯ -
- ${ - event.mode === "race" && normalizeStartMode(s.startMode) === "position" - ? `` - : "" - } - ${ - event.mode === "race" && ["qualification", "final"].includes(s.type) - ? ` - - - - ` - : "" - } - -
-
- - - `; - }) - )} -
`; - }).join("")} -
-
-
- -
-

${t("events.branding")}

-
- - - - - -
-
-

${t("events.branding_note")}

-
- - -
- ${branding.logoDataUrl ? `
event-logo
` : ""} -
-
+

${t("events.manage_title")}: ${escapeHtml(event.name)}

${ event.mode === "track" @@ -778,6 +619,171 @@ export function renderEventManagerMarkup(context) { : "" } +
+
+

${t("events.sessions_heading")}

+
+
+
+ ${t("events.manual_session_add")} +
+ + + + + + + + + +
+ +
+
+

${t("events.seed_best_laps_hint")}

+

${t("events.free_practice_note")}

+

${t("events.open_practice_note")}

+
+ +
+ ${groupSessionsBySteps(sessions).map((group) => { + const title = group.step.id === "practice" ? t("events.step_practice") + : group.step.round ? t("events.step_qual_round", { round: group.step.round }) + : group.step.id === "qual" ? t("events.step_qual") + : group.step.id === "final" ? t("events.step_finals") + : getSessionTypeLabel(group.step.type); + const open = group.state !== "done" || isSessionGroupOpen(event.id, group.step.id); + return ` +
+ + ${group.state === "done" ? "✓ " : group.state === "live" ? ' ' : ""}${escapeHtml(title)} + ${escapeHtml(t("events.step_count", { done: group.done, total: group.items.length }))} + + ${renderTable( + [t("table.session"), t("table.type"), t("table.duration"), t("table.start_mode"), t("table.seeding"), t("table.status"), t(event.mode === "track" ? "events.assignments" : "events.participants"), t("events.actions")], + group.items.map(({ session: s, index: sessionIndex }) => { + const assignCount = + s.mode === "track" + ? (s.assignments || []).length + : s.type === "team_race" + ? raceTeams.length + : getSessionEntrants(s).length; + return ` + + ${escapeHtml(s.name)} + ${escapeHtml(getSessionTypeLabel(s.type))} + ${s.type === "open_practice" ? t("events.open_practice_untimed") : `${s.durationMin} min`} + ${escapeHtml(getStartModeLabel(s.startMode))} + ${s.seedBestLapCount > 0 ? `${s.seedBestLapCount}` : "-"} + ${escapeHtml(getStatusLabel(s.status))} + ${assignCount || (s.mode === "track" ? t("events.na") : "-")} + + + + + +
+ ⋯ +
+ ${ + event.mode === "race" && normalizeStartMode(s.startMode) === "position" + ? `` + : "" + } + ${ + event.mode === "race" && ["qualification", "final"].includes(s.type) + ? ` + + + + ` + : "" + } + +
+
+ + + `; + }) + )} +
`; + }).join("")} +
+
+
+ + +
+

${t("events.branding")}

+
+ + + + + +
+
+

${t("events.branding_note")}

+
+ + +
+ ${branding.logoDataUrl ? `
event-logo
` : ""} +
+
+ ${ editingSession ? ` diff --git a/src/styles.css b/src/styles.css index ebb1264..cffcf59 100644 --- a/src/styles.css +++ b/src/styles.css @@ -4865,3 +4865,10 @@ details.event-group > summary { cursor: pointer; list-style: revert; } .team-setup-drivers li { display: flex; justify-content: space-between; align-items: center; gap: 8px; } .team-setup-issues { margin: 0; padding-left: 18px; color: var(--danger, #c0392b); } .team-setup-ready { color: var(--success, #2e8b57); font-weight: 600; } + +/* Events → Manage: the easy setup first; manual heats and branding folded away */ +.manage-page-head h2 { margin: 0 0 4px; } +.manual-session-add > summary, .manage-branding > summary { cursor: pointer; } +.manual-session-add > summary { font-weight: 600; padding: 4px 0; } +.manual-session-add[open] > summary { margin-bottom: 12px; } +.manage-branding > summary h3 { display: inline; }