Show past votes on entry list for judges

This commit is contained in:
Matt Young 2024-06-26 23:36:08 -05:00
parent 0203505f5b
commit 90aac42fb4
5 changed files with 36 additions and 3 deletions

View File

@ -30,7 +30,9 @@ class JudgingController extends Controller
$entries = Entry::where('audition_id', '=', $audition->id)->orderBy('draw_number')->with('audition')->get();
$subscores = $audition->scoringGuide->subscores()->orderBy('display_order')->get();
return view('judging.audition_entry_list', compact('audition', 'entries', 'subscores'));
$votes = JudgeAdvancementVote::where('user_id', Auth::id())->get();
return view('judging.audition_entry_list', compact('audition', 'entries', 'subscores', 'votes'));
}
public function entryScoreSheet(Entry $entry)
@ -107,7 +109,7 @@ class JudgingController extends Controller
protected function advancementVote(Request $request, Entry $entry)
{
if ($entry->for_advancement) {
if ($entry->for_advancement and auditionSetting('advanceTo')) {
$request->validate([
'advancement-vote' => ['required', 'in:yes,no,dq'],
]);

View File

@ -0,0 +1,4 @@
@props(['color' => 'currentColor'])
<svg class="w-6 h-6 text-gray-800 dark:text-white" aria-hidden="true" xmlns="http://www.w3.org/2000/svg" width="24" height="24" fill="{{ $color }}" viewBox="0 0 24 24">
<path fill-rule="evenodd" d="M8.97 14.316H5.004c-.322 0-.64-.08-.925-.232a2.022 2.022 0 0 1-.717-.645 2.108 2.108 0 0 1-.242-1.883l2.36-7.201C5.769 3.54 5.96 3 7.365 3c2.072 0 4.276.678 6.156 1.256.473.145.925.284 1.35.404h.114v9.862a25.485 25.485 0 0 0-4.238 5.514c-.197.376-.516.67-.901.83a1.74 1.74 0 0 1-1.21.048 1.79 1.79 0 0 1-.96-.757 1.867 1.867 0 0 1-.269-1.211l1.562-4.63ZM19.822 14H17V6a2 2 0 1 1 4 0v6.823c0 .65-.527 1.177-1.177 1.177Z" clip-rule="evenodd"/>
</svg>

View File

@ -0,0 +1,4 @@
@props(['color' => 'currentColor'])
<svg class="w-6 h-6 text-gray-800 dark:text-white" aria-hidden="true" xmlns="http://www.w3.org/2000/svg" width="24" height="24" fill="{{ $color }}" viewBox="0 0 24 24">
<path fill-rule="evenodd" d="M15.03 9.684h3.965c.322 0 .64.08.925.232.286.153.532.374.717.645a2.109 2.109 0 0 1 .242 1.883l-2.36 7.201c-.288.814-.48 1.355-1.884 1.355-2.072 0-4.276-.677-6.157-1.256-.472-.145-.924-.284-1.348-.404h-.115V9.478a25.485 25.485 0 0 0 4.238-5.514 1.8 1.8 0 0 1 .901-.83 1.74 1.74 0 0 1 1.21-.048c.396.13.736.397.96.757.225.36.32.788.269 1.211l-1.562 4.63ZM4.177 10H7v8a2 2 0 1 1-4 0v-6.823C3 10.527 3.527 10 4.176 10Z" clip-rule="evenodd"/>
</svg>

View File

@ -9,6 +9,9 @@
@foreach($subscores as $subscore)
<x-table.th :sortable="false">{{ $subscore->name }}</x-table.th>
@endforeach
@if(auditionSetting('advanceTo') and $audition->for_advancement)
<x-table.th>{{ auditionSetting('advanceTo') }}</x-table.th>
@endif
<x-table.th :sortable="true">Timestamp</x-table.th>
</tr>
</thead>
@ -27,6 +30,26 @@
@endphp
</x-table.td>
@endforeach
@if(auditionSetting('advanceTo') and $audition->for_advancement)
<x-table.td>
@if($votes->contains('entry_id', $entry->id))
@php
$vote = $votes->where('entry_id',$entry->id)->first();
@endphp
@switch($vote->vote)
@case('yes')
<x-icons.thumbs-up color="green"/>
@break
@case('no')
<x-icons.thumbs-down color="red"/>
@break
@case('dq')
<x-icons.circle-slash-no color="red"/>
@break
@endswitch
@endif
</x-table.td>
@endif
<x-table.td>
{{ Auth::user()->timeForEntryScores($entry->id)?->setTimezone('America/Chicago')->format('m/d/y H:i') }}
</x-table.td>

View File

@ -50,7 +50,7 @@
</li>
@endforeach
@if($entry->for_advancement)
@if($entry->for_advancement AND auditionSetting('advanceTo'))
@include('judging.advancement-vote-form')
@endif
</x-card.list.body>