cleanup
This commit is contained in:
parent
2d00473b2c
commit
ef7cc131e0
|
|
@ -82,7 +82,7 @@ class TabulationController extends Controller
|
||||||
|
|
||||||
public function status()
|
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'));
|
return view('tabulation.status',compact('auditions'));
|
||||||
}
|
}
|
||||||
|
|
@ -93,7 +93,7 @@ class TabulationController extends Controller
|
||||||
// $entries = $entries->sortByDesc(function ($entry) {
|
// $entries = $entries->sortByDesc(function ($entry) {
|
||||||
// return $entry->totalScore();
|
// 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();
|
$judges = $audition->judges();
|
||||||
return view('tabulation.auditionSeating',compact('audition','entries','judges'));
|
return view('tabulation.auditionSeating',compact('audition','entries','judges'));
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -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
|
public function scoreFromJudge($user): ScoreSheet|null
|
||||||
{
|
{
|
||||||
// return $this->scoreSheets()->where('user_id','=',$user)->first() ?? null;
|
// return $this->scoreSheets()->where('user_id','=',$user)->first() ?? null;
|
||||||
|
|
|
||||||
|
|
@ -34,4 +34,9 @@ class Student extends Model
|
||||||
return $this->first_name . ' ' . $this->last_name;
|
return $this->first_name . ' ' . $this->last_name;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function isDoubler()
|
||||||
|
{
|
||||||
|
return $this->entries->count() > 1;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -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>
|
||||||
|
|
@ -1,7 +1,7 @@
|
||||||
<div x-data="{ open: false }" class="relative">
|
<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-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>
|
<span>Admin</span>
|
||||||
<svg class="h-5 w-5" viewBox="0 0 20 20" fill="currentColor" aria-hidden="true">
|
<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" />
|
<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" />
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,7 @@
|
||||||
<div x-data="{ open: false }" class="relative">
|
<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-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>
|
<span>Tabulation</span>
|
||||||
<svg class="h-5 w-5" viewBox="0 0 20 20" fill="currentColor" aria-hidden="true">
|
<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" />
|
<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" />
|
||||||
|
|
|
||||||
|
|
@ -7,10 +7,12 @@
|
||||||
<x-table.th>ID</x-table.th>
|
<x-table.th>ID</x-table.th>
|
||||||
<x-table.th>Draw #</x-table.th>
|
<x-table.th>Draw #</x-table.th>
|
||||||
<x-table.th>Student Name</x-table.th>
|
<x-table.th>Student Name</x-table.th>
|
||||||
@foreach($judges as $judge)
|
<x-table.th>Doubler</x-table.th>
|
||||||
<x-table.th>{{ $judge->short_name() }}</x-table.th>
|
{{-- @foreach($judges as $judge)--}}
|
||||||
@endforeach
|
{{-- <x-table.th>{{ $judge->short_name() }}</x-table.th>--}}
|
||||||
|
{{-- @endforeach--}}
|
||||||
<x-table.th>Total Score</x-table.th>
|
<x-table.th>Total Score</x-table.th>
|
||||||
|
<x-table.th>All Scores?</x-table.th>
|
||||||
</tr>
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
|
|
||||||
|
|
@ -20,10 +22,22 @@
|
||||||
<x-table.td>{{ $entry->id }}</x-table.td>
|
<x-table.td>{{ $entry->id }}</x-table.td>
|
||||||
<x-table.td>{{ $entry->draw_number }}</x-table.td>
|
<x-table.td>{{ $entry->draw_number }}</x-table.td>
|
||||||
<x-table.td>{{ $entry->student->full_name(true) }}</x-table.td>
|
<x-table.td>{{ $entry->student->full_name(true) }}</x-table.td>
|
||||||
@foreach($judges as $judge)
|
<x-table.td>{{ $entry->student->isDoubler() ? 'Doubler':'' }}</x-table.td>
|
||||||
<x-table.td>{{ number_format($entry->scoreFromJudge($judge->id)->totalScore(), 4) }}</x-table.td>
|
{{-- @foreach($judges as $judge)--}}
|
||||||
@endforeach
|
{{-- <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>{{ number_format($entry->totalScore(), 4) }}</x-table.td>
|
||||||
|
<x-table.td>
|
||||||
|
@if($entry->fullyJudged())
|
||||||
|
<x-icons.checkmark color="green" />
|
||||||
|
@endif
|
||||||
|
|
||||||
|
</x-table.td>
|
||||||
</tr>
|
</tr>
|
||||||
@endforeach
|
@endforeach
|
||||||
</x-table.body>
|
</x-table.body>
|
||||||
|
|
|
||||||
|
|
@ -9,6 +9,7 @@
|
||||||
<tr>
|
<tr>
|
||||||
<x-table.th>Audition</x-table.th>
|
<x-table.th>Audition</x-table.th>
|
||||||
<x-table.th>Scoring Status</x-table.th>
|
<x-table.th>Scoring Status</x-table.th>
|
||||||
|
<x-table.th>Scoring Complete</x-table.th>
|
||||||
</tr>
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
<x-table.body>
|
<x-table.body>
|
||||||
|
|
@ -18,6 +19,11 @@
|
||||||
{{ $audition->name }}
|
{{ $audition->name }}
|
||||||
</a></x-table.td>
|
</a></x-table.td>
|
||||||
<x-table.td>{{ $audition->scoredEntries()->count() }} / {{ $audition->entries->count() }} Scored</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>
|
</tr>
|
||||||
@endforeach
|
@endforeach
|
||||||
</x-table.body>
|
</x-table.body>
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue