Enhance EventFight handling by adding conditional relation names and improving group button visibility
Some checks failed
SteamWarCI Build failed
Some checks failed
SteamWarCI Build failed
This commit is contained in:
@ -21,15 +21,13 @@
|
||||
import type { RouteDefinition } from "svelte-spa-router";
|
||||
import Router from "svelte-spa-router";
|
||||
import NavLinks from "@components/moderator/layout/NavLinks.svelte";
|
||||
import { Switch } from "@components/ui/switch";
|
||||
import { Label } from "@components/ui/label";
|
||||
import { navigate } from "astro:transitions/client";
|
||||
import Players from "@components/moderator/pages/players/Players.svelte";
|
||||
import Events from "@components/moderator/pages/events/Events.svelte";
|
||||
import Dashboard from "@components/moderator/pages/dashboard/Dashboard.svelte";
|
||||
import Event from "@components/moderator/pages/event/Event.svelte";
|
||||
import Pages from "@components/moderator/pages/pages/Pages.svelte";
|
||||
import Generator from "@components/moderator/pages/generators/Generator.svelte";
|
||||
import Schematics from "@components/moderator/pages/schems/Schematics.svelte";
|
||||
import { Tooltip } from "bits-ui";
|
||||
|
||||
const routes: RouteDefinition = {
|
||||
@ -39,6 +37,7 @@
|
||||
"/event/:id": Event,
|
||||
"/event/:id/generate": Generator,
|
||||
"/pages": Pages,
|
||||
"/schems": Schematics,
|
||||
};
|
||||
</script>
|
||||
|
||||
@ -47,10 +46,6 @@
|
||||
<div class="flex h-16 items-center px-4">
|
||||
<a href="/" class="text-sm font-bold transition-colors text-primary"> SteamWar </a>
|
||||
<NavLinks />
|
||||
<div class="ml-auto flex items-center space-x-4">
|
||||
<Switch id="new-ui-switch" checked={true} onclick={() => navigate("/admin")} />
|
||||
<Label for="new-ui-switch">New UI!</Label>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
@ -258,12 +258,14 @@
|
||||
{group?.name ?? "Keine Gruppe"}
|
||||
</TableCell>
|
||||
<TableCell class="text-right">
|
||||
<Button variant="ghost" size="icon" onclick={() => openGroupEditDialog(group!)}>
|
||||
<EditIcon />
|
||||
</Button>
|
||||
<Button variant="ghost" size="icon" onclick={() => openGroupResultsDialog(group!)}>
|
||||
<GroupIcon />
|
||||
</Button>
|
||||
{#if group}
|
||||
<Button variant="ghost" size="icon" onclick={() => openGroupEditDialog(group!)}>
|
||||
<EditIcon />
|
||||
</Button>
|
||||
<Button variant="ghost" size="icon" onclick={() => openGroupResultsDialog(group!)}>
|
||||
<GroupIcon />
|
||||
</Button>
|
||||
{/if}
|
||||
<DropdownMenu>
|
||||
<DropdownMenuTrigger>
|
||||
<Button variant="ghost" size="icon">
|
||||
|
||||
@ -26,8 +26,8 @@ export class EventModel {
|
||||
return v.map((fight) => {
|
||||
let f = JSON.parse(JSON.stringify(fight)) as EventFight;
|
||||
|
||||
let blueTeamRelation = f.blueTeam.name;
|
||||
let redTeamRelation = f.redTeam.name;
|
||||
let blueTeamRelation = "";
|
||||
let redTeamRelation = "";
|
||||
|
||||
let relations = rels.filter((relation) => relation.fight === f.id);
|
||||
|
||||
@ -54,11 +54,11 @@ export class EventModel {
|
||||
...f,
|
||||
blueTeam: {
|
||||
...f.blueTeam,
|
||||
nameWithRelation: `${f.blueTeam.name} (${blueTeamRelation})`,
|
||||
nameWithRelation: blueTeamRelation ? `${f.blueTeam.name} (${blueTeamRelation})` : f.blueTeam.name,
|
||||
},
|
||||
redTeam: {
|
||||
...f.redTeam,
|
||||
nameWithRelation: `${f.redTeam.name} (${redTeamRelation})`,
|
||||
nameWithRelation: redTeamRelation ? `${f.redTeam.name} (${redTeamRelation})` : f.redTeam.name,
|
||||
},
|
||||
};
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user