auditionadmin/resources/views/tabulation/entry_score_sheet.blade.php

55 lines
2.7 KiB
PHP

<x-layout.app>
@php($oldScores = session()->get('oldScores')) {{-- TODO Need to handle if null --}}
<x-slot:page_title>Entry Score Sheet</x-slot:page_title>
<x-card.card class="mx-auto max-w-7xl">
<x-card.heading>
{{ $entry->audition->name }} #{{ $entry->draw_number }}
<x-slot:subheading>ID #{{ $entry->id }}</x-slot:subheading>
<x-slot:right_side class="text-right">
<p>{{ $entry->student->full_name() }}</p>
<p>{{ $entry->student->school->name }}</p>
</x-slot:right_side>
</x-card.heading>
<x-form.form method="POST" action="/tabulation/entries/{{ $entry->id }}">
<x-table.table>
<thead>
<tr>
<x-table.th>Judges</x-table.th>
@foreach($subscores as $subscore)
<x-table.th>
<p>{{ $subscore->name }}<span class="text-xs text-gray-500 pl-2">Max: {{ $subscore->max_score }}</span></p>
</x-table.th>
@endforeach
</tr>
</thead>
<x-table.body :sortable="false">
@foreach($judges as $judge)
<tr >
<x-table.td>{{ $judge->full_name() }}</x-table.td>
@foreach($subscores as $subscore)
<x-table.td>
<input type="number"
{{-- max="{{ $subscore->max_score }}"--}}
id="j{{ $judge->id }}ss{{ $subscore->id }}"
name="judge{{ $judge->id }}[{{ $subscore->id }}]"
class="block w-full rounded-md border-0 py-1.5 text-gray-900 shadow-sm ring-1 ring-inset ring-gray-300 placeholder:text-gray-400 focus:ring-2 focus:ring-inset focus:ring-indigo-600 sm:text-sm sm:leading-6 judge{{$judge->id}}score"
@if($oldScores) value="{{ $oldScores['judge'.$judge->id][$subscore->id] }}" @endif
>
</x-table.td>
@endforeach
<x-table.td id="judge{{ $judge->id }}total" x-text="total">
</x-table.td>
</tr>
@endforeach
</x-table.body>
</x-table.table>
<x-form.footer class="mb-3">
<x-form.button>Save Scores</x-form.button>
</x-form.footer>
</x-form.form>
</x-card.card>
</x-layout.app>