Re-enable director results

This commit is contained in:
Matt Young 2025-01-20 17:00:01 -06:00
parent 23e466c2e6
commit b5501789a9
2 changed files with 36 additions and 36 deletions

View File

@ -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()

View File

@ -27,24 +27,24 @@
</x-card.list.row>
</a>
@endif
{{-- @if($showRecapLink)--}}
{{-- <a href="{{ route('recap.selectAudition') }}">--}}
{{-- <x-card.list.row class="hover:bg-gray-200">--}}
{{-- Audition Score Recaps--}}
{{-- </x-card.list.row>--}}
{{-- </a>--}}
{{-- @endif--}}
@if($showRecapLink)
<a href="{{ route('recap.selectAudition') }}">
<x-card.list.row class="hover:bg-gray-200">
Audition Score Recaps
</x-card.list.row>
</a>
@endif
</x-card.list.body>
</x-card.card>
</div>
{{-- @if(Auth::user()->school_id)--}}
{{-- <div class="md:col-span-3 pl-3"> --}}{{--Column 2 Results--}}
{{-- <x-card.card>--}}
{{-- <x-card.heading>My Results</x-card.heading>--}}
{{-- @include('dashboard.results-table')--}}
{{-- </x-card.card>--}}
{{-- </div>--}}
{{-- @endif--}}
@if(Auth::user()->school_id)
<div class="md:col-span-3 pl-3"> Column 2 Results
<x-card.card>
<x-card.heading>My Results</x-card.heading>
@include('dashboard.results-table')
</x-card.card>
</div>
@endif
<div>