From 49fe9728e52dcf25b8b8fa2576ccc4662b1a9cbf Mon Sep 17 00:00:00 2001 From: Chaoscaot Date: Fri, 15 Mar 2024 22:41:44 +0100 Subject: [PATCH] Neues Referee zeug --- .../admin/components/FightEditPart.svelte | 8 +- src/components/admin/pages/Event.svelte | 5 + .../admin/pages/event/EventEdit.svelte | 13 ++- .../admin/pages/event/FightList.svelte | 28 +++--- .../admin/pages/event/RefereesList.svelte | 99 +++++++++++++++++++ .../event/modals/CreateFightModal.svelte | 8 +- .../pages/event/modals/FightEditModal.svelte | 6 +- .../pages/generate/GroupGenerator.svelte | 4 + src/components/repo/event.ts | 26 ++--- src/components/repo/fight.ts | 8 +- src/components/styled/SWButton.svelte | 1 + src/components/types/event.ts | 4 +- 12 files changed, 163 insertions(+), 47 deletions(-) create mode 100644 src/components/admin/pages/event/RefereesList.svelte diff --git a/src/components/admin/components/FightEditPart.svelte b/src/components/admin/components/FightEditPart.svelte index 9c99dcf..50025c3 100644 --- a/src/components/admin/components/FightEditPart.svelte +++ b/src/components/admin/components/FightEditPart.svelte @@ -29,7 +29,7 @@ export let start = ""; export let gamemode = ""; export let map = ""; - export let kampfleiter: string | undefined = ""; + export let spectatePort: string | null = null; export let group: string | null = ""; export let groupSearch = ""; @@ -115,8 +115,10 @@ disabled={customGamemode} class={customGamemode ? "cursor-not-allowed" : ""}>
- - + + + +
diff --git a/src/components/admin/pages/Event.svelte b/src/components/admin/pages/Event.svelte index ba30f28..de2ff3a 100644 --- a/src/components/admin/pages/Event.svelte +++ b/src/components/admin/pages/Event.svelte @@ -24,6 +24,7 @@ import FightList from "./event/FightList.svelte"; import TeamList from "./event/TeamList.svelte"; import {eventRepo} from "@repo/event.ts"; + import RefereesList from "@components/admin/pages/event/RefereesList.svelte"; export let params: { id: number }; @@ -54,6 +55,10 @@ Teams + + Referees + + Fights diff --git a/src/components/admin/pages/event/EventEdit.svelte b/src/components/admin/pages/event/EventEdit.svelte index be359fc..3626df4 100644 --- a/src/components/admin/pages/event/EventEdit.svelte +++ b/src/components/admin/pages/event/EventEdit.svelte @@ -39,7 +39,8 @@ let member = event.maxTeamMembers; let schemType = event.schemType; let publicOnly = event.publicSchemsOnly; - let spectateSystem = event.spectateSystem; + let addReferee: {name: string, id: number}[] = []; + let removeReferee: {name: string, id: number}[] = []; let errorOpen = false; let error: any = undefined; @@ -65,7 +66,9 @@ member !== event.maxTeamMembers || schemType != event.schemType || publicOnly !== event.publicSchemsOnly || - spectateSystem !== event.spectateSystem; + addReferee.length > 0 || + removeReferee.length > 0; + async function del() { try { @@ -87,8 +90,9 @@ name: name, publicSchemsOnly: publicOnly, schemType: schemType ?? "null", - spectateSystem: spectateSystem, - start: startDate + start: startDate, + addReferee: addReferee.map((ref) => ref.id), + removeReferee: removeReferee.map((ref) => ref.id) }; try { @@ -138,7 +142,6 @@