Rewrite tabulation #14
|
|
@ -7,6 +7,7 @@ use App\Http\Controllers\Controller;
|
||||||
use App\Models\Audition;
|
use App\Models\Audition;
|
||||||
use App\Models\Entry;
|
use App\Models\Entry;
|
||||||
use Illuminate\Http\Request;
|
use Illuminate\Http\Request;
|
||||||
|
use Illuminate\Support\Facades\Cache;
|
||||||
|
|
||||||
class AdvancementController extends Controller
|
class AdvancementController extends Controller
|
||||||
{
|
{
|
||||||
|
|
@ -57,7 +58,7 @@ class AdvancementController extends Controller
|
||||||
$entries->load('advancementVotes');
|
$entries->load('advancementVotes');
|
||||||
|
|
||||||
$scoringComplete = $entries->every(function ($entry) {
|
$scoringComplete = $entries->every(function ($entry) {
|
||||||
return $entry->scoring_complete;
|
return $entry->score_totals[0] >= 0;
|
||||||
});
|
});
|
||||||
|
|
||||||
return view('tabulation.advancement.ranking', compact('audition', 'entries', 'scoringComplete'));
|
return view('tabulation.advancement.ranking', compact('audition', 'entries', 'scoringComplete'));
|
||||||
|
|
@ -72,7 +73,7 @@ class AdvancementController extends Controller
|
||||||
foreach ($entries as $entry) {
|
foreach ($entries as $entry) {
|
||||||
$entry->addFlag('will_advance');
|
$entry->addFlag('will_advance');
|
||||||
}
|
}
|
||||||
|
Cache::forget('audition'.$audition->id.'advancement');
|
||||||
return redirect()->route('advancement.ranking', ['audition' => $audition->id])->with('success',
|
return redirect()->route('advancement.ranking', ['audition' => $audition->id])->with('success',
|
||||||
'Passers have been set successfully');
|
'Passers have been set successfully');
|
||||||
}
|
}
|
||||||
|
|
@ -83,7 +84,7 @@ class AdvancementController extends Controller
|
||||||
foreach ($audition->entries as $entry) {
|
foreach ($audition->entries as $entry) {
|
||||||
$entry->removeFlag('will_advance');
|
$entry->removeFlag('will_advance');
|
||||||
}
|
}
|
||||||
|
Cache::forget('audition'.$audition->id.'advancement');
|
||||||
return redirect()->route('advancement.ranking', ['audition' => $audition->id])->with('success',
|
return redirect()->route('advancement.ranking', ['audition' => $audition->id])->with('success',
|
||||||
'Passers have been cleared successfully');
|
'Passers have been cleared successfully');
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -32,7 +32,7 @@
|
||||||
<span class="text-xs text-gray-400">{{ $entry->student->school->name }}</span>
|
<span class="text-xs text-gray-400">{{ $entry->student->school->name }}</span>
|
||||||
</x-table.td>
|
</x-table.td>
|
||||||
<x-table.td>{{ $score }}</x-table.td>
|
<x-table.td>{{ $score }}</x-table.td>
|
||||||
|
|
||||||
<x-table.td class="flex space-x-1">
|
<x-table.td class="flex space-x-1">
|
||||||
@foreach($entry->advancementVotes as $vote)
|
@foreach($entry->advancementVotes as $vote)
|
||||||
<div x-data="{ showJudgeName: false, timeout: null }"
|
<div x-data="{ showJudgeName: false, timeout: null }"
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue