diff --git a/web/src/routes/admin/contests/[contestId]/+page.svelte b/web/src/routes/admin/contests/[contestId]/+page.svelte index 682fcd6..d94f3ed 100644 --- a/web/src/routes/admin/contests/[contestId]/+page.svelte +++ b/web/src/routes/admin/contests/[contestId]/+page.svelte @@ -8,6 +8,17 @@ export let data: PageData; let confirmModal: ConfirmModal; + + function enhanceConfirm(form: HTMLFormElement, text: string) { + enhance(form, async ({ cancel }) => { + if ((await confirmModal.prompt(text)) !== true) { + cancel(); + } + return async ({ update }) => { + await update(); + }; + }); + } @@ -29,25 +40,41 @@ All Contests
-
{ - if ((await confirmModal.prompt('Are you sure?')) !== true) { - cancel(); - } - return async ({ update }) => { - await update(); - }; - }} - > - {#if data.activeTeams === 0} - - - - {:else} - - {/if} -
+ {#if data.activeTeams === 0} +
+ +
+
+ +
+
+ +
+ {:else} +
+ +
+ {/if}