Seats can be declined from seating page. Doubler system functioning.
This commit is contained in:
parent
63b60e6bf5
commit
e1719c64fa
|
|
@ -2,10 +2,6 @@
|
||||||
|
|
||||||
namespace App\Http\Controllers;
|
namespace App\Http\Controllers;
|
||||||
|
|
||||||
use App\Actions\Entries\GetEntrySeatingResult;
|
|
||||||
use App\Actions\Tabulation\CalculateEntryScore;
|
|
||||||
use App\Actions\Tabulation\RankAuditionEntries;
|
|
||||||
use App\Models\AuditionFlag;
|
|
||||||
use App\Models\School;
|
use App\Models\School;
|
||||||
use App\Services\Invoice\InvoiceDataService;
|
use App\Services\Invoice\InvoiceDataService;
|
||||||
use Illuminate\Support\Facades\Auth;
|
use Illuminate\Support\Facades\Auth;
|
||||||
|
|
@ -28,33 +24,8 @@ class DashboardController extends Controller
|
||||||
}
|
}
|
||||||
|
|
||||||
public function dashboard(
|
public function dashboard(
|
||||||
CalculateEntryScore $scoreCalc,
|
|
||||||
GetEntrySeatingResult $resultGenerator,
|
|
||||||
RankAuditionEntries $ranker
|
|
||||||
) {
|
) {
|
||||||
|
return view('dashboard.dashboard');
|
||||||
// Info for director results report
|
|
||||||
$entries = Auth::user()->entries;
|
|
||||||
$entries = $entries->filter(function ($entry) {
|
|
||||||
return $entry->audition->hasFlag('seats_published');
|
|
||||||
});
|
|
||||||
$entries = $entries->sortBy(function ($entry) {
|
|
||||||
return $entry->student->full_name(true);
|
|
||||||
});
|
|
||||||
$scores = [];
|
|
||||||
$results = [];
|
|
||||||
$ranks = [];
|
|
||||||
foreach ($entries as $entry) {
|
|
||||||
$results[$entry->id] = $resultGenerator->getResult($entry);
|
|
||||||
if (! $entry->hasFlag('no_show') && ! $entry->hasFlag('failed_prelim')) {
|
|
||||||
$scores[$entry->id] = $scoreCalc->calculate('seating', $entry);
|
|
||||||
$auditionResults = $ranker->rank('seating', $entry->audition);
|
|
||||||
$ranks[$entry->id] = $auditionResults->firstWhere('id', $entry->id)->raw_rank;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
$showRecapLink = AuditionFlag::where('flag_name', 'seats_published')->count() > 0;
|
|
||||||
|
|
||||||
return view('dashboard.dashboard', compact('entries', 'scores', 'results', 'ranks', 'showRecapLink'));
|
|
||||||
// return view('dashboard.dashboard');
|
// return view('dashboard.dashboard');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -7,6 +7,7 @@ use App\Actions\Tabulation\RankAuditionEntries;
|
||||||
use App\Http\Controllers\Controller;
|
use App\Http\Controllers\Controller;
|
||||||
use App\Models\Audition;
|
use App\Models\Audition;
|
||||||
use App\Models\Doubler;
|
use App\Models\Doubler;
|
||||||
|
use App\Models\Entry;
|
||||||
use Illuminate\Http\Request;
|
use Illuminate\Http\Request;
|
||||||
|
|
||||||
class SeatAuditionFormController extends Controller
|
class SeatAuditionFormController extends Controller
|
||||||
|
|
@ -66,6 +67,14 @@ class SeatAuditionFormController extends Controller
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function declineSeat(Audition $audition, Entry $entry)
|
||||||
|
{
|
||||||
|
$entry->addFlag('declined');
|
||||||
|
|
||||||
|
return redirect()->route('seating.audition', ['audition' => $audition->id])->with('success',
|
||||||
|
$entry->student->full_name().' has declined '.$audition->name);
|
||||||
|
}
|
||||||
|
|
||||||
protected function pickRightPanel(Audition $audition, array $seatable)
|
protected function pickRightPanel(Audition $audition, array $seatable)
|
||||||
{
|
{
|
||||||
if ($audition->hasFlag('seats_published')) {
|
if ($audition->hasFlag('seats_published')) {
|
||||||
|
|
|
||||||
|
|
@ -27,24 +27,24 @@
|
||||||
</x-card.list.row>
|
</x-card.list.row>
|
||||||
</a>
|
</a>
|
||||||
@endif
|
@endif
|
||||||
@if($showRecapLink)
|
{{-- @if($showRecapLink)--}}
|
||||||
<a href="{{ route('recap.selectAudition') }}">
|
{{-- <a href="{{ route('recap.selectAudition') }}">--}}
|
||||||
<x-card.list.row class="hover:bg-gray-200">
|
{{-- <x-card.list.row class="hover:bg-gray-200">--}}
|
||||||
Audition Score Recaps
|
{{-- Audition Score Recaps--}}
|
||||||
</x-card.list.row>
|
{{-- </x-card.list.row>--}}
|
||||||
</a>
|
{{-- </a>--}}
|
||||||
@endif
|
{{-- @endif--}}
|
||||||
</x-card.list.body>
|
</x-card.list.body>
|
||||||
</x-card.card>
|
</x-card.card>
|
||||||
</div>
|
</div>
|
||||||
@if(Auth::user()->school_id)
|
{{-- @if(Auth::user()->school_id)--}}
|
||||||
<div class="md:col-span-3 pl-3"> <!--Column 2 Results -->
|
{{-- <div class="md:col-span-3 pl-3"> <!--Column 2 Results -->--}}
|
||||||
<x-card.card>
|
{{-- <x-card.card>--}}
|
||||||
<x-card.heading>My Results</x-card.heading>
|
{{-- <x-card.heading>My Results</x-card.heading>--}}
|
||||||
@include('dashboard.results-table')
|
{{-- @include('dashboard.results-table')--}}
|
||||||
</x-card.card>
|
{{-- </x-card.card>--}}
|
||||||
</div>
|
{{-- </div>--}}
|
||||||
@endif
|
{{-- @endif--}}
|
||||||
|
|
||||||
<div>
|
<div>
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -27,7 +27,9 @@
|
||||||
@endforeach
|
@endforeach
|
||||||
</div>
|
</div>
|
||||||
<div class="mt-3">
|
<div class="mt-3">
|
||||||
<x-form.button>Decline {{ $de->audition->name }}</x-form.button>
|
<x-form.form method="POST" action="{{ route('seating.audition.decline',[$audition,$de]) }}">
|
||||||
|
<x-form.button>Decline {{ $de->audition->name }}</x-form.button>
|
||||||
|
</x-form.form>
|
||||||
</div>
|
</div>
|
||||||
@endif
|
@endif
|
||||||
@endif
|
@endif
|
||||||
|
|
|
||||||
|
|
@ -43,8 +43,18 @@
|
||||||
@elseif($entry->hasFlag('declined'))
|
@elseif($entry->hasFlag('declined'))
|
||||||
DECLINED
|
DECLINED
|
||||||
@else
|
@else
|
||||||
UNDECIDED
|
@if($request = $entry->student->doublerRequests()->where('event_id',$entry->audition->event_id)->first())
|
||||||
|
<div class="border-2 border-gray-200 p-2 m-2"> {{-- Begin block seating request --}}
|
||||||
|
<div class="font-semibold mb-2">
|
||||||
|
Request
|
||||||
|
</div>
|
||||||
|
<div class="text-wrap">
|
||||||
|
<p>{{ $request->request }}</p>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
@endif
|
||||||
@foreach($entry->student->entriesForEvent($entry->audition->event_id) as $de)
|
@foreach($entry->student->entriesForEvent($entry->audition->event_id) as $de)
|
||||||
@include('tabulation.auditionSeating-doubler-block')
|
@include('tabulation.auditionSeating-doubler-block')
|
||||||
@endforeach
|
@endforeach
|
||||||
|
|
|
||||||
|
|
@ -43,6 +43,7 @@ Route::middleware(['auth', 'verified', CheckIfCanTab::class])->group(function ()
|
||||||
Route::prefix('seating/')->group(function () {
|
Route::prefix('seating/')->group(function () {
|
||||||
Route::get('/', SeatingStatusController::class)->name('seating.status');
|
Route::get('/', SeatingStatusController::class)->name('seating.status');
|
||||||
Route::get('/{audition}', [SeatAuditionFormController::class, 'showForm'])->name('seating.audition');
|
Route::get('/{audition}', [SeatAuditionFormController::class, 'showForm'])->name('seating.audition');
|
||||||
|
Route::post('/{audition}/{entry}/decline', [SeatAuditionFormController::class, 'declineSeat'])->name('seating.audition.decline');
|
||||||
Route::post('/{audition}/publish',
|
Route::post('/{audition}/publish',
|
||||||
[SeatingPublicationController::class, 'publishSeats'])->name('seating.audition.publish');
|
[SeatingPublicationController::class, 'publishSeats'])->name('seating.audition.publish');
|
||||||
Route::post('/{audition}/unpublish',
|
Route::post('/{audition}/unpublish',
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue