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;
|
||||
|
||||
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\Services\Invoice\InvoiceDataService;
|
||||
use Illuminate\Support\Facades\Auth;
|
||||
|
|
@ -28,33 +24,8 @@ class DashboardController extends Controller
|
|||
}
|
||||
|
||||
public function dashboard(
|
||||
CalculateEntryScore $scoreCalc,
|
||||
GetEntrySeatingResult $resultGenerator,
|
||||
RankAuditionEntries $ranker
|
||||
) {
|
||||
|
||||
// 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\Models\Audition;
|
||||
use App\Models\Doubler;
|
||||
use App\Models\Entry;
|
||||
use Illuminate\Http\Request;
|
||||
|
||||
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)
|
||||
{
|
||||
if ($audition->hasFlag('seats_published')) {
|
||||
|
|
|
|||
|
|
@ -27,24 +27,24 @@
|
|||
</x-card.list.row>
|
||||
</a>
|
||||
@endif
|
||||
@if($showRecapLink)
|
||||
<a href="{{ route('recap.selectAudition') }}">
|
||||
<x-card.list.row class="hover:bg-gray-200">
|
||||
Audition Score Recaps
|
||||
</x-card.list.row>
|
||||
</a>
|
||||
@endif
|
||||
{{-- @if($showRecapLink)--}}
|
||||
{{-- <a href="{{ route('recap.selectAudition') }}">--}}
|
||||
{{-- <x-card.list.row class="hover:bg-gray-200">--}}
|
||||
{{-- Audition Score Recaps--}}
|
||||
{{-- </x-card.list.row>--}}
|
||||
{{-- </a>--}}
|
||||
{{-- @endif--}}
|
||||
</x-card.list.body>
|
||||
</x-card.card>
|
||||
</div>
|
||||
@if(Auth::user()->school_id)
|
||||
<div class="md:col-span-3 pl-3"> <!--Column 2 Results -->
|
||||
<x-card.card>
|
||||
<x-card.heading>My Results</x-card.heading>
|
||||
@include('dashboard.results-table')
|
||||
</x-card.card>
|
||||
</div>
|
||||
@endif
|
||||
{{-- @if(Auth::user()->school_id)--}}
|
||||
{{-- <div class="md:col-span-3 pl-3"> <!--Column 2 Results -->--}}
|
||||
{{-- <x-card.card>--}}
|
||||
{{-- <x-card.heading>My Results</x-card.heading>--}}
|
||||
{{-- @include('dashboard.results-table')--}}
|
||||
{{-- </x-card.card>--}}
|
||||
{{-- </div>--}}
|
||||
{{-- @endif--}}
|
||||
|
||||
<div>
|
||||
|
||||
|
|
|
|||
|
|
@ -27,7 +27,9 @@
|
|||
@endforeach
|
||||
</div>
|
||||
<div class="mt-3">
|
||||
<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>
|
||||
@endif
|
||||
@endif
|
||||
|
|
|
|||
|
|
@ -43,8 +43,18 @@
|
|||
@elseif($entry->hasFlag('declined'))
|
||||
DECLINED
|
||||
@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)
|
||||
@include('tabulation.auditionSeating-doubler-block')
|
||||
@endforeach
|
||||
|
|
|
|||
|
|
@ -43,6 +43,7 @@ Route::middleware(['auth', 'verified', CheckIfCanTab::class])->group(function ()
|
|||
Route::prefix('seating/')->group(function () {
|
||||
Route::get('/', SeatingStatusController::class)->name('seating.status');
|
||||
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',
|
||||
[SeatingPublicationController::class, 'publishSeats'])->name('seating.audition.publish');
|
||||
Route::post('/{audition}/unpublish',
|
||||
|
|
|
|||
Loading…
Reference in New Issue