removing Player field thats specific for teams from indidiual turnaments
This commit is contained in:
parent
535c285a33
commit
06ba7fe85a
1 changed files with 90 additions and 80 deletions
|
|
@ -57,6 +57,7 @@
|
|||
type FieldValueMap = Record<string, string>;
|
||||
|
||||
const signupConfig = normalizeSignupConfig(tournament.signup_config);
|
||||
const entrySectionTitle = signupConfig.mode === 'team' ? 'Lag' : 'Spelare';
|
||||
|
||||
function formatDateTime(value: string | null) {
|
||||
if (!value) return null;
|
||||
|
|
@ -348,7 +349,7 @@
|
|||
{#if signupConfig.entry_fields.length > 0}
|
||||
<div class="space-y-3">
|
||||
<h3 class="text-sm font-semibold tracking-wide text-slate-400 uppercase">
|
||||
Lag / deltagare
|
||||
{entrySectionTitle}
|
||||
</h3>
|
||||
<div class="grid gap-3 md:grid-cols-2">
|
||||
{#each signupConfig.entry_fields as field}
|
||||
|
|
@ -468,6 +469,7 @@
|
|||
{/if}
|
||||
</section>
|
||||
|
||||
{#if signupConfig.mode === 'team'}
|
||||
<section class="space-y-3">
|
||||
<h3 class="text-base font-semibold text-slate-100">Spelare</h3>
|
||||
{#if signupConfig.participant_fields.length === 0}
|
||||
|
|
@ -484,7 +486,9 @@
|
|||
<div class="space-y-3">
|
||||
{#each signup.submittedParticipants as participant, index}
|
||||
<div class="rounded-md border border-slate-800 bg-slate-900 px-4 py-3">
|
||||
<p class="text-xs font-semibold tracking-wide text-indigo-200 uppercase">
|
||||
<p
|
||||
class="text-xs font-semibold tracking-wide text-indigo-200 uppercase"
|
||||
>
|
||||
Spelare {index + 1}
|
||||
</p>
|
||||
<ul class="mt-2 space-y-1 text-sm text-slate-100">
|
||||
|
|
@ -500,6 +504,7 @@
|
|||
</div>
|
||||
{/if}
|
||||
</section>
|
||||
{/if}
|
||||
|
||||
<div class="flex justify-center pt-2">
|
||||
<a
|
||||
|
|
@ -514,10 +519,10 @@
|
|||
{/if}
|
||||
{/if}
|
||||
|
||||
{#if signupConfig.mode === 'team'}
|
||||
<div class="space-y-3">
|
||||
<div class="flex items-center justify-between">
|
||||
<h3 class="text-sm font-semibold tracking-wide text-slate-400 uppercase">Spelare</h3>
|
||||
{#if signupConfig.mode === 'team'}
|
||||
<button
|
||||
type="button"
|
||||
onclick={addParticipant}
|
||||
|
|
@ -526,7 +531,6 @@
|
|||
>
|
||||
Lägg till spelare
|
||||
</button>
|
||||
{/if}
|
||||
</div>
|
||||
|
||||
{#if signup.participants.length > 0}
|
||||
|
|
@ -534,10 +538,10 @@
|
|||
{#each signup.participants as participant, index (index)}
|
||||
<div class="space-y-3 rounded-md border border-slate-800 bg-slate-900/60 p-4">
|
||||
<div class="flex items-center justify-between">
|
||||
<span class="text-sm font-semibold text-slate-200"
|
||||
>{participantDisplayName(index)}</span
|
||||
>
|
||||
{#if signupConfig.mode === 'team' && canRemoveParticipant()}
|
||||
<span class="text-sm font-semibold text-slate-200">
|
||||
{participantDisplayName(index)}
|
||||
</span>
|
||||
{#if canRemoveParticipant()}
|
||||
<button
|
||||
type="button"
|
||||
onclick={() => removeParticipant(index)}
|
||||
|
|
@ -575,7 +579,13 @@
|
|||
{/each}
|
||||
</div>
|
||||
{/if}
|
||||
|
||||
<p class="text-xs text-slate-400">
|
||||
Du kan lägga till upp till {signupConfig.team_size.max} spelare per lag. Minst
|
||||
{signupConfig.team_size.min} krävs.
|
||||
</p>
|
||||
</div>
|
||||
{/if}
|
||||
|
||||
<div class="space-y-2 text-sm">
|
||||
{#if signup.error}
|
||||
|
|
|
|||
Loading…
Reference in a new issue