This commit is contained in:
Matt Young 2024-06-10 10:37:13 -05:00
parent 2d00473b2c
commit ef7cc131e0
8 changed files with 43 additions and 10 deletions

View File

@ -82,7 +82,7 @@ class TabulationController extends Controller
public function status()
{
$auditions = Audition::with('entries.scoreSheets')->with('room.judges')->orderBy('score_order')->get();
$auditions = Audition::with(['entries.scoreSheets','room.judges'])->orderBy('score_order')->get();
return view('tabulation.status',compact('auditions'));
}
@ -93,7 +93,7 @@ class TabulationController extends Controller
// $entries = $entries->sortByDesc(function ($entry) {
// return $entry->totalScore();
// });
$entries = $audition->rankedEntries()->load('student','scoreSheets.audition.scoringGuide.subscores');
$entries = $audition->rankedEntries()->load('student.entries','scoreSheets.audition.scoringGuide.subscores');
$judges = $audition->judges();
return view('tabulation.auditionSeating',compact('audition','entries','judges'));
}

View File

@ -59,6 +59,10 @@ class Entry extends Model
}
public function fullyJudged(){
return $this->scoreSheets->count() >= $this->audition->room->judges->count();
}
public function scoreFromJudge($user): ScoreSheet|null
{
// return $this->scoreSheets()->where('user_id','=',$user)->first() ?? null;

View File

@ -34,4 +34,9 @@ class Student extends Model
return $this->first_name . ' ' . $this->last_name;
}
public function isDoubler()
{
return $this->entries->count() > 1;
}
}

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="none" viewBox="0 0 24 24">
<path stroke="{{$color}}" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M5 11.917 9.724 16.5 19 7.5"/>
</svg>

View File

@ -1,7 +1,7 @@
<div x-data="{ open: false }" class="relative">
{{-- <button type="button" class="inline-flex items-center gap-x-1 text-sm font-semibold leading-6 text-gray-900" aria-expanded="false" @on:click=" open = ! open">--}}
<button type="button" class="inline-flex items-center gap-x-1 text-white rounded-md px-3 py-2 text-sm font-medium hover:bg-indigo-500 hover:bg-opacity-75" aria-expanded="false" @click=" open = ! open">
<button type="button" class="inline-flex items-center gap-x-1 text-white rounded-md px-3 py-2 text-sm font-medium hover:bg-indigo-500 hover:bg-opacity-75" aria-expanded="false" @click=" open = ! open" @click.outside=" open = false">
<span>Admin</span>
<svg class="h-5 w-5" viewBox="0 0 20 20" fill="currentColor" aria-hidden="true">
<path fill-rule="evenodd" d="M5.23 7.21a.75.75 0 011.06.02L10 11.168l3.71-3.938a.75.75 0 111.08 1.04l-4.25 4.5a.75.75 0 01-1.08 0l-4.25-4.5a.75.75 0 01.02-1.06z" clip-rule="evenodd" />

View File

@ -1,7 +1,7 @@
<div x-data="{ open: false }" class="relative">
{{-- <button type="button" class="inline-flex items-center gap-x-1 text-sm font-semibold leading-6 text-gray-900" aria-expanded="false" @on:click=" open = ! open">--}}
<button type="button" class="inline-flex items-center gap-x-1 text-white rounded-md px-3 py-2 text-sm font-medium hover:bg-indigo-500 hover:bg-opacity-75" aria-expanded="false" @click=" open = ! open">
<button type="button" class="inline-flex items-center gap-x-1 text-white rounded-md px-3 py-2 text-sm font-medium hover:bg-indigo-500 hover:bg-opacity-75" aria-expanded="false" @click=" open = ! open" @click.outside="open = false">
<span>Tabulation</span>
<svg class="h-5 w-5" viewBox="0 0 20 20" fill="currentColor" aria-hidden="true">
<path fill-rule="evenodd" d="M5.23 7.21a.75.75 0 011.06.02L10 11.168l3.71-3.938a.75.75 0 111.08 1.04l-4.25 4.5a.75.75 0 01-1.08 0l-4.25-4.5a.75.75 0 01.02-1.06z" clip-rule="evenodd" />

View File

@ -7,10 +7,12 @@
<x-table.th>ID</x-table.th>
<x-table.th>Draw #</x-table.th>
<x-table.th>Student Name</x-table.th>
@foreach($judges as $judge)
<x-table.th>{{ $judge->short_name() }}</x-table.th>
@endforeach
<x-table.th>Doubler</x-table.th>
{{-- @foreach($judges as $judge)--}}
{{-- <x-table.th>{{ $judge->short_name() }}</x-table.th>--}}
{{-- @endforeach--}}
<x-table.th>Total Score</x-table.th>
<x-table.th>All Scores?</x-table.th>
</tr>
</thead>
@ -20,10 +22,22 @@
<x-table.td>{{ $entry->id }}</x-table.td>
<x-table.td>{{ $entry->draw_number }}</x-table.td>
<x-table.td>{{ $entry->student->full_name(true) }}</x-table.td>
@foreach($judges as $judge)
<x-table.td>{{ number_format($entry->scoreFromJudge($judge->id)->totalScore(), 4) }}</x-table.td>
@endforeach
<x-table.td>{{ $entry->student->isDoubler() ? 'Doubler':'' }}</x-table.td>
{{-- @foreach($judges as $judge)--}}
{{-- <x-table.td>--}}
{{-- @php--}}
{{-- $thisJudgeScore = $entry->scoreFromJudge($judge->id)?->totalScore();--}}
{{-- @endphp--}}
{{-- {{ $thisJudgeScore ? number_format($thisJudgeScore,4) : '' }}--}}
{{-- </x-table.td>--}}
{{-- @endforeach--}}
<x-table.td>{{ number_format($entry->totalScore(), 4) }}</x-table.td>
<x-table.td>
@if($entry->fullyJudged())
<x-icons.checkmark color="green" />
@endif
</x-table.td>
</tr>
@endforeach
</x-table.body>

View File

@ -9,6 +9,7 @@
<tr>
<x-table.th>Audition</x-table.th>
<x-table.th>Scoring Status</x-table.th>
<x-table.th>Scoring Complete</x-table.th>
</tr>
</thead>
<x-table.body>
@ -18,6 +19,11 @@
{{ $audition->name }}
</a></x-table.td>
<x-table.td>{{ $audition->scoredEntries()->count() }} / {{ $audition->entries->count() }} Scored</x-table.td>
<td>
@if($audition->scoredEntries()->count() == $audition->entries->count())
<x-icons.checkmark color="green"/>
@endif
</td>
</tr>
@endforeach
</x-table.body>