diff --git a/app/Http/Controllers/Tabulation/TabulationController.php b/app/Http/Controllers/Tabulation/TabulationController.php
index e27924c..5d8c093 100644
--- a/app/Http/Controllers/Tabulation/TabulationController.php
+++ b/app/Http/Controllers/Tabulation/TabulationController.php
@@ -13,7 +13,9 @@ use function compact;
class TabulationController extends Controller
{
protected $tabulationService;
+
protected $doublerService;
+
protected $seatingService;
public function __construct(TabulationService $tabulationService, DoublerService $doublerService, SeatingService $seatingService)
@@ -53,6 +55,8 @@ class TabulationController extends Controller
$ensembleLimits = $this->seatingService->getLimitForAudition($audition->id);
$auditionComplete = $scoringComplete && $doublerComplete;
- return view('tabulation.auditionSeating', compact('audition', 'entries', 'scoringComplete', 'doublerComplete', 'auditionComplete', 'ensembleLimits'));
+ $seatableEntries = $this->seatingService->getSeatableEntries($audition->id);
+
+ return view('tabulation.auditionSeating', compact('audition', 'entries', 'scoringComplete', 'doublerComplete', 'auditionComplete', 'ensembleLimits', 'seatableEntries'));
}
}
diff --git a/app/Providers/AppServiceProvider.php b/app/Providers/AppServiceProvider.php
index 1a4cbf7..e305498 100644
--- a/app/Providers/AppServiceProvider.php
+++ b/app/Providers/AppServiceProvider.php
@@ -50,8 +50,8 @@ class AppServiceProvider extends ServiceProvider
return new AuditionCacheService();
});
- $this->app->singleton(SeatingService::class, function () {
- return new SeatingService();
+ $this->app->singleton(SeatingService::class, function ($app) {
+ return new SeatingService($app->make(TabulationService::class));
});
$this->app->singleton(EntryCacheService::class, function ($app) {
diff --git a/app/Services/SeatingService.php b/app/Services/SeatingService.php
index 2a6e224..4c613a1 100644
--- a/app/Services/SeatingService.php
+++ b/app/Services/SeatingService.php
@@ -9,12 +9,14 @@ class SeatingService
{
protected $limitsCacheKey = 'acceptanceLimits';
+ protected $tabulationService;
+
/**
* Create a new class instance.
*/
- public function __construct()
+ public function __construct(TabulationService $tabulationService)
{
- //
+ $this->tabulationService = $tabulationService;
}
public function getAcceptanceLimits()
@@ -40,4 +42,12 @@ class SeatingService
{
Cache::forget($this->limitsCacheKey);
}
+
+ public function getSeatableEntries($auditionId)
+ {
+ $entries = $this->tabulationService->auditionEntries($auditionId);
+ return $entries->reject(function ($entry) {
+ return $entry->hasFlag('declined');
+ });
+ }
}
diff --git a/resources/views/components/form/footer.blade.php b/resources/views/components/form/footer.blade.php
index 0e8a21a..e6e4860 100644
--- a/resources/views/components/form/footer.blade.php
+++ b/resources/views/components/form/footer.blade.php
@@ -1,6 +1,6 @@
@props([
'submitButtonText' => '',
- 'buttons' => false
+ 'buttons' => false,
])
merge(['class' => 'flex items-center justify-end mt-4 gap-x-6 border-t border-gray-900/10 px-0 pt-4']) }}>
@if ($slot->isEmpty())
diff --git a/resources/views/tabulation/doubler-block.blade.php b/resources/views/tabulation/auditionSeating-doubler-block.blade.php
similarity index 100%
rename from resources/views/tabulation/doubler-block.blade.php
rename to resources/views/tabulation/auditionSeating-doubler-block.blade.php
diff --git a/resources/views/tabulation/auditionSeating-fill-seats-form.blade.php b/resources/views/tabulation/auditionSeating-fill-seats-form.blade.php
new file mode 100644
index 0000000..4256499
--- /dev/null
+++ b/resources/views/tabulation/auditionSeating-fill-seats-form.blade.php
@@ -0,0 +1,18 @@
+
+ Seating
+
+
+ @foreach($ensembleLimits as $ensembleLimit)
+
+ @endforeach
+
+ Seat
+
+
+
+
diff --git a/resources/views/tabulation/audition-results-table.blade.php b/resources/views/tabulation/auditionSeating-results-table.blade.php
similarity index 95%
rename from resources/views/tabulation/audition-results-table.blade.php
rename to resources/views/tabulation/auditionSeating-results-table.blade.php
index 5b5b0c5..2877e03 100644
--- a/resources/views/tabulation/audition-results-table.blade.php
+++ b/resources/views/tabulation/auditionSeating-results-table.blade.php
@@ -27,7 +27,7 @@
@if($doublerService->studentIsDoubler($entry->student_id))
- @include('tabulation.doubler-block')
+ @include('tabulation.auditionSeating-doubler-block')
@endif
{{ number_format($entry->final_score_array[0] ?? 0,4) }}
diff --git a/resources/views/tabulation/auditionSeating-show-proposed-seats.blade.php b/resources/views/tabulation/auditionSeating-show-proposed-seats.blade.php
new file mode 100644
index 0000000..7aac373
--- /dev/null
+++ b/resources/views/tabulation/auditionSeating-show-proposed-seats.blade.php
@@ -0,0 +1,17 @@
+@foreach($ensembleLimits as $ensembleLimit)
+
+ {{ $ensembleLimit->ensemble->name }}
+
+ @for($n=1; $n <= $ensembleLimit->maximum_accepted; $n++)
+ @php
+ $entry = $seatableEntries->shift();
+ if (is_null($entry)) continue;
+ @endphp
+
+
+ {{ $n }} - {{ $entry->student->full_name() }}
+
+ @endfor
+
+
+@endforeach
diff --git a/resources/views/tabulation/auditionSeating-unable-to-seat-card.blade.php b/resources/views/tabulation/auditionSeating-unable-to-seat-card.blade.php
new file mode 100644
index 0000000..d243c37
--- /dev/null
+++ b/resources/views/tabulation/auditionSeating-unable-to-seat-card.blade.php
@@ -0,0 +1,10 @@
+
+ Unable to seat this audition
+ @if(! $scoringComplete)
+ The audition cannot be seated while it has unscored entries.
+ @endif
+
+ @if(! $doublerComplete)
+ The audition cannot be seated while it has unresolved doublers.
+ @endif
+
diff --git a/resources/views/tabulation/auditionSeating.blade.php b/resources/views/tabulation/auditionSeating.blade.php
index 2091d8b..7e9af3f 100644
--- a/resources/views/tabulation/auditionSeating.blade.php
+++ b/resources/views/tabulation/auditionSeating.blade.php
@@ -7,50 +7,19 @@
- @include('tabulation.audition-results-table')
+ @include('tabulation.auditionSeating-results-table')
@if(! $auditionComplete)
-
- Unable to seat this audition
- @if(! $scoringComplete)
- The audition cannot be seated while it has unscored entries.
- @endif
-
- @if(! $doublerComplete)
- The audition cannot be seated while it has unresolved doublers.
- @endif
-
+ @include('tabulation.auditionSeating-unable-to-seat-card')
+ @else
+ @include('tabulation.auditionSeating-fill-seats-form')
+ @include('tabulation.auditionSeating-show-proposed-seats')
@endif
- @if($auditionComplete)
- @php
- $entriesToSeat = $entries->reject(function ($entry) {
- return $entry->hasFlag('declined');
- });
- @endphp
- @foreach($ensembleLimits as $ensembleLimit)
-
- {{ $ensembleLimit->ensemble->name }}
-
- @for($n=1; $n <= $ensembleLimit->maximum_accepted; $n++)
- @php
- $entry = $entriesToSeat->shift();
- if (is_null($entry)) continue;
- @endphp
-
- {{ $n }} - {{ $entry->student->full_name() }}
-
- @endfor
-
-
- @endforeach
- @endif
-
-