Skip to content

Commit

Permalink
fix(draft): ensure that draft cannot be initialized without sufficien…
Browse files Browse the repository at this point in the history
…t quota
  • Loading branch information
BastiDood committed Aug 9, 2024
1 parent 11d4749 commit 5d00c13
Showing 1 changed file with 16 additions and 15 deletions.
31 changes: 16 additions & 15 deletions app/src/routes/dashboard/(admin)/drafts/+page.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -14,26 +14,27 @@
</script>

{#if draft === null}
{#if labs.some(({ quota }) => quota <= 0)}
{#if labs.some(({ quota }) => quota > 0)}
<div class="grid grid-cols-1 gap-4 sm:grid-cols-[auto_1fr]">
<div class="prose dark:prose-invert">
<h2>Start a New Draft</h2>
<p>
Welcome to the <strong>Draft Ranking Automated Processor</strong>! There are currently no drafts
happening at the moment, but as an administrator, you have the authorization to start a new one.
</p>
<p>
To begin, simply provide the the maximum number of rounds for the upcoming draft. This has
historically been set to <strong>5</strong>.
</p>
</div>
<InitForm />
</div>
{:else}
<WarningAlert
>The total quota of all labs is currently zero. Please <a href="/dashboard/labs/" class="anchor">allocate</a
> at least one slot to a lab to proceed.</WarningAlert
>
{/if}
<div class="grid grid-cols-1 gap-4 sm:grid-cols-[auto_1fr]">
<div class="prose dark:prose-invert">
<h2>Start a New Draft</h2>
<p>
Welcome to the <strong>Draft Ranking Automated Processor</strong>! There are currently no drafts
happening at the moment, but as an administrator, you have the authorization to start a new one.
</p>
<p>
To begin, simply provide the the maximum number of rounds for the upcoming draft. This has historically
been set to <strong>5</strong>.
</p>
</div>
<InitForm />
</div>
{:else if draft.curr_round === null}
<div class="grid grid-cols-1 gap-4 md:grid-cols-[auto_1fr]">
<div class="prose dark:prose-invert">
Expand Down

0 comments on commit 5d00c13

Please sign in to comment.