diff --git a/app/Http/Controllers/Tabulation/AdvancementController.php b/app/Http/Controllers/Tabulation/AdvancementController.php index 4626872..0ab0e21 100644 --- a/app/Http/Controllers/Tabulation/AdvancementController.php +++ b/app/Http/Controllers/Tabulation/AdvancementController.php @@ -25,11 +25,12 @@ class AdvancementController extends Controller public function ranking(Request $request, Audition $audition) { - $entries = $this->tabulationService->auditionEntries($audition->id); - $entries = $entries->filter(function ($entry) { - return $entry->for_advancement; + $entries = $this->tabulationService->auditionEntries($audition->id, 'advancement'); + + $scoringComplete = $entries->every(function ($entry) { + return $entry->scoring_complete; }); - return view('tabulation.advancement.ranking', compact('audition', 'entries')); + return view('tabulation.advancement.ranking', compact('audition', 'entries','scoringComplete')); } } diff --git a/app/Services/TabulationService.php b/app/Services/TabulationService.php index 822ff14..e8899f2 100644 --- a/app/Services/TabulationService.php +++ b/app/Services/TabulationService.php @@ -54,7 +54,7 @@ class TabulationService $audition = $this->auditionCacheService->getAudition($auditionId); $entries = $this->entryCacheService->getEntriesForAudition($auditionId, $mode); $this->scoreService->calculateScoresForAudition($auditionId); - + // TODO will need to pass a mode to the above function to only use subscores for hte appropriate mode foreach ($entries as $entry) { $entry->final_score_array = $this->scoreService->entryTotalScores($entry); $entry->scoring_complete = ($this->scoreService->entryScoreSheetCounts()[$entry->id] == $audition->judges_count); @@ -69,18 +69,20 @@ class TabulationService return 0; }); - //TODO verify this actually sorts by subscores correctly + + // Assign a rank to each entry. In the case of a declined seat by a doubler, indicate as so and do not increment rank $n = 1; /** @var Entry $entry */ foreach ($entries as $entry) { - if (! $entry->hasFlag('declined')) { + if (! $entry->hasFlag('declined') or $mode != 'seating') { $entry->rank = $n; $n++; } else { $entry->rank = $n.' - declined'; } } + $cache[$auditionId] = $entries->keyBy('id'); return $entries->keyBy('id'); @@ -167,7 +169,6 @@ class TabulationService $audition->scored_entries_count = $scored_entries_count; } - return $auditions; }); diff --git a/resources/views/components/form/checkbox.blade.php b/resources/views/components/form/checkbox.blade.php index ac46979..ea0af3a 100644 --- a/resources/views/components/form/checkbox.blade.php +++ b/resources/views/components/form/checkbox.blade.php @@ -1,4 +1,4 @@ -@props(['name','label','description' => '', 'checked' => false]) +@props(['name','label' => false,'description' => '', 'checked' => false])
{{ $description }}
+ @if($label) + +{{ $description }}
+ @endif @error($name){{ $message }}
@enderror diff --git a/resources/views/tabulation/advancement/ranking.blade.php b/resources/views/tabulation/advancement/ranking.blade.php index e6b1f65..e730d41 100644 --- a/resources/views/tabulation/advancement/ranking.blade.php +++ b/resources/views/tabulation/advancement/ranking.blade.php @@ -1,22 +1,42 @@