59 lines
2.3 KiB
PHP
59 lines
2.3 KiB
PHP
<x-layout.app>
|
|
@php
|
|
$oldScores = session()->get('oldScores') ?? null;
|
|
@endphp
|
|
|
|
<x-slot:page_title>Prelim Score Entry</x-slot:page_title>
|
|
<x-card.card class="mx-auto max-w-md">
|
|
<x-card.heading>
|
|
{{ $entry->audition->name }} {{ $entry->draw_number }}
|
|
<x-slot:subheading>
|
|
<ul class="mt-.5 max-w-2xl text-sm leading-6 text-gray-500">
|
|
<li>All Scores must be complete</li>
|
|
<li>You may enter zero</li>
|
|
<li>Whole numbers only</li>
|
|
</ul>
|
|
</x-slot:subheading>
|
|
</x-card.heading>
|
|
<x-form.form method="POST" action="{{ route('judging.savePrelimScoreSheet', $entry) }}">
|
|
@if($oldSheet)
|
|
{{-- if there are existing scores, make this a patch request --}}
|
|
@method('PATCH')
|
|
@endif
|
|
<x-card.list.body class="mt-1">
|
|
@foreach($entry->audition->prelimDefinition->scoringGuide->subscores()->orderBy('display_order')->get() as $subscore)
|
|
@php
|
|
if($oldScores) {
|
|
$value = $oldScores['score'][$subscore->id];
|
|
} elseif ($oldSheet) {
|
|
$value = $oldSheet[$subscore->id]['score'];
|
|
} else {
|
|
$value = '';
|
|
}
|
|
@endphp
|
|
|
|
<li class="py-2">
|
|
|
|
<x-form.field
|
|
name="score[{{$subscore->id}}]"
|
|
type="number"
|
|
placeholder="{{$subscore->name}}"
|
|
:value="$value"
|
|
max="{{ $subscore->max_score }}"
|
|
required
|
|
>
|
|
<x-slot:label>{{ $subscore->name }} <span class="text-xs text-base text-gray-400 pl-3">max: {{$subscore->max_score}}</span></x-slot:label>
|
|
|
|
</x-form.field>
|
|
|
|
</li>
|
|
|
|
@endforeach
|
|
</x-card.list.body>
|
|
<x-form.footer>
|
|
<x-form.button class="mb-5">Save Scores</x-form.button>
|
|
</x-form.footer>
|
|
</x-form.form>
|
|
</x-card.card>
|
|
</x-layout.app>
|