diff --git a/app/Http/Controllers/Tabulation/TabulationController.php b/app/Http/Controllers/Tabulation/TabulationController.php index 5d8c093..6919770 100644 --- a/app/Http/Controllers/Tabulation/TabulationController.php +++ b/app/Http/Controllers/Tabulation/TabulationController.php @@ -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')); } } diff --git a/resources/views/tabulation/auditionSeating-doubler-block.blade.php b/resources/views/tabulation/auditionSeating-doubler-block.blade.php index 747b12a..9783156 100644 --- a/resources/views/tabulation/auditionSeating-doubler-block.blade.php +++ b/resources/views/tabulation/auditionSeating-doubler-block.blade.php @@ -5,7 +5,7 @@ @foreach($doublerEntryInfo as $info) @php($isopen = $info['status'] == 'undecided')
  • -
    +

    {{ $info['auditionName'] }} - {{ $info['status'] }} diff --git a/resources/views/tabulation/auditionSeating-fill-seats-form.blade.php b/resources/views/tabulation/auditionSeating-fill-seats-form.blade.php index 4256499..1f1dfba 100644 --- a/resources/views/tabulation/auditionSeating-fill-seats-form.blade.php +++ b/resources/views/tabulation/auditionSeating-fill-seats-form.blade.php @@ -1,18 +1,23 @@ Seating

    diff --git a/resources/views/tabulation/auditionSeating-show-proposed-seats.blade.php b/resources/views/tabulation/auditionSeating-show-proposed-seats.blade.php index 7aac373..e59f9ca 100644 --- a/resources/views/tabulation/auditionSeating-show-proposed-seats.blade.php +++ b/resources/views/tabulation/auditionSeating-show-proposed-seats.blade.php @@ -2,7 +2,10 @@ {{ $ensembleLimit->ensemble->name }} - @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; diff --git a/routes/web.php b/routes/web.php index b099d14..31f6b93 100644 --- a/routes/web.php +++ b/routes/web.php @@ -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