Show votes on Tabulation Advancement page
This commit is contained in:
parent
90aac42fb4
commit
25aa76c63c
|
|
@ -27,6 +27,8 @@ class AdvancementController extends Controller
|
|||
public function ranking(Request $request, Audition $audition)
|
||||
{
|
||||
$entries = $this->tabulationService->auditionEntries($audition->id, 'advancement');
|
||||
$entries->load('advancementVotes');
|
||||
|
||||
|
||||
$scoringComplete = $entries->every(function ($entry) {
|
||||
return $entry->scoring_complete;
|
||||
|
|
|
|||
|
|
@ -19,7 +19,7 @@ class JudgeAdvancementVote extends Model
|
|||
|
||||
public function judge(): BelongsTo
|
||||
{
|
||||
return $this->belongsTo(User::class);
|
||||
return $this->belongsTo(User::class, 'user_id');
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -0,0 +1,15 @@
|
|||
@php
|
||||
$classes = "pointer-events-none absolute bg-white transform -translate-y-12 z-50 p-3 max-w-sm rounded-lg shadow-lg ring-1 ring-black ring-opacity-5";
|
||||
@endphp
|
||||
<div {{ $attributes->merge(['class'=>$classes]) }} x-cloak
|
||||
x-transition:enter="transform ease-out duration-300 transition "
|
||||
x-transition:enter-start="-translate-y-12 opacity-0 sm:translate-y-0 sm:translate-x-2"
|
||||
x-transition:enter-end="translate-y-0 opacity-100 sm:translate-x-0"
|
||||
x-transition:leave="transition ease-in duration-100"
|
||||
x-transition:leave-start="opacity-100"
|
||||
x-transition:leave-end="opacity-0">
|
||||
{{ $slot }}
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
|
@ -8,6 +8,7 @@
|
|||
<x-table.th>Student Name</x-table.th>
|
||||
<x-table.th>Total Score</x-table.th>
|
||||
<x-table.th>All Scores?</x-table.th>
|
||||
<x-table.th>Votes</x-table.th>
|
||||
@if($scoringComplete)
|
||||
<x-table.th>Pass?</x-table.th>
|
||||
@endif
|
||||
|
|
@ -30,6 +31,29 @@
|
|||
<x-icons.checkmark color="green"/>
|
||||
@endif
|
||||
</x-table.td>
|
||||
<x-table.td class="flex space-x-1">
|
||||
@foreach($entry->advancementVotes as $vote)
|
||||
<div x-data="{ showJudgeName: false, timeout: null }"
|
||||
x-on:mouseover="clearTimeout(timeout); timeout = setTimeout(() => showJudgeName = true, 300)"
|
||||
x-on:mouseleave="clearTimeout(timeout); showJudgeName = false">
|
||||
|
||||
<x-tooltip x-show="showJudgeName">
|
||||
{{ $vote->judge->full_name() }}
|
||||
</x-tooltip>
|
||||
@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
|
||||
</div>
|
||||
@endforeach
|
||||
</x-table.td>
|
||||
@if( $audition->hasFlag('advancement_published') )
|
||||
<x-table.td>
|
||||
@if($entry->hasFlag('will_advance'))
|
||||
|
|
|
|||
Loading…
Reference in New Issue