@@ -83,7 +82,7 @@
{@const roundIndex = rounds.indexOf(round)}
{@const teams = Array.from(new Set(round.flatMap((f) => [f.redTeam, f.blueTeam])))}
-
+
{#each round as fight}
{/each}
diff --git a/src/components/event/types.ts b/src/components/event/types.ts
index 853ed25..8b0aa11 100644
--- a/src/components/event/types.ts
+++ b/src/components/event/types.ts
@@ -4,6 +4,8 @@ export const GroupViewSchema = z.object({
type: z.literal("GROUP"),
groups: z.array(z.number()),
roundRows: z.number().int().positive().optional().default(1),
+ roundGroupingTimeMinutes: z.number().int().positive().optional().default(10),
+ roundPrefix: z.enum(["Runde", "Tag"]).optional().default("Runde"),
});
export type GroupViewConfig = z.infer;
diff --git a/src/components/moderator/pages/pages/frontmatter/ViewConfigEditor.svelte b/src/components/moderator/pages/pages/frontmatter/ViewConfigEditor.svelte
index 05c325a..5b8d33a 100644
--- a/src/components/moderator/pages/pages/frontmatter/ViewConfigEditor.svelte
+++ b/src/components/moderator/pages/pages/frontmatter/ViewConfigEditor.svelte
@@ -7,10 +7,18 @@
import { Plus, Trash2 } from "lucide-svelte";
type StageType = "GROUP" | "ELEMINATION" | "DOUBLE_ELEMINATION";
+ type RoundPrefix = "Runde" | "Tag";
+ const roundGroupingTimeOptions = [
+ { label: "10 Minutes", value: 10 },
+ { label: "30 Minutes", value: 30 },
+ { label: "1 Hour", value: 60 },
+ { label: "2 Hours", value: 120 },
+ { label: "12 Hours", value: 720 },
+ ];
type StageConfig = {
name: string;
view:
- | { type: "GROUP"; groups: number[]; roundRows?: number }
+ | { type: "GROUP"; groups: number[]; roundRows?: number; roundGroupingTimeMinutes?: number; roundPrefix?: RoundPrefix }
| { type: "ELEMINATION"; finalFight: number }
| { type: "DOUBLE_ELEMINATION"; winnersFinalFight: number; losersFinalFight: number; grandFinalFight: number };
};
@@ -68,7 +76,7 @@
draft[key] = {
name: "New stage",
- view: { type: "GROUP", groups: [], roundRows: 1 },
+ view: { type: "GROUP", groups: [], roundRows: 1, roundGroupingTimeMinutes: 10, roundPrefix: "Runde" },
};
});
}
@@ -105,7 +113,7 @@
function setStageType(key: string, type: StageType, event?: ExtendedEvent) {
nextConfig((draft) => {
if (type === "GROUP") {
- draft[key].view = { type, groups: [], roundRows: 1 };
+ draft[key].view = { type, groups: [], roundRows: 1, roundGroupingTimeMinutes: 10, roundPrefix: "Runde" };
} else if (type === "ELEMINATION") {
draft[key].view = { type, finalFight: event?.fights[0]?.id ?? 0 };
} else {
@@ -139,6 +147,24 @@
});
}
+ function setRoundGroupingTimeMinutes(key: string, value: string) {
+ nextConfig((draft) => {
+ const view = draft[key].view;
+ if (view.type === "GROUP") {
+ view.roundGroupingTimeMinutes = Math.max(1, Math.floor(Number(value) || 10));
+ }
+ });
+ }
+
+ function setRoundPrefix(key: string, value: RoundPrefix) {
+ nextConfig((draft) => {
+ const view = draft[key].view;
+ if (view.type === "GROUP") {
+ view.roundPrefix = value;
+ }
+ });
+ }
+
function setFightParam(key: string, param: "finalFight" | "winnersFinalFight" | "losersFinalFight" | "grandFinalFight", fightId: string) {
nextConfig((draft) => {
const view = draft[key].view as Record;
@@ -235,6 +261,29 @@
setRoundRows(key, (event.currentTarget as HTMLInputElement).value)} />
+
+
+
+
+
+
+
+