Fix issue where the results page would crash if an audition was published with no students seated or advanced.
This commit is contained in:
parent
e7acaa2448
commit
bc7bd6fb44
|
|
@ -68,12 +68,14 @@ class AdvancementController extends Controller
|
|||
public function setAuditionPassers(Request $request, Audition $audition)
|
||||
{
|
||||
$passingEntries = $request->input('pass');
|
||||
$passingEntries = array_keys($passingEntries);
|
||||
$audition->addFlag('advancement_published');
|
||||
if (! is_null($passingEntries)) {
|
||||
$passingEntries = array_keys($passingEntries);
|
||||
$entries = Entry::whereIn('id', $passingEntries)->get();
|
||||
foreach ($entries as $entry) {
|
||||
$entry->addFlag('will_advance');
|
||||
}
|
||||
}
|
||||
Cache::forget('audition'.$audition->id.'advancement');
|
||||
Cache::forget('publicResultsPage');
|
||||
|
||||
|
|
|
|||
|
|
@ -4,12 +4,19 @@
|
|||
<h3 class="pb-3 pl-2 font-semibold text-lg">{{ auditionSetting('auditionAbbreviation') }} Seats</h3>
|
||||
@foreach($publishedAuditions as $audition)
|
||||
<x-results.table-audition-section :auditionName="$audition->name">
|
||||
@if(! array_key_exists($audition->id, $resultsSeatList))
|
||||
<x-results.table-seat-row
|
||||
seat="No Students Seated"
|
||||
student_name=" "
|
||||
school=" "/>
|
||||
@else
|
||||
@foreach($resultsSeatList[$audition->id] as $seat)
|
||||
<x-results.table-seat-row
|
||||
:seat="$seat['seat']"
|
||||
:student_name="$seat['student']->full_name()"
|
||||
:school="$seat['student']->school->name" />
|
||||
:school="$seat['student']->school->name"/>
|
||||
@endforeach
|
||||
@endif
|
||||
</x-results.table-audition-section>
|
||||
@endforeach
|
||||
</div>
|
||||
|
|
@ -19,11 +26,18 @@
|
|||
<h3 class="pb-3 pl-2 font-semibold text-lg">{{ auditionSetting('advanceTo') }} Qualifiers</h3>
|
||||
@foreach($publishedAdvancementAuditions as $audition)
|
||||
<x-results.table-audition-section :auditionName="$audition->name">
|
||||
@if(! $resultsAdvancementList->has($audition->id))
|
||||
{{-- Check if there are any students advancing --}}
|
||||
<x-results.table-qualifier-row
|
||||
student_name="No Students Advanced"
|
||||
school=" "/>
|
||||
@else
|
||||
@foreach($resultsAdvancementList[$audition->id] as $entry)
|
||||
<x-results.table-qualifier-row
|
||||
:student_name="$entry->student->full_name()"
|
||||
:school="$entry->student->school->name" />
|
||||
:school="$entry->student->school->name"/>
|
||||
@endforeach
|
||||
@endif
|
||||
</x-results.table-audition-section>
|
||||
@endforeach
|
||||
</div>
|
||||
|
|
|
|||
Loading…
Reference in New Issue