diff --git a/web/src/routes/admin/scoreboard/+layout.server.ts b/web/src/routes/admin/scoreboard/+layout.server.ts
new file mode 100644
index 0000000..fe14bcc
--- /dev/null
+++ b/web/src/routes/admin/scoreboard/+layout.server.ts
@@ -0,0 +1,7 @@
+import { db } from '$lib/server/prisma';
+import type { LayoutServerLoad } from './$types';
+
+export const load = (async () => {
+ const contests = await db.contest.findMany({ select: { id: true, name: true } });
+ return { contests };
+}) satisfies LayoutServerLoad;
diff --git a/web/src/routes/admin/scoreboard/+layout.svelte b/web/src/routes/admin/scoreboard/+layout.svelte
new file mode 100644
index 0000000..e7c5e30
--- /dev/null
+++ b/web/src/routes/admin/scoreboard/+layout.svelte
@@ -0,0 +1,41 @@
+
+
+
Place | -Team Name | -Solves | -Time | - {#each contest.problems as problem} -{problem.friendlyName} | - {/each} -
---|---|---|---|---|
{i + 1} | -{team.name} | -{team.solves} | -{team.time.toFixed(0)} | - {#each contest.problems as problem} -
-
-
-
- {#if team.problems.find((p) => {
- return p.id === problem.id;
- })?.graphic !== null}
- {
- return p.id === problem.id;
- })?.graphic === 'correct'
- ? '/correct.png'
- : '/incorrect.png'}
- alt="check or X"
- width="30px"
- />
- {/if}
-
-
- {#if team.problems.find((p) => {
- return p.id === problem.id;
- })?.attempts !== 0}
- {team.problems.find((p) => {
- return p.id === problem.id;
- })?.attempts}
- {team.problems.find((p) => {
- return p.id === problem.id;
- })?.attempts === 1
- ? 'Attempt'
- : 'Attempts'}
- {#if team.problems.find((p) => { - return p.id === problem.id; - })?.min}{team.problems - .find((p) => { - return p.id === problem.id; - }) - ?.min?.toFixed(0)} min{/if} - {/if} - |
- {/each}
-
Place | +Team Name | +Solves | +Time | + {#each data.contest.problems as problem} +{problem.friendlyName} | + {/each} +
---|---|---|---|---|
{i + 1} | +{team.name} | +{team.solves} | +{team.time.toFixed(0)} | + {#each data.contest.problems as problem} +
+
+
+
+ {#if team.problems.find((p) => {
+ return p.id === problem.id;
+ })?.graphic !== null}
+ {
+ return p.id === problem.id;
+ })?.graphic === 'correct'
+ ? '/correct.png'
+ : '/incorrect.png'}
+ alt="check or X"
+ width="30px"
+ />
+ {/if}
+
+
+ {#if team.problems.find((p) => {
+ return p.id === problem.id;
+ })?.attempts !== 0}
+ {team.problems.find((p) => {
+ return p.id === problem.id;
+ })?.attempts}
+ {team.problems.find((p) => {
+ return p.id === problem.id;
+ })?.attempts === 1
+ ? 'Attempt'
+ : 'Attempts'}
+ {#if team.problems.find((p) => { + return p.id === problem.id; + })?.min}{team.problems + .find((p) => { + return p.id === problem.id; + }) + ?.min?.toFixed(0)} min{/if} + {/if} + |
+ {/each}
+