From b5501789a9ea24dcf202e779e8be04898a1659ac Mon Sep 17 00:00:00 2001 From: Matt Young Date: Mon, 20 Jan 2025 17:00:01 -0600 Subject: [PATCH] Re-enable director results --- app/Http/Controllers/DashboardController.php | 42 +++++++++---------- resources/views/dashboard/dashboard.blade.php | 30 ++++++------- 2 files changed, 36 insertions(+), 36 deletions(-) diff --git a/app/Http/Controllers/DashboardController.php b/app/Http/Controllers/DashboardController.php index d653aac..3e04766 100644 --- a/app/Http/Controllers/DashboardController.php +++ b/app/Http/Controllers/DashboardController.php @@ -34,28 +34,28 @@ class DashboardController extends Controller ) { // Info for director results report - // $entries = Auth::user()->entries; - // $entries = $entries->filter(function ($entry) { - // return $entry->audition->hasFlag('seats_published'); - // }); - // $entries = $entries->sortBy(function ($entry) { - // return $entry->student->full_name(true); - // }); - // $scores = []; - // $results = []; - // $ranks = []; - // foreach ($entries as $entry) { - // $results[$entry->id] = $resultGenerator->getResult($entry); - // if (! $entry->hasFlag('no_show') && ! $entry->hasFlag('failed_prelim')) { - // $scores[$entry->id] = $scoreCalc->calculate('seating', $entry); - // $auditionResults = $ranker->rank('seating', $entry->audition); - // $ranks[$entry->id] = $auditionResults->firstWhere('id', $entry->id)->raw_rank; - // } - // } - // $showRecapLink = AuditionFlag::where('flag_name', 'seats_published')->count() > 0; + $entries = Auth::user()->entries; + $entries = $entries->filter(function ($entry) { + return $entry->audition->hasFlag('seats_published'); + }); + $entries = $entries->sortBy(function ($entry) { + return $entry->student->full_name(true); + }); + $scores = []; + $results = []; + $ranks = []; + foreach ($entries as $entry) { + $results[$entry->id] = $resultGenerator->getResult($entry); + if (! $entry->hasFlag('no_show') && ! $entry->hasFlag('failed_prelim')) { + $scores[$entry->id] = $scoreCalc->calculate('seating', $entry); + $auditionResults = $ranker->rank('seating', $entry->audition); + $ranks[$entry->id] = $auditionResults->firstWhere('id', $entry->id)->raw_rank; + } + } + $showRecapLink = AuditionFlag::where('flag_name', 'seats_published')->count() > 0; - //return view('dashboard.dashboard', compact('entries', 'scores', 'results', 'ranks', 'showRecapLink')); - return view('dashboard.dashboard'); + return view('dashboard.dashboard', compact('entries', 'scores', 'results', 'ranks', 'showRecapLink')); + // return view('dashboard.dashboard'); } public function my_school() diff --git a/resources/views/dashboard/dashboard.blade.php b/resources/views/dashboard/dashboard.blade.php index a9f3856..40d75db 100644 --- a/resources/views/dashboard/dashboard.blade.php +++ b/resources/views/dashboard/dashboard.blade.php @@ -27,24 +27,24 @@ @endif -{{-- @if($showRecapLink)--}} -{{-- --}} -{{-- --}} -{{-- Audition Score Recaps--}} -{{-- --}} -{{-- --}} -{{-- @endif--}} + @if($showRecapLink) + + + Audition Score Recaps + + + @endif -{{-- @if(Auth::user()->school_id)--}} -{{--
--}}{{--Column 2 Results--}} -{{-- --}} -{{-- My Results--}} -{{-- @include('dashboard.results-table')--}} -{{-- --}} -{{--
--}} -{{-- @endif--}} + @if(Auth::user()->school_id) +
Column 2 Results + + My Results + @include('dashboard.results-table') + +
+ @endif