Allow overrides of section sides
This commit is contained in:
parent
1e280702ea
commit
98cff5b409
|
|
@ -7,6 +7,7 @@ use App\Models\Audition;
|
|||
use App\Services\DoublerService;
|
||||
use App\Services\SeatingService;
|
||||
use App\Services\TabulationService;
|
||||
use Illuminate\Http\Request;
|
||||
|
||||
use function compact;
|
||||
|
||||
|
|
@ -32,15 +33,17 @@ class TabulationController extends Controller
|
|||
return view('tabulation.status', compact('auditions'));
|
||||
}
|
||||
|
||||
public function auditionSeating(Audition $audition)
|
||||
public function auditionSeating(Request $request, Audition $audition)
|
||||
{
|
||||
if ($request->method() == 'POST') {
|
||||
$requestedEnsembleAccepts = $request->input('ensembleAccept');
|
||||
} else {
|
||||
$requestedEnsembleAccepts = false;
|
||||
}
|
||||
|
||||
$entries = $this->tabulationService->auditionEntries($audition->id);
|
||||
$complete = true;
|
||||
$doublerComplete = true;
|
||||
foreach ($entries as $entry) {
|
||||
if (! $entry->scoring_complete) {
|
||||
$complete = false;
|
||||
}
|
||||
|
||||
if ($this->doublerService->studentIsDoubler($entry->student_id)) { // If this entry is a doubler
|
||||
if ($this->doublerService->getDoublerInfo($entry->student_id)[$entry->id]['status'] === 'undecided') { // If there is no decision for this entry
|
||||
|
|
@ -57,6 +60,13 @@ class TabulationController extends Controller
|
|||
|
||||
$seatableEntries = $this->seatingService->getSeatableEntries($audition->id);
|
||||
|
||||
return view('tabulation.auditionSeating', compact('audition', 'entries', 'scoringComplete', 'doublerComplete', 'auditionComplete', 'ensembleLimits', 'seatableEntries'));
|
||||
return view('tabulation.auditionSeating', compact('audition',
|
||||
'entries',
|
||||
'scoringComplete',
|
||||
'doublerComplete',
|
||||
'auditionComplete',
|
||||
'ensembleLimits',
|
||||
'seatableEntries',
|
||||
'requestedEnsembleAccepts'));
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@
|
|||
@foreach($doublerEntryInfo as $info)
|
||||
@php($isopen = $info['status'] == 'undecided')
|
||||
<li class="pb-2 pt-0 px-0 my-2 rounded-xl border border-gray-200 max-w-xs" x-data="{ open: {{ $isopen ? 'true':'false' }} }">
|
||||
<div class="flex items-start gap-x-3 bg-gray-100 px-3 py-2" >
|
||||
<div class="flex items-start gap-x-3 bg-gray-100 px-3 py-2 rounded-t-xl" >
|
||||
<p class="text-sm font-semibold leading-6 text-gray-900">
|
||||
<a href="/tabulation/auditions/{{ $info['auditionID'] }}">
|
||||
{{ $info['auditionName'] }} - {{ $info['status'] }}
|
||||
|
|
|
|||
|
|
@ -1,18 +1,23 @@
|
|||
<x-card.card class="mb-3">
|
||||
<x-card.heading>Seating</x-card.heading>
|
||||
<div class="py-3 px-5">
|
||||
<form.form method="POST" action="#">
|
||||
<x-form.form method="POST" action="{{ route('tabulation.audition.seat',['audition' => $audition]) }}">
|
||||
@csrf
|
||||
@foreach($ensembleLimits as $ensembleLimit)
|
||||
<x-form.field name="ensemble{{ $ensembleLimit->ensemble->id }}"
|
||||
@php
|
||||
$value = $requestedEnsembleAccepts[$ensembleLimit->ensemble->id] ?? $ensembleLimit->maximum_accepted;
|
||||
@endphp
|
||||
|
||||
<x-form.field name="ensembleAccept[{{ $ensembleLimit->ensemble->id }}]"
|
||||
label_text="{{ $ensembleLimit->ensemble->name }} - Max: {{ $ensembleLimit->maximum_accepted }}"
|
||||
type="number"
|
||||
max="{{ $ensembleLimit->maximum_accepted }}"
|
||||
value="{{ $ensembleLimit->maximum_accepted }}"
|
||||
value="{{ $value }}"
|
||||
class="mb-3"/>
|
||||
@endforeach
|
||||
<x-form.footer>
|
||||
<x-form.button>Seat</x-form.button>
|
||||
<x-form.button type="submit">Seat</x-form.button>
|
||||
</x-form.footer>
|
||||
</form.form>
|
||||
</x-form.form>
|
||||
</div>
|
||||
</x-card.card>
|
||||
|
|
|
|||
|
|
@ -2,7 +2,10 @@
|
|||
<x-card.card class="mb-3">
|
||||
<x-card.heading>{{ $ensembleLimit->ensemble->name }}</x-card.heading>
|
||||
<x-card.list.body>
|
||||
@for($n=1; $n <= $ensembleLimit->maximum_accepted; $n++)
|
||||
@php
|
||||
$maxAccepted = $requestedEnsembleAccepts[$ensembleLimit->ensemble->id] ?? $ensembleLimit->maximum_accepted;
|
||||
@endphp
|
||||
@for($n=1; $n <= $maxAccepted; $n++)
|
||||
@php
|
||||
$entry = $seatableEntries->shift();
|
||||
if (is_null($entry)) continue;
|
||||
|
|
|
|||
|
|
@ -44,7 +44,7 @@ Route::middleware(['auth', 'verified', CheckIfCanTab::class])->group(function ()
|
|||
// Generic Tabulation Routes
|
||||
Route::prefix('tabulation/')->controller(\App\Http\Controllers\Tabulation\TabulationController::class)->group(function () {
|
||||
Route::get('/status', 'status');
|
||||
Route::get('/auditions/{audition}', 'auditionSeating');
|
||||
Route::match(['get', 'post'], '/auditions/{audition}', 'auditionSeating')->name('tabulation.audition.seat');
|
||||
});
|
||||
|
||||
// Doubler decision routes
|
||||
|
|
|
|||
Loading…
Reference in New Issue