Show previously entered prelim scores on entry list.

This commit is contained in:
Matt Young 2025-10-09 18:58:26 -05:00
parent 0e4b8acce6
commit 011900461a
2 changed files with 17 additions and 6 deletions

View File

@ -22,7 +22,9 @@ class PrelimJudgingController extends Controller
$subscores = $prelimDefinition->scoringGuide->subscores()->orderBy('display_order')->get(); $subscores = $prelimDefinition->scoringGuide->subscores()->orderBy('display_order')->get();
$published = $prelimDefinition->audition->hasFlag('seats_published'); $published = $prelimDefinition->audition->hasFlag('seats_published');
return view('judging.prelim_entry_list', compact('prelimDefinition', 'entries', 'subscores', 'published')); $prelimScoresheets = PrelimScoreSheet::where('user_id', Auth::id())->get()->keyBy('entry_id');
return view('judging.prelim_entry_list', compact('prelimDefinition', 'entries', 'subscores', 'published', 'prelimScoresheets'));
} }
public function prelimScoreEntryForm(Entry $entry) public function prelimScoreEntryForm(Entry $entry)

View File

@ -34,13 +34,22 @@
</a> </a>
@endif @endif
</x-table.td> </x-table.td>
{{-- @foreach($subscores as $subscore)--}} @foreach($subscores as $subscore)
{{-- <x-table.td class="hidden md:table-cell">--}} <x-table.td class="hidden md:table-cell">
@if($prelimScoresheets->has($entry->id))
{{ $prelimScoresheets[$entry->id]->subscores[$subscore->id]['score'] }}
@endif
{{-- @php--}} {{-- @php--}}
{{-- if( $x = Auth::user()->scoresForEntry($entry->id)) echo $x[$subscore->id]['score'];--}} {{-- dd($prelimScoresheets[$entry->id]->subscores[$subscore->id]['score']);--}}
{{-- if( $x = $prelimScoresheets[$entry->id]) echo $x[$subscore->id]['score'];--}}
{{-- @endphp--}} {{-- @endphp--}}
{{-- </x-table.td>--}} </x-table.td>
{{-- @endforeach--}} @endforeach
<x-table.td>
@if($prelimScoresheets->has($entry->id))
{{ $prelimScoresheets[$entry->id]->created_at->setTimezone('America/Chicago')->format('m/d/y H:i') }}
@endif
</x-table.td>
{{-- <x-table.td>--}} {{-- <x-table.td>--}}