62 lines
2.5 KiB
PHP
62 lines
2.5 KiB
PHP
<x-layout.app>
|
|
{{-- TODO A user should only be able to get this form for an entry they're actually assigned to judge--}}
|
|
|
|
@php
|
|
$oldScores = session()->get('oldScores') ?? null;
|
|
// TODO get old vote
|
|
@endphp
|
|
|
|
<x-slot:page_title>Entry Dashboard</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 numbrers only</li>
|
|
</ul>
|
|
</x-slot:subheading>
|
|
</x-card.heading>
|
|
<x-form.form metohd="POST" action="{{ route('judging.saveScoreSheet',['entry' => $entry->id]) }}">
|
|
@if($oldSheet) {{-- if there are existing sores, make this a patch request --}}
|
|
@method('PATCH')
|
|
@endif
|
|
<x-card.list.body class="mt-1">
|
|
@foreach($entry->audition->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
|
|
|
|
@if($entry->for_advancement)
|
|
@include('judging.advancement-vote-form')
|
|
@endif
|
|
</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>
|