Compare commits
5 Commits
master
...
split_scor
| Author | SHA1 | Date |
|---|---|---|
|
|
ea98177770 | |
|
|
b6206976a1 | |
|
|
c60f1714c1 | |
|
|
797d4910c5 | |
|
|
71fa8c4b06 |
|
|
@ -78,15 +78,11 @@ class PrintSignInSheets
|
||||||
|
|
||||||
public function addEntryRow(Entry $entry)
|
public function addEntryRow(Entry $entry)
|
||||||
{
|
{
|
||||||
$nameLine = $entry->student->full_name();
|
|
||||||
if ($entry->student->isDoublerInEvent($entry->audition->event_id)) {
|
|
||||||
$nameLine .= ' (D)';
|
|
||||||
}
|
|
||||||
$this->pdf->Cell($this->columnWidth['id'], $this->bodyRowHeight, $entry->id, 1, 0, 'L');
|
$this->pdf->Cell($this->columnWidth['id'], $this->bodyRowHeight, $entry->id, 1, 0, 'L');
|
||||||
$this->pdf->Cell($this->columnWidth['instrument'], $this->bodyRowHeight, $entry->audition->name, 1, 0,
|
$this->pdf->Cell($this->columnWidth['instrument'], $this->bodyRowHeight, $entry->audition->name, 1, 0,
|
||||||
'L');
|
'L');
|
||||||
$this->pdf->Cell($this->columnWidth['drawNumber'], $this->bodyRowHeight, $entry->draw_number, 1, 0, 'L');
|
$this->pdf->Cell($this->columnWidth['drawNumber'], $this->bodyRowHeight, $entry->draw_number, 1, 0, 'L');
|
||||||
$this->pdf->Cell($this->columnWidth['name'], $this->bodyRowHeight, $nameLine, 1, 0, 'L');
|
$this->pdf->Cell($this->columnWidth['name'], $this->bodyRowHeight, $entry->student->full_name(), 1, 0, 'L');
|
||||||
$this->pdf->Cell($this->columnWidth['school'], $this->bodyRowHeight, $entry->student->school->name, 1, 0, 'L');
|
$this->pdf->Cell($this->columnWidth['school'], $this->bodyRowHeight, $entry->student->school->name, 1, 0, 'L');
|
||||||
$this->pdf->Cell(0, $this->bodyRowHeight, ' ', 1, 1, 'L');
|
$this->pdf->Cell(0, $this->bodyRowHeight, ' ', 1, 1, 'L');
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -58,37 +58,17 @@ class QuarterPageCards implements PrintCards
|
||||||
$this->pdf->Cell(4.5, .5, $entry->audition->name.' #'.$entry->draw_number);
|
$this->pdf->Cell(4.5, .5, $entry->audition->name.' #'.$entry->draw_number);
|
||||||
|
|
||||||
// Fill in student information
|
// Fill in student information
|
||||||
$nameLine = $entry->student->full_name();
|
|
||||||
if ($entry->student->isDoublerInEvent($entry->audition->event_id)) {
|
|
||||||
$nameLine .= ' (D)';
|
|
||||||
}
|
|
||||||
$this->pdf->SetFont('Arial', '', 10);
|
$this->pdf->SetFont('Arial', '', 10);
|
||||||
$xLoc = $this->offset[$this->quadOn][0] + 1;
|
$xLoc = $this->offset[$this->quadOn][0] + 1;
|
||||||
$yLoc = $this->offset[$this->quadOn][1] + 3.1;
|
$yLoc = $this->offset[$this->quadOn][1] + 3.1;
|
||||||
$this->pdf->setXY($xLoc, $yLoc);
|
$this->pdf->setXY($xLoc, $yLoc);
|
||||||
$this->pdf->Cell(4.5, .25, $nameLine);
|
$this->pdf->Cell(4.5, .25, $entry->student->full_name());
|
||||||
$this->pdf->setXY($xLoc, $yLoc + .25);
|
$this->pdf->setXY($xLoc, $yLoc + .25);
|
||||||
$this->pdf->Cell(4.5, .25, $entry->student->school->name);
|
$this->pdf->Cell(4.5, .25, $entry->student->school->name);
|
||||||
$this->pdf->setXY($xLoc, $yLoc + .5);
|
$this->pdf->setXY($xLoc, $yLoc + .5);
|
||||||
if (! is_null($entry->audition->room_id)) {
|
if (! is_null($entry->audition->room_id)) {
|
||||||
$this->pdf->Cell(4.5, .25, $entry->audition->room->name);
|
$this->pdf->Cell(4.5, .25, $entry->audition->room->name);
|
||||||
}
|
}
|
||||||
if (auditionSetting('advanceTo')) {
|
|
||||||
$as = false;
|
|
||||||
$this->pdf->setXY($xLoc, $yLoc - 1);
|
|
||||||
$auditioningFor = 'Auditioning for: ';
|
|
||||||
if ($entry->for_seating) {
|
|
||||||
$auditioningFor .= auditionSetting('auditionAbbreviation');
|
|
||||||
$as = true;
|
|
||||||
}
|
|
||||||
if ($entry->for_advancement) {
|
|
||||||
if ($as) {
|
|
||||||
$auditioningFor .= ' / ';
|
|
||||||
}
|
|
||||||
$auditioningFor .= auditionSetting('advanceTo');
|
|
||||||
}
|
|
||||||
$this->pdf->Cell(4.5, .25, $auditioningFor);
|
|
||||||
}
|
|
||||||
$this->quadOn++;
|
$this->quadOn++;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -33,7 +33,7 @@ class GetExportData
|
||||||
foreach ($events as $event) {
|
foreach ($events as $event) {
|
||||||
$auditions = $event->auditions;
|
$auditions = $event->auditions;
|
||||||
foreach ($auditions as $audition) {
|
foreach ($auditions as $audition) {
|
||||||
$entries = $ranker($audition, 'seating');
|
$entries = $ranker->rank('seating', $audition);
|
||||||
foreach ($entries as $entry) {
|
foreach ($entries as $entry) {
|
||||||
$thisRow = $audition->name.',';
|
$thisRow = $audition->name.',';
|
||||||
$thisRow .= $entry->raw_rank ?? '';
|
$thisRow .= $entry->raw_rank ?? '';
|
||||||
|
|
@ -41,7 +41,7 @@ class GetExportData
|
||||||
$thisRow .= $entry->student->full_name().',';
|
$thisRow .= $entry->student->full_name().',';
|
||||||
$thisRow .= $entry->student->school->name.',';
|
$thisRow .= $entry->student->school->name.',';
|
||||||
$thisRow .= $entry->student->grade.',';
|
$thisRow .= $entry->student->grade.',';
|
||||||
$thisRow .= $entry->totalScore->seating_total ?? '';
|
$thisRow .= $entry->score_totals[0] ?? '';
|
||||||
$thisRow .= ',';
|
$thisRow .= ',';
|
||||||
if ($entry->hasFlag('failed_prelim')) {
|
if ($entry->hasFlag('failed_prelim')) {
|
||||||
$thisRow .= 'Failed Prelim';
|
$thisRow .= 'Failed Prelim';
|
||||||
|
|
|
||||||
|
|
@ -12,6 +12,7 @@ use App\Models\AuditLogEntry;
|
||||||
use App\Models\Entry;
|
use App\Models\Entry;
|
||||||
use App\Models\EntryTotalScore;
|
use App\Models\EntryTotalScore;
|
||||||
use App\Models\ScoreSheet;
|
use App\Models\ScoreSheet;
|
||||||
|
use App\Models\SubscoreDefinition;
|
||||||
use App\Models\User;
|
use App\Models\User;
|
||||||
use Illuminate\Support\Facades\DB;
|
use Illuminate\Support\Facades\DB;
|
||||||
|
|
||||||
|
|
@ -70,7 +71,12 @@ class EnterScore
|
||||||
}
|
}
|
||||||
|
|
||||||
// Check the validity of submitted subscores, format array for storage, and sum score
|
// Check the validity of submitted subscores, format array for storage, and sum score
|
||||||
|
if ($entry->audition->splitScoreDefinition) {
|
||||||
|
$subscoreIDs = $entry->audition->splitScoreDefinition->subscoresForJudge($user);
|
||||||
|
$subscoresRequired = SubscoreDefinition::findMany($subscoreIDs);
|
||||||
|
} else {
|
||||||
$subscoresRequired = $entry->audition->scoringGuide->subscores;
|
$subscoresRequired = $entry->audition->scoringGuide->subscores;
|
||||||
|
}
|
||||||
$subscoresStorageArray = [];
|
$subscoresStorageArray = [];
|
||||||
$seatingTotal = 0;
|
$seatingTotal = 0;
|
||||||
$seatingMaxPossible = 0;
|
$seatingMaxPossible = 0;
|
||||||
|
|
|
||||||
|
|
@ -24,7 +24,7 @@ class RankAuditionEntries
|
||||||
*
|
*
|
||||||
* @throws AuditionAdminException
|
* @throws AuditionAdminException
|
||||||
*/
|
*/
|
||||||
public function __invoke(Audition $audition, string $rank_type, bool $pullDeclinedEntries = true): Collection|Entry
|
public function __invoke(Audition $audition, string $rank_type): Collection|Entry
|
||||||
{
|
{
|
||||||
if ($rank_type !== 'seating' && $rank_type !== 'advancement') {
|
if ($rank_type !== 'seating' && $rank_type !== 'advancement') {
|
||||||
throw new AuditionAdminException('Invalid rank type (must be seating or advancement)');
|
throw new AuditionAdminException('Invalid rank type (must be seating or advancement)');
|
||||||
|
|
@ -33,8 +33,8 @@ class RankAuditionEntries
|
||||||
$cache_duration = 15;
|
$cache_duration = 15;
|
||||||
|
|
||||||
if ($rank_type === 'seating') {
|
if ($rank_type === 'seating') {
|
||||||
return cache()->remember('rank_seating_'.$audition->id, $cache_duration, function () use ($audition, $pullDeclinedEntries) {
|
return cache()->remember('rank_seating_'.$audition->id, $cache_duration, function () use ($audition) {
|
||||||
return $this->get_seating_ranks($audition, $pullDeclinedEntries);
|
return $this->get_seating_ranks($audition);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -44,7 +44,7 @@ class RankAuditionEntries
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private function get_seating_ranks(Audition $audition, bool $pullDeclinedEntries = true): Collection|Entry
|
private function get_seating_ranks(Audition $audition): Collection|Entry
|
||||||
{
|
{
|
||||||
if ($audition->bonusScore()->count() > 0) {
|
if ($audition->bonusScore()->count() > 0) {
|
||||||
$totalColumn = 'seating_total_with_bonus';
|
$totalColumn = 'seating_total_with_bonus';
|
||||||
|
|
@ -53,7 +53,6 @@ class RankAuditionEntries
|
||||||
}
|
}
|
||||||
|
|
||||||
$sortedEntries = $audition->entries()
|
$sortedEntries = $audition->entries()
|
||||||
->where('for_seating', true)
|
|
||||||
->whereHas('totalScore')
|
->whereHas('totalScore')
|
||||||
->with('totalScore')
|
->with('totalScore')
|
||||||
->with('student.school')
|
->with('student.school')
|
||||||
|
|
@ -75,7 +74,7 @@ class RankAuditionEntries
|
||||||
|
|
||||||
$rankOn = 1;
|
$rankOn = 1;
|
||||||
foreach ($sortedEntries as $entry) {
|
foreach ($sortedEntries as $entry) {
|
||||||
if ($entry->hasFlag('declined') && $pullDeclinedEntries) {
|
if ($entry->hasFlag('declined')) {
|
||||||
$entry->seatingRank = 'declined';
|
$entry->seatingRank = 'declined';
|
||||||
} else {
|
} else {
|
||||||
$entry->seatingRank = $rankOn;
|
$entry->seatingRank = $rankOn;
|
||||||
|
|
|
||||||
|
|
@ -65,14 +65,14 @@ class YearEndCleanup
|
||||||
|
|
||||||
if (is_array($options)) {
|
if (is_array($options)) {
|
||||||
if (in_array('deleteRooms', $options)) {
|
if (in_array('deleteRooms', $options)) {
|
||||||
DB::table('auditions')->update(['room_id' => 0]);
|
DB::table('auditions')->update(['room_id' => null]);
|
||||||
DB::table('auditions')->update(['order_in_room' => '0']);
|
DB::table('auditions')->update(['order_in_room' => '0']);
|
||||||
DB::table('room_user')->truncate();
|
DB::table('room_user')->truncate();
|
||||||
DB::table('rooms')->where('id', '>', 0)->delete();
|
DB::table('rooms')->delete();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (in_array('removeAuditionsFromRoom', $options)) {
|
if (in_array('removeAuditionsFromRoom', $options)) {
|
||||||
DB::table('auditions')->update(['room_id' => 0]);
|
DB::table('auditions')->update(['room_id' => null]);
|
||||||
DB::table('auditions')->update(['order_in_room' => '0']);
|
DB::table('auditions')->update(['order_in_room' => '0']);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,41 +0,0 @@
|
||||||
<?php
|
|
||||||
|
|
||||||
namespace App\Console\Commands;
|
|
||||||
|
|
||||||
use App\Actions\Tabulation\EnterScore;
|
|
||||||
use App\Models\ScoreSheet;
|
|
||||||
use Illuminate\Console\Command;
|
|
||||||
|
|
||||||
class RecalculateJudgeTotalsCommand extends Command
|
|
||||||
{
|
|
||||||
protected $signature = 'audition:recalculate-judge-totals';
|
|
||||||
|
|
||||||
protected $description = 'Recalculates total scores for all score sheets for unpubished auditions';
|
|
||||||
|
|
||||||
public function handle(): void
|
|
||||||
{
|
|
||||||
$this->info('Starting score recalculation...');
|
|
||||||
$scoreSheets = ScoreSheet::all();
|
|
||||||
foreach ($scoreSheets as $scoreSheet) {
|
|
||||||
if ($scoreSheet->entry->audition->hasFlag('seats_published')) {
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
$this->recalculate($scoreSheet);
|
|
||||||
}
|
|
||||||
|
|
||||||
$this->info('Score recalculation completed successfully.');
|
|
||||||
}
|
|
||||||
|
|
||||||
private function recalculate(ScoreSheet|int $scoreSheet): void
|
|
||||||
{
|
|
||||||
if (is_int($scoreSheet)) {
|
|
||||||
$scoreSheet = ScoreSheet::findOrFail($scoreSheet);
|
|
||||||
}
|
|
||||||
$scribe = app()->make(EnterScore::class);
|
|
||||||
$scoreSubmission = [];
|
|
||||||
foreach ($scoreSheet->subscores as $subscore) {
|
|
||||||
$scoreSubmission[$subscore['subscore_id']] = $subscore['score'];
|
|
||||||
}
|
|
||||||
$scribe($scoreSheet->judge, $scoreSheet->entry, $scoreSubmission, $scoreSheet);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
@ -8,14 +8,14 @@ use Illuminate\Console\Command;
|
||||||
/**
|
/**
|
||||||
* @codeCoverageIgnore
|
* @codeCoverageIgnore
|
||||||
*/
|
*/
|
||||||
class RecalculateTotalScores extends Command
|
class RecalculateScores extends Command
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
* The name and signature of the console command.
|
* The name and signature of the console command.
|
||||||
*
|
*
|
||||||
* @var string
|
* @var string
|
||||||
*/
|
*/
|
||||||
protected $signature = 'audition:recalculate-total-scores';
|
protected $signature = 'audition:recalculate-scores';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The console command description.
|
* The console command description.
|
||||||
|
|
@ -6,4 +6,5 @@ enum UserFlags: string
|
||||||
{
|
{
|
||||||
case HEAD_DIRECTOR = 'head_director';
|
case HEAD_DIRECTOR = 'head_director';
|
||||||
case MONITOR = 'monitor';
|
case MONITOR = 'monitor';
|
||||||
|
case CAN_IMPERSONATE = 'can_impersonate';
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,78 @@
|
||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Http\Controllers\Admin;
|
||||||
|
|
||||||
|
use App\Http\Controllers\Controller;
|
||||||
|
use App\Models\User;
|
||||||
|
use Illuminate\Http\Request;
|
||||||
|
use Illuminate\Support\Facades\Auth;
|
||||||
|
|
||||||
|
use function auditionLog;
|
||||||
|
|
||||||
|
class ImpersonationController extends Controller
|
||||||
|
{
|
||||||
|
public function start(Request $request)
|
||||||
|
{
|
||||||
|
$user = User::findOrFail($request->user_id);
|
||||||
|
$admin = $request->user();
|
||||||
|
|
||||||
|
if (! $admin->can('impersonate', $user)) {
|
||||||
|
abort(403);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Prevent impersonating yourself or impersonating if already impersonating
|
||||||
|
if ($admin->id === $user->id || session()->has('impersonator_id')) {
|
||||||
|
return back()->with('error', 'Cannot impersonate.');
|
||||||
|
}
|
||||||
|
|
||||||
|
// Save the original admin id and optionally guard
|
||||||
|
session()->put('impersonator_id', $admin->id);
|
||||||
|
session()->put('impersonator_started_at', now()->toDateTimeString());
|
||||||
|
|
||||||
|
auditionLog('Started impersonating '.$user->full_name().' - '.$user->email, ['users' => [$user->id]]);
|
||||||
|
|
||||||
|
// Switch user
|
||||||
|
Auth::loginUsingId($user->getAuthIdentifier());
|
||||||
|
|
||||||
|
// Regenerate session to mitigate fixation
|
||||||
|
$request->session()->regenerate();
|
||||||
|
|
||||||
|
return redirect(route('dashboard'))->with('success', 'Now impersonating '.$user->email);
|
||||||
|
}
|
||||||
|
|
||||||
|
public function stop(Request $request)
|
||||||
|
{
|
||||||
|
$impersonatedUser = Auth::user();
|
||||||
|
$impersonatorId = session('impersonator_id');
|
||||||
|
if (! $impersonatorId) {
|
||||||
|
return back()->with('error', 'Not impersonating.');
|
||||||
|
}
|
||||||
|
|
||||||
|
// Restore original admin
|
||||||
|
$admin = User::find($impersonatorId);
|
||||||
|
if ($admin) {
|
||||||
|
Auth::loginUsingId($admin->getAuthIdentifier());
|
||||||
|
} else {
|
||||||
|
// If admin was deleted, just log out
|
||||||
|
Auth::logout();
|
||||||
|
}
|
||||||
|
|
||||||
|
auditionLog('Stopped impersonating '.$impersonatedUser->full_name().' - '.$impersonatedUser->email, ['users' => [$impersonatedUser->id]]);
|
||||||
|
|
||||||
|
// Clear impersonation data
|
||||||
|
session()->forget(['impersonator_id', 'impersonator_started_at']);
|
||||||
|
|
||||||
|
// Regenerate session
|
||||||
|
$request->session()->regenerate();
|
||||||
|
|
||||||
|
return redirect(route('dashboard'))->with('success', 'Stopped impersonation.');
|
||||||
|
}
|
||||||
|
|
||||||
|
public function index()
|
||||||
|
{
|
||||||
|
|
||||||
|
$users = User::where('id', '!=', auth()->id())->get();
|
||||||
|
|
||||||
|
return view('admin.impersonation.index', compact('users'));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -28,14 +28,10 @@ class PrintCards extends Controller
|
||||||
public function print(\App\Actions\Print\PrintCards $printer)
|
public function print(\App\Actions\Print\PrintCards $printer)
|
||||||
{
|
{
|
||||||
//dump(request()->all());
|
//dump(request()->all());
|
||||||
// if (request()->audition == null) {
|
if (request()->audition == null) {
|
||||||
// return redirect()->back()->with('error', 'You must specify at least one audition');
|
return redirect()->back()->with('error', 'You must specify at least one audition');
|
||||||
// }
|
|
||||||
if (request()->audition) {
|
|
||||||
$selectedAuditionIds = array_keys(request()->audition);
|
|
||||||
} else {
|
|
||||||
$selectedAuditionIds = [];
|
|
||||||
}
|
}
|
||||||
|
$selectedAuditionIds = array_keys(request()->audition);
|
||||||
$cardQuery = Entry::whereIn('audition_id', $selectedAuditionIds);
|
$cardQuery = Entry::whereIn('audition_id', $selectedAuditionIds);
|
||||||
|
|
||||||
// Process Filters
|
// Process Filters
|
||||||
|
|
|
||||||
|
|
@ -1,16 +0,0 @@
|
||||||
<?php
|
|
||||||
|
|
||||||
namespace App\Http\Controllers\Admin;
|
|
||||||
|
|
||||||
use App\Http\Controllers\Controller;
|
|
||||||
use App\Models\School;
|
|
||||||
|
|
||||||
class SchoolEmailDomainController extends Controller
|
|
||||||
{
|
|
||||||
public function index()
|
|
||||||
{
|
|
||||||
$schools = School::with('emailDomains')->get();
|
|
||||||
|
|
||||||
return view('admin.schools.email_domains_index', compact('schools'));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
@ -110,10 +110,6 @@ class ScoringGuideController extends Controller
|
||||||
'Cannot update a subscore for a different scoring guide');
|
'Cannot update a subscore for a different scoring guide');
|
||||||
}
|
}
|
||||||
$validateData = $validateData = $request->validated();
|
$validateData = $validateData = $request->validated();
|
||||||
if (! auditionSetting('advanceTo')) {
|
|
||||||
$validateData['for_advance'] = 0;
|
|
||||||
$validateData['for_seating'] = 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
$subscore->update([
|
$subscore->update([
|
||||||
'name' => $validateData['name'],
|
'name' => $validateData['name'],
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,78 @@
|
||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Http\Controllers\Admin;
|
||||||
|
|
||||||
|
use App\Http\Controllers\Controller;
|
||||||
|
use App\Http\Requests\EditSplitScoreDefinitionRequest;
|
||||||
|
use App\Models\Audition;
|
||||||
|
use App\Models\SplitScoreDefinition;
|
||||||
|
use Illuminate\Http\Request;
|
||||||
|
|
||||||
|
class SplitScoreDefinitionController extends Controller
|
||||||
|
{
|
||||||
|
public function index()
|
||||||
|
{
|
||||||
|
$splitScores = SplitScoreDefinition::all();
|
||||||
|
|
||||||
|
return view('admin.split_score_definitions.index', compact('splitScores'));
|
||||||
|
}
|
||||||
|
|
||||||
|
public function create()
|
||||||
|
{
|
||||||
|
$availableAuditions = Audition::doesntHave('splitScoreDefinition')->get();
|
||||||
|
|
||||||
|
return view('admin.split_score_definitions.create', compact('availableAuditions'));
|
||||||
|
}
|
||||||
|
|
||||||
|
public function store(Request $request)
|
||||||
|
{
|
||||||
|
$validated = $request->validate([
|
||||||
|
'audition_id' => 'required|exists:auditions,id|unique:split_score_definitions,audition_id',
|
||||||
|
]);
|
||||||
|
$newSplit = SplitScoreDefinition::create([
|
||||||
|
'audition_id' => $validated['audition_id'],
|
||||||
|
'splits' => [],
|
||||||
|
]);
|
||||||
|
|
||||||
|
return redirect()->route('admin.split_score_definitions.edit', $newSplit)->with('success',
|
||||||
|
'Split score definition created');
|
||||||
|
}
|
||||||
|
|
||||||
|
public function edit(SplitScoreDefinition $splitScoreDefinition)
|
||||||
|
{
|
||||||
|
$subscores = $splitScoreDefinition->audition->scoringGuide->subscores;
|
||||||
|
$judges = $splitScoreDefinition->audition->room->judges;
|
||||||
|
|
||||||
|
return view('admin.split_score_definitions.edit', compact('splitScoreDefinition', 'subscores', 'judges'));
|
||||||
|
}
|
||||||
|
|
||||||
|
public function update(EditSplitScoreDefinitionRequest $request, SplitScoreDefinition $splitScoreDefinition)
|
||||||
|
{
|
||||||
|
$savedSplits = $splitScoreDefinition->splits;
|
||||||
|
if ($request->validated()['split'] ?? false) {
|
||||||
|
$newSplit = [];
|
||||||
|
$submittedSplitData = $request->validated()['split'];
|
||||||
|
foreach ($submittedSplitData as $splitName => $splitData) {
|
||||||
|
$name = $splitName;
|
||||||
|
$judges = array_values($splitData['judges'] ?? []);
|
||||||
|
$subscores = array_values($splitData['subscores'] ?? []);
|
||||||
|
$newSplit[$name] = ['judges' => $judges, 'subscores' => $subscores];
|
||||||
|
}
|
||||||
|
$splitScoreDefinition->splits = $newSplit;
|
||||||
|
$splitScoreDefinition->save();
|
||||||
|
|
||||||
|
}
|
||||||
|
if ($request->validated()['new_split'] ?? false) {
|
||||||
|
$savedSplits[$request->validated()['new_split']] = ['judges' => [], 'subscores' => []];
|
||||||
|
$splitScoreDefinition->splits = $savedSplits;
|
||||||
|
$splitScoreDefinition->save();
|
||||||
|
}
|
||||||
|
|
||||||
|
return redirect()->route('admin.split_score_definitions.edit', $splitScoreDefinition);
|
||||||
|
}
|
||||||
|
|
||||||
|
public function destroy(SplitScoreDefinition $scoreDefinition)
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -3,12 +3,12 @@
|
||||||
namespace App\Http\Controllers\Judging;
|
namespace App\Http\Controllers\Judging;
|
||||||
|
|
||||||
use App\Actions\Tabulation\EnterScore;
|
use App\Actions\Tabulation\EnterScore;
|
||||||
use App\Exceptions\AuditionAdminException;
|
|
||||||
use App\Http\Controllers\Controller;
|
use App\Http\Controllers\Controller;
|
||||||
use App\Models\Audition;
|
use App\Models\Audition;
|
||||||
use App\Models\Entry;
|
use App\Models\Entry;
|
||||||
use App\Models\JudgeAdvancementVote;
|
use App\Models\JudgeAdvancementVote;
|
||||||
use App\Models\ScoreSheet;
|
use App\Models\ScoreSheet;
|
||||||
|
use App\Models\SubscoreDefinition;
|
||||||
use App\Services\AuditionService;
|
use App\Services\AuditionService;
|
||||||
use Illuminate\Http\Request;
|
use Illuminate\Http\Request;
|
||||||
use Illuminate\Support\Facades\Auth;
|
use Illuminate\Support\Facades\Auth;
|
||||||
|
|
@ -47,7 +47,12 @@ class JudgingController extends Controller
|
||||||
if ($audition->prelimDefinition) {
|
if ($audition->prelimDefinition) {
|
||||||
$entries = $entries->reject(fn ($entry) => ! $entry->hasFlag('passed_prelim'));
|
$entries = $entries->reject(fn ($entry) => ! $entry->hasFlag('passed_prelim'));
|
||||||
}
|
}
|
||||||
|
if ($audition->splitScoreDefinition) {
|
||||||
|
$subscoreIds = $audition->splitScoreDefinition->subscoresForJudge($request->user());
|
||||||
|
$subscores = SubscoreDefinition::findMany($subscoreIds)->sortBy('display_order');
|
||||||
|
} else {
|
||||||
$subscores = $audition->scoringGuide->subscores()->orderBy('display_order')->get();
|
$subscores = $audition->scoringGuide->subscores()->orderBy('display_order')->get();
|
||||||
|
}
|
||||||
|
|
||||||
$votes = JudgeAdvancementVote::where('user_id', Auth::id())->get();
|
$votes = JudgeAdvancementVote::where('user_id', Auth::id())->get();
|
||||||
$published = $audition->hasFlag('advancement_published') || $audition->hasFlag('seats_published');
|
$published = $audition->hasFlag('advancement_published') || $audition->hasFlag('seats_published');
|
||||||
|
|
@ -77,12 +82,17 @@ class JudgingController extends Controller
|
||||||
return redirect()->route('judging.auditionEntryList', $entry->audition)->with('error',
|
return redirect()->route('judging.auditionEntryList', $entry->audition)->with('error',
|
||||||
'The requested entry is marked as having failed a prelim. Scores cannot be entered.');
|
'The requested entry is marked as having failed a prelim. Scores cannot be entered.');
|
||||||
}
|
}
|
||||||
|
if ($entry->audition->splitScoreDefinition) {
|
||||||
|
$limitedSubscores = $entry->audition->splitScoreDefinition->subscoresForJudge($request->user());
|
||||||
|
} else {
|
||||||
|
$limitedSubscores = false;
|
||||||
|
}
|
||||||
|
|
||||||
$oldSheet = ScoreSheet::where('user_id', Auth::id())->where('entry_id', $entry->id)->value('subscores') ?? null;
|
$oldSheet = ScoreSheet::where('user_id', Auth::id())->where('entry_id', $entry->id)->value('subscores') ?? null;
|
||||||
$oldVote = JudgeAdvancementVote::where('user_id', Auth::id())->where('entry_id', $entry->id)->first();
|
$oldVote = JudgeAdvancementVote::where('user_id', Auth::id())->where('entry_id', $entry->id)->first();
|
||||||
$oldVote = $oldVote ? $oldVote->vote : 'noVote';
|
$oldVote = $oldVote ? $oldVote->vote : 'noVote';
|
||||||
|
|
||||||
return view('judging.entry_score_sheet', compact('entry', 'oldSheet', 'oldVote'));
|
return view('judging.entry_score_sheet', compact('entry', 'oldSheet', 'oldVote', 'limitedSubscores'));
|
||||||
}
|
}
|
||||||
|
|
||||||
public function saveScoreSheet(Request $request, Entry $entry, EnterScore $enterScore)
|
public function saveScoreSheet(Request $request, Entry $entry, EnterScore $enterScore)
|
||||||
|
|
@ -92,7 +102,13 @@ class JudgingController extends Controller
|
||||||
}
|
}
|
||||||
|
|
||||||
// Validate form data
|
// Validate form data
|
||||||
|
if ($entry->audition->splitScoreDefinition) {
|
||||||
|
$subscoreIDs = $entry->audition->splitScoreDefinition->subscoresForJudge($request->user());
|
||||||
|
$subscores = SubscoreDefinition::findMany($subscoreIDs);
|
||||||
|
|
||||||
|
} else {
|
||||||
$subscores = $entry->audition->subscoreDefinitions;
|
$subscores = $entry->audition->subscoreDefinitions;
|
||||||
|
}
|
||||||
$validationChecks = [];
|
$validationChecks = [];
|
||||||
foreach ($subscores as $subscore) {
|
foreach ($subscores as $subscore) {
|
||||||
$validationChecks['score'.'.'.$subscore->id] = 'required|integer|max:'.$subscore->max_score;
|
$validationChecks['score'.'.'.$subscore->id] = 'required|integer|max:'.$subscore->max_score;
|
||||||
|
|
@ -101,11 +117,7 @@ class JudgingController extends Controller
|
||||||
|
|
||||||
// Enter the score
|
// Enter the score
|
||||||
/** @noinspection PhpUnhandledExceptionInspection */
|
/** @noinspection PhpUnhandledExceptionInspection */
|
||||||
try {
|
|
||||||
$enterScore(Auth::user(), $entry, $validatedData['score']);
|
$enterScore(Auth::user(), $entry, $validatedData['score']);
|
||||||
} catch (AuditionAdminException $e) {
|
|
||||||
return redirect()->back()->with('error', $e->getMessage());
|
|
||||||
}
|
|
||||||
|
|
||||||
// Deal with an advancement vote if needed
|
// Deal with an advancement vote if needed
|
||||||
$this->advancementVote($request, $entry);
|
$this->advancementVote($request, $entry);
|
||||||
|
|
|
||||||
|
|
@ -45,15 +45,7 @@ class PrelimJudgingController extends Controller
|
||||||
$oldSheet = PrelimScoreSheet::where('user_id', Auth::id())->where('entry_id',
|
$oldSheet = PrelimScoreSheet::where('user_id', Auth::id())->where('entry_id',
|
||||||
$entry->id)->value('subscores') ?? null;
|
$entry->id)->value('subscores') ?? null;
|
||||||
|
|
||||||
if ($oldSheet) {
|
return view('judging.prelim_entry_form', compact('entry', 'oldSheet'));
|
||||||
$formRoute = 'update.savePrelimScoreSheet';
|
|
||||||
$formMethod = 'PATCH';
|
|
||||||
} else {
|
|
||||||
$formRoute = 'judging.savePrelimScoreSheet';
|
|
||||||
$formMethod = 'POST';
|
|
||||||
}
|
|
||||||
|
|
||||||
return view('judging.prelim_entry_form', compact('entry', 'oldSheet', 'formRoute', 'formMethod'));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
||||||
|
|
@ -73,7 +73,7 @@ class AdvancementController extends Controller
|
||||||
$entries = $ranker($audition, 'advancement');
|
$entries = $ranker($audition, 'advancement');
|
||||||
$entries->load(['advancementVotes', 'totalScore', 'student.school']);
|
$entries->load(['advancementVotes', 'totalScore', 'student.school']);
|
||||||
|
|
||||||
$unscoredEntries = $audition->entries()->where('for_advancement', true)->orderBy('draw_number')->get()->filter(function ($entry) {
|
$unscoredEntries = $audition->entries()->orderBy('draw_number')->get()->filter(function ($entry) {
|
||||||
return ! $entry->totalScore && ! $entry->hasFlag('no_show');
|
return ! $entry->totalScore && ! $entry->hasFlag('no_show');
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
@ -81,7 +81,7 @@ class AdvancementController extends Controller
|
||||||
return $entry->hasFlag('no_show');
|
return $entry->hasFlag('no_show');
|
||||||
});
|
});
|
||||||
|
|
||||||
$scoringComplete = $audition->entries->where('for_advancement', true)->every(function ($entry) {
|
$scoringComplete = $audition->entries->every(function ($entry) {
|
||||||
return $entry->totalScore || $entry->hasFlag('no_show');
|
return $entry->totalScore || $entry->hasFlag('no_show');
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,53 @@
|
||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Http\Requests;
|
||||||
|
|
||||||
|
use Illuminate\Foundation\Http\FormRequest;
|
||||||
|
use Illuminate\Validation\Validator;
|
||||||
|
|
||||||
|
class EditSplitScoreDefinitionRequest extends FormRequest
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* Determine if the user is authorized to make this request.
|
||||||
|
*/
|
||||||
|
public function authorize(): bool
|
||||||
|
{
|
||||||
|
return auth()->user()->is_admin;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get the validation rules that apply to the request.
|
||||||
|
*
|
||||||
|
* @return array<string, \Illuminate\Contracts\Validation\ValidationRule|array<mixed>|string>
|
||||||
|
*/
|
||||||
|
public function rules(): array
|
||||||
|
{
|
||||||
|
|
||||||
|
return [
|
||||||
|
'new_split' => 'sometimes|string|max:255|min:1',
|
||||||
|
'split' => 'sometimes|array',
|
||||||
|
];
|
||||||
|
}
|
||||||
|
|
||||||
|
public function after(): array
|
||||||
|
{
|
||||||
|
$splitScoreDefinition = $this->route('splitScoreDefinition');
|
||||||
|
|
||||||
|
return [
|
||||||
|
function (Validator $validator) use ($splitScoreDefinition) {
|
||||||
|
if ($this->has('new_split')) {
|
||||||
|
$existingSplitNames = collect($splitScoreDefinition->splits)
|
||||||
|
->pluck('name')
|
||||||
|
->toArray();
|
||||||
|
|
||||||
|
if (in_array($this->new_split, $existingSplitNames)) {
|
||||||
|
$validator->errors()->add(
|
||||||
|
'new_split',
|
||||||
|
'This split name already exists in this definition.'
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -125,6 +125,11 @@ class Audition extends Model
|
||||||
return $this->attributes['judges_count'];
|
return $this->attributes['judges_count'];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function splitScoreDefinition(): HasOne
|
||||||
|
{
|
||||||
|
return $this->hasOne(SplitScoreDefinition::class);
|
||||||
|
}
|
||||||
|
|
||||||
public function flags(): HasMany
|
public function flags(): HasMany
|
||||||
{
|
{
|
||||||
return $this->hasMany(AuditionFlag::class);
|
return $this->hasMany(AuditionFlag::class);
|
||||||
|
|
|
||||||
|
|
@ -29,7 +29,7 @@ class Entry extends Model
|
||||||
/**
|
/**
|
||||||
* @throws AuditionAdminException
|
* @throws AuditionAdminException
|
||||||
*/
|
*/
|
||||||
public function rank(string $type, bool $pullDeclinedEntries = true)
|
public function rank(string $type)
|
||||||
{
|
{
|
||||||
$ranker = app(RankAuditionEntries::class);
|
$ranker = app(RankAuditionEntries::class);
|
||||||
|
|
||||||
|
|
@ -39,11 +39,11 @@ class Entry extends Model
|
||||||
}
|
}
|
||||||
|
|
||||||
// Get the ranked entries for this entries audition
|
// Get the ranked entries for this entries audition
|
||||||
$rankedEntries = $ranker($this->audition, $type, $pullDeclinedEntries);
|
$rankedEntries = $ranker($this->audition, $type);
|
||||||
|
|
||||||
// If we're looking for seating rank, return the rank from the list of ranked entries
|
// If we're looking for seating rank, return the rank from the list of ranked entries
|
||||||
if ($type === 'seating') {
|
if ($type === 'seating') {
|
||||||
return $rankedEntries->where('id', $this->id)->first()->seatingRank ?? 'No Rank';
|
return $rankedEntries->where('id', $this->id)->first()->seatingRank;
|
||||||
}
|
}
|
||||||
|
|
||||||
return $rankedEntries->where('id', $this->id)->first()->advancementRank;
|
return $rankedEntries->where('id', $this->id)->first()->advancementRank;
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,36 @@
|
||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Models;
|
||||||
|
|
||||||
|
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||||
|
use Illuminate\Database\Eloquent\Model;
|
||||||
|
|
||||||
|
class SplitScoreDefinition extends Model
|
||||||
|
{
|
||||||
|
use HasFactory;
|
||||||
|
|
||||||
|
protected $guarded = [];
|
||||||
|
|
||||||
|
protected $casts = [
|
||||||
|
'splits' => 'array',
|
||||||
|
];
|
||||||
|
|
||||||
|
public function audition()
|
||||||
|
{
|
||||||
|
return $this->belongsTo(Audition::class);
|
||||||
|
}
|
||||||
|
|
||||||
|
public function subscoresForJudge(User $judge): array
|
||||||
|
{
|
||||||
|
$validSubscores = [];
|
||||||
|
foreach ($this->splits as $split) {
|
||||||
|
if (in_array($judge->id, $split['judges'])) {
|
||||||
|
foreach ($split['subscores'] as $subscore) {
|
||||||
|
$validSubscores[] = $subscore;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return $validSubscores;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -38,6 +38,7 @@ use App\Services\EntryService;
|
||||||
use App\Services\ScoreService;
|
use App\Services\ScoreService;
|
||||||
use App\Services\UserService;
|
use App\Services\UserService;
|
||||||
use Illuminate\Database\Eloquent\Model;
|
use Illuminate\Database\Eloquent\Model;
|
||||||
|
use Illuminate\Support\Facades\Gate;
|
||||||
use Illuminate\Support\ServiceProvider;
|
use Illuminate\Support\ServiceProvider;
|
||||||
|
|
||||||
class AppServiceProvider extends ServiceProvider
|
class AppServiceProvider extends ServiceProvider
|
||||||
|
|
@ -78,6 +79,9 @@ class AppServiceProvider extends ServiceProvider
|
||||||
Student::observe(StudentObserver::class);
|
Student::observe(StudentObserver::class);
|
||||||
User::observe(UserObserver::class);
|
User::observe(UserObserver::class);
|
||||||
|
|
||||||
|
Gate::define('impersonate', function ($admin, $target) {
|
||||||
|
return $admin->hasFlag('can_impersonate') && $admin->id !== $target->id;
|
||||||
|
});
|
||||||
// Model::preventLazyLoading(! app()->isProduction());
|
// Model::preventLazyLoading(! app()->isProduction());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -65,5 +65,6 @@ class FortifyServiceProvider extends ServiceProvider
|
||||||
Fortify::verifyEmailView(function () {
|
Fortify::verifyEmailView(function () {
|
||||||
return view('auth.verify-email');
|
return view('auth.verify-email');
|
||||||
});
|
});
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -35,7 +35,7 @@ class InvoiceOneFeePerStudent implements InvoiceDataService
|
||||||
/** @noinspection PhpArrayIndexImmediatelyRewrittenInspection */
|
/** @noinspection PhpArrayIndexImmediatelyRewrittenInspection */
|
||||||
$invoiceData['grandTotal'] = 0;
|
$invoiceData['grandTotal'] = 0;
|
||||||
|
|
||||||
$entries = $school->entries()->where('for_seating', true)->with('audition')->orderBy('created_at', 'desc')->get()->groupBy('student_id');
|
$entries = $school->entries()->with('audition')->orderBy('created_at', 'desc')->get()->groupBy('student_id');
|
||||||
foreach ($school->students as $student) {
|
foreach ($school->students as $student) {
|
||||||
$firstEntryForStudent = true;
|
$firstEntryForStudent = true;
|
||||||
foreach ($entries[$student->id] ?? [] as $entry) {
|
foreach ($entries[$student->id] ?? [] as $entry) {
|
||||||
|
|
|
||||||
|
|
@ -35,7 +35,7 @@ class InvoiceOneFeePerStudentPerEvent implements InvoiceDataService
|
||||||
/** @noinspection PhpArrayIndexImmediatelyRewrittenInspection */
|
/** @noinspection PhpArrayIndexImmediatelyRewrittenInspection */
|
||||||
$invoiceData['grandTotal'] = 0;
|
$invoiceData['grandTotal'] = 0;
|
||||||
|
|
||||||
$entries = $school->entries()->where('for_seating', true)->with('audition')->orderBy('created_at', 'desc')->get()->groupBy('student_id');
|
$entries = $school->entries()->with('audition')->orderBy('created_at', 'desc')->get()->groupBy('student_id');
|
||||||
foreach ($school->students as $student) {
|
foreach ($school->students as $student) {
|
||||||
$eventsEntered = [];
|
$eventsEntered = [];
|
||||||
foreach ($entries[$student->id] ?? [] as $entry) {
|
foreach ($entries[$student->id] ?? [] as $entry) {
|
||||||
|
|
|
||||||
|
|
@ -10004,12 +10004,12 @@
|
||||||
],
|
],
|
||||||
"aliases": [],
|
"aliases": [],
|
||||||
"minimum-stability": "stable",
|
"minimum-stability": "stable",
|
||||||
"stability-flags": {},
|
"stability-flags": [],
|
||||||
"prefer-stable": true,
|
"prefer-stable": true,
|
||||||
"prefer-lowest": false,
|
"prefer-lowest": false,
|
||||||
"platform": {
|
"platform": {
|
||||||
"php": "^8.2"
|
"php": "^8.2"
|
||||||
},
|
},
|
||||||
"platform-dev": {},
|
"platform-dev": [],
|
||||||
"plugin-api-version": "2.6.0"
|
"plugin-api-version": "2.6.0"
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -78,7 +78,7 @@ return [
|
||||||
'url' => env('LOG_SLACK_WEBHOOK_URL'),
|
'url' => env('LOG_SLACK_WEBHOOK_URL'),
|
||||||
'username' => env('LOG_SLACK_USERNAME', 'Laravel Log'),
|
'username' => env('LOG_SLACK_USERNAME', 'Laravel Log'),
|
||||||
'emoji' => env('LOG_SLACK_EMOJI', ':boom:'),
|
'emoji' => env('LOG_SLACK_EMOJI', ':boom:'),
|
||||||
'level' => env('LOG_LEVEL', 'debug'),
|
'level' => env('LOG_LEVEL', 'critical'),
|
||||||
'replace_placeholders' => true,
|
'replace_placeholders' => true,
|
||||||
],
|
],
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,30 @@
|
||||||
|
<?php
|
||||||
|
|
||||||
|
use App\Models\Audition;
|
||||||
|
use Illuminate\Database\Migrations\Migration;
|
||||||
|
use Illuminate\Database\Schema\Blueprint;
|
||||||
|
use Illuminate\Support\Facades\Schema;
|
||||||
|
|
||||||
|
return new class extends Migration
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* Run the migrations.
|
||||||
|
*/
|
||||||
|
public function up(): void
|
||||||
|
{
|
||||||
|
Schema::create('split_score_definitions', function (Blueprint $table) {
|
||||||
|
$table->id();
|
||||||
|
$table->foreignIdFor(Audition::class)->unique()->constrained()->cascadeOnDelete()->cascadeOnUpdate();
|
||||||
|
$table->json('splits')->nullable();
|
||||||
|
$table->timestamps();
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Reverse the migrations.
|
||||||
|
*/
|
||||||
|
public function down(): void
|
||||||
|
{
|
||||||
|
Schema::dropIfExists('split_score_definitions');
|
||||||
|
}
|
||||||
|
};
|
||||||
File diff suppressed because it is too large
Load Diff
|
|
@ -18,7 +18,6 @@
|
||||||
</include>
|
</include>
|
||||||
</source>
|
</source>
|
||||||
<php>
|
<php>
|
||||||
<ini name="memory_limit" value="512M"/>
|
|
||||||
<env name="APP_ENV" value="testing"/>
|
<env name="APP_ENV" value="testing"/>
|
||||||
<env name="APP_MAINTENANCE_DRIVER" value="file"/>
|
<env name="APP_MAINTENANCE_DRIVER" value="file"/>
|
||||||
<env name="BCRYPT_ROUNDS" value="4"/>
|
<env name="BCRYPT_ROUNDS" value="4"/>
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,15 @@
|
||||||
|
<x-layout.app>
|
||||||
|
<x-slot:page_title>Impersonation</x-slot:page_title>
|
||||||
|
<x-card.card class="max-w-lg mx-auto">
|
||||||
|
<x-card.heading>Select User to Impersonate</x-card.heading>
|
||||||
|
<x-form.form method="POST" action="{{ route('impersonate.start') }}">
|
||||||
|
<x-form.select name="user_id">
|
||||||
|
<x-slot:label>User to impersonate</x-slot:label>
|
||||||
|
@foreach ($users as $user)
|
||||||
|
<option value="{{ $user->id }}">{{ $user->full_name() }}</option>
|
||||||
|
@endforeach
|
||||||
|
</x-form.select>
|
||||||
|
<x-form.footer submit-button-text="Impersonate" />
|
||||||
|
</x-form.form>
|
||||||
|
</x-card.card>
|
||||||
|
</x-layout.app>
|
||||||
|
|
@ -1,30 +0,0 @@
|
||||||
<x-layout.app>
|
|
||||||
<x-slot:page_title>School Email Domains</x-slot:page_title>
|
|
||||||
<x-card.card class="max-w-2xl mx-auto">
|
|
||||||
<x-card.heading>School Email Domains</x-card.heading>
|
|
||||||
<x-table.table>
|
|
||||||
<thead>
|
|
||||||
<tr>
|
|
||||||
<x-table.th>School</x-table.th>
|
|
||||||
<x-table.th>Domains</x-table.th>
|
|
||||||
</tr>
|
|
||||||
</thead>
|
|
||||||
<x-table.body>
|
|
||||||
@foreach($schools as $school)
|
|
||||||
<tr>
|
|
||||||
<x-table.td>
|
|
||||||
<a href="{{ route('admin.schools.show', $school) }}">
|
|
||||||
{{ $school->name }}
|
|
||||||
</a>
|
|
||||||
</x-table.td>
|
|
||||||
<x-table.td>
|
|
||||||
@foreach($school->emailDomains ?? [] as $domain)
|
|
||||||
{{ $domain->domain }}
|
|
||||||
@endforeach
|
|
||||||
</x-table.td>
|
|
||||||
</tr>
|
|
||||||
@endforeach
|
|
||||||
</x-table.body>
|
|
||||||
</x-table.table>
|
|
||||||
</x-card.card>
|
|
||||||
</x-layout.app>
|
|
||||||
|
|
@ -0,0 +1,19 @@
|
||||||
|
<x-layout.app>
|
||||||
|
<x-slot:page_title>Split Score Definition</x-slot:page_title>
|
||||||
|
<x-card.card class="max-w-2xl mx-auto mt-5">
|
||||||
|
<x-card.heading>
|
||||||
|
Create Split Score
|
||||||
|
</x-card.heading>
|
||||||
|
<x-form.form method="POST" action="{{ route('admin.split_score_definitions.store') }}">
|
||||||
|
<x-form.select name="audition_id">
|
||||||
|
<x-slot:label>Audition</x-slot:label>
|
||||||
|
<option value="">Select Audition</option>
|
||||||
|
@foreach ($availableAuditions as $audition)
|
||||||
|
<option value="{{ $audition->id }}">{{ $audition->name }}</option>
|
||||||
|
@endforeach
|
||||||
|
</x-form.select>
|
||||||
|
<x-form.button class="my-3">Create Split Score</x-form.button>
|
||||||
|
</x-form.form>
|
||||||
|
|
||||||
|
</x-card.card>
|
||||||
|
</x-layout.app>
|
||||||
|
|
@ -0,0 +1,50 @@
|
||||||
|
<x-layout.app>
|
||||||
|
<x-slot:page_title>Split Score - {{ $splitScoreDefinition->audition->name }}</x-slot:page_title>
|
||||||
|
<x-card.card class="max-w-md mx-auto">
|
||||||
|
<x-card.heading>Add Split</x-card.heading>
|
||||||
|
<x-form.form class="my-3" action="{{ route('admin.split_score_definitions.update', $splitScoreDefinition) }}"
|
||||||
|
method="PATCH">
|
||||||
|
<x-form.field name="new_split" label_text="New Split Name"/>
|
||||||
|
<x-form.button class="mt-3">Create New Split</x-form.button>
|
||||||
|
</x-form.form>
|
||||||
|
</x-card.card>
|
||||||
|
|
||||||
|
@if(is_array($splitScoreDefinition->splits))
|
||||||
|
<x-form.form method="patch" action="{{ route('admin.split_score_definitions.update', $splitScoreDefinition) }}">
|
||||||
|
@foreach($splitScoreDefinition->splits as $splitName => $splitData)
|
||||||
|
<x-card.card class="mt-3 max-w-2xl mx-auto">
|
||||||
|
<x-card.heading>{{ $splitName }}</x-card.heading>
|
||||||
|
<div class="grid grid-cols-2 gap-4 py-2 px-6">
|
||||||
|
<div>
|
||||||
|
<div class="font-semibold">Subscores</div>
|
||||||
|
<x-card.list.body>
|
||||||
|
@foreach($subscores as $subscore)
|
||||||
|
<x-card.list.row>
|
||||||
|
@php($checked = in_array($subscore->id, $splitScoreDefinition->splits[$splitName]['subscores']) ?? false)
|
||||||
|
<x-form.checkbox name="split[{{$splitName}}][subscores][{{$subscore->id}}]"
|
||||||
|
value="{{$subscore->id}}" :checked="$checked"></x-form.checkbox>
|
||||||
|
{{ $subscore->name }}
|
||||||
|
</x-card.list.row>
|
||||||
|
@endforeach
|
||||||
|
</x-card.list.body>
|
||||||
|
</div>
|
||||||
|
<div>
|
||||||
|
<div class="font-semibold">Judges</div>
|
||||||
|
<x-card.list.body>
|
||||||
|
@foreach($judges as $judge)
|
||||||
|
@php($checked = in_array($judge->id, $splitScoreDefinition->splits[$splitName]['judges']) ?? false)
|
||||||
|
<x-card.list.row>
|
||||||
|
<x-form.checkbox name="split[{{$splitName}}][judges][{{$judge->id}}]"
|
||||||
|
value="{{$judge->id}}" :checked="$checked"></x-form.checkbox>
|
||||||
|
{{ $judge->full_name() }}
|
||||||
|
</x-card.list.row>
|
||||||
|
@endforeach
|
||||||
|
</x-card.list.body>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</x-card.card>
|
||||||
|
@endforeach
|
||||||
|
<x-form.button class="max-w-2xl mx-auto mt-4">Submit Changes</x-form.button>
|
||||||
|
</x-form.form>
|
||||||
|
@endif
|
||||||
|
</x-layout.app>
|
||||||
|
|
@ -0,0 +1,17 @@
|
||||||
|
<x-layout.app>
|
||||||
|
<x-slot:page_title>Split Scores</x-slot:page_title>
|
||||||
|
<x-slot:title_bar_right>
|
||||||
|
<x-form.button href="{{ route('admin.split_score_definitions.create') }}">Create Split-Score</x-form.button>
|
||||||
|
</x-slot:title_bar_right>
|
||||||
|
<x-card.card class="max-w-md mx-auto">
|
||||||
|
<x-card.list.body>
|
||||||
|
@foreach($splitScores as $splitScore)
|
||||||
|
<x-card.list.row>
|
||||||
|
<a href="{{ route('admin.split_score_definitions.edit', $splitScore) }}">
|
||||||
|
{{ $splitScore->audition->name }}
|
||||||
|
</a>
|
||||||
|
</x-card.list.row>
|
||||||
|
@endforeach
|
||||||
|
</x-card.list.body>
|
||||||
|
</x-card.card>
|
||||||
|
</x-layout.app>
|
||||||
|
|
@ -13,7 +13,8 @@
|
||||||
<tr>
|
<tr>
|
||||||
<x-table.th>Name</x-table.th>
|
<x-table.th>Name</x-table.th>
|
||||||
<x-table.th>School</x-table.th>
|
<x-table.th>School</x-table.th>
|
||||||
<x-table.th>Cell Phone<br />Email</x-table.th>
|
<x-table.th>Email</x-table.th>
|
||||||
|
<x-table.th>Cell Phone</x-table.th>
|
||||||
<x-table.th>Judging Preference</x-table.th>
|
<x-table.th>Judging Preference</x-table.th>
|
||||||
<x-table.th>Privileges</x-table.th>
|
<x-table.th>Privileges</x-table.th>
|
||||||
</tr>
|
</tr>
|
||||||
|
|
@ -21,16 +22,10 @@
|
||||||
<x-table.body>
|
<x-table.body>
|
||||||
@foreach($users as $user)
|
@foreach($users as $user)
|
||||||
<tr class="hover:bg-gray-50">
|
<tr class="hover:bg-gray-50">
|
||||||
<x-table.td>
|
<x-table.td><a href="{{ route('admin.users.edit',$user) }}">{{ $user->full_name(true) }}</a>{{ $user->hasFlag('head_director') ? ' *':'' }}</x-table.td>
|
||||||
<a href="{{ route('admin.users.edit',$user) }}">{{ $user->full_name(true) }}</a>
|
|
||||||
{{ $user->hasFlag('head_director') ? ' *':'' }}
|
|
||||||
@if(! $user->email_verified_at)
|
|
||||||
<p class="text-xs font-light">Unverified Account</p>
|
|
||||||
@endif
|
|
||||||
</x-table.td>
|
|
||||||
<x-table.td>{{ $user->has_school() ? $user->school->name : ' ' }}</x-table.td>
|
<x-table.td>{{ $user->has_school() ? $user->school->name : ' ' }}</x-table.td>
|
||||||
<x-table.td>{{ $user->cell_phone }}<br/>{{ $user->email }}</x-table.td>
|
<x-table.td>{{ $user->email }}</x-table.td>
|
||||||
|
<x-table.td>{{ $user->cell_phone }}</x-table.td>
|
||||||
<x-table.td>{{ $user->judging_preference }}</x-table.td>
|
<x-table.td>{{ $user->judging_preference }}</x-table.td>
|
||||||
<x-table.td>
|
<x-table.td>
|
||||||
@if($user->is_admin)
|
@if($user->is_admin)
|
||||||
|
|
|
||||||
|
|
@ -2,7 +2,7 @@
|
||||||
<x-layout.page-header>Year End Reset</x-layout.page-header>
|
<x-layout.page-header>Year End Reset</x-layout.page-header>
|
||||||
<x-card.card class="mt-5 max-w-xl m-auto">
|
<x-card.card class="mt-5 max-w-xl m-auto">
|
||||||
<x-card.heading>Reset Options</x-card.heading>
|
<x-card.heading>Reset Options</x-card.heading>
|
||||||
<x-form.form action="{{ route('admin.execute_year_end_procedures') }}">
|
<x-form.form action="{{ route('admin.year_end_procedures') }}">
|
||||||
<x-form.checkbox name="options[]" label="Delete Rooms" value="deleteRooms" />
|
<x-form.checkbox name="options[]" label="Delete Rooms" value="deleteRooms" />
|
||||||
<x-form.checkbox name="options[]" label="Remove Auditions From Rooms" value="removeAuditionsFromRoom" />
|
<x-form.checkbox name="options[]" label="Remove Auditions From Rooms" value="removeAuditionsFromRoom" />
|
||||||
<x-form.checkbox name="options[]" label="Unassign Judges" value="unassignJudges" />
|
<x-form.checkbox name="options[]" label="Unassign Judges" value="unassignJudges" />
|
||||||
|
|
|
||||||
|
|
@ -19,6 +19,14 @@
|
||||||
</head>
|
</head>
|
||||||
<body {{ $attributes->merge(['class' => 'h-full']) }}>
|
<body {{ $attributes->merge(['class' => 'h-full']) }}>
|
||||||
<div class="min-h-full">
|
<div class="min-h-full">
|
||||||
|
@if(session()->has('impersonator_id'))
|
||||||
|
<div class="bg-red-500 text-white ml pl-10 py-2">
|
||||||
|
Currently impersonating {{ auth()->user()->full_name() }}
|
||||||
|
<x-form.form method="post" action="{{ route('impersonate.stop') }}">
|
||||||
|
<button>End Impersonation</button>
|
||||||
|
</x-form.form>
|
||||||
|
</div>
|
||||||
|
@endif
|
||||||
{{-- @if(request()->is('*admin*'))--}}
|
{{-- @if(request()->is('*admin*'))--}}
|
||||||
{{-- <x-layout.navbar.navbar-admin />--}}
|
{{-- <x-layout.navbar.navbar-admin />--}}
|
||||||
{{-- @else--}}
|
{{-- @else--}}
|
||||||
|
|
|
||||||
|
|
@ -23,7 +23,6 @@
|
||||||
<a href="{{route('admin.dashboard')}}" class="block p-2 hover:text-indigo-600">Admin Dashboard</a>
|
<a href="{{route('admin.dashboard')}}" class="block p-2 hover:text-indigo-600">Admin Dashboard</a>
|
||||||
<a href="{{route('admin.users.index')}}" class="block p-2 hover:text-indigo-600">Users</a>
|
<a href="{{route('admin.users.index')}}" class="block p-2 hover:text-indigo-600">Users</a>
|
||||||
<a href="{{route('admin.schools.index')}}" class="block p-2 hover:text-indigo-600">Schools</a>
|
<a href="{{route('admin.schools.index')}}" class="block p-2 hover:text-indigo-600">Schools</a>
|
||||||
<a href="{{route('admin.schools.email_domains')}}" class="block p-2 hover:text-indigo-600">School Email Domains</a>
|
|
||||||
<a href="{{route('admin.students.index')}}" class="block p-2 hover:text-indigo-600">Students</a>
|
<a href="{{route('admin.students.index')}}" class="block p-2 hover:text-indigo-600">Students</a>
|
||||||
<a href="{{route('admin.entries.index')}}" class="block p-2 hover:text-indigo-600">Entries</a>
|
<a href="{{route('admin.entries.index')}}" class="block p-2 hover:text-indigo-600">Entries</a>
|
||||||
@if(auditionSetting('nomination_ensemble_rules') !== 'disabled')
|
@if(auditionSetting('nomination_ensemble_rules') !== 'disabled')
|
||||||
|
|
|
||||||
|
|
@ -29,14 +29,14 @@
|
||||||
<option value="user">Director</option>
|
<option value="user">Director</option>
|
||||||
<option value="admin" selected>Admin</option>
|
<option value="admin" selected>Admin</option>
|
||||||
</x-form.select>
|
</x-form.select>
|
||||||
<x-layout.navbar.nav-link href="/admin" :active="request()->is('admin')">Dashboard</x-layout.navbar.nav-link>
|
<x-layout.nav-link href="/admin" :active="request()->is('admin')">Dashboard</x-layout.nav-link>
|
||||||
<x-layout.navbar.nav-link href="/admin/users" :active="request()->is('admin/users')">Users</x-layout.navbar.nav-link>
|
<x-layout.nav-link href="/admin/users" :active="request()->is('admin/users')">Users</x-layout.nav-link>
|
||||||
<x-layout.navbar.nav-link href="/admin/schools" :active="request()->is('admin/schools')">Schools</x-layout.navbar.nav-link>
|
<x-layout.nav-link href="/admin/schools" :active="request()->is('admin/schools')">Schools</x-layout.nav-link>
|
||||||
<x-layout.navbar.nav-link href="/admin/students" :active="request()->is('admin/students')">Students</x-layout.navbar.nav-link>
|
<x-layout.nav-link href="/admin/students" :active="request()->is('admin/students')">Students</x-layout.nav-link>
|
||||||
<x-layout.navbar.nav-link href="/admin/entries" :active="request()->is('admin/entries')">Entries</x-layout.navbar.nav-link>
|
<x-layout.nav-link href="/admin/entries" :active="request()->is('admin/entries')">Entries</x-layout.nav-link>
|
||||||
<x-layout.navbar.nav-link href="/admin/auditions" :active="request()->is('admin/auditions')">Auditions</x-layout.navbar.nav-link>
|
<x-layout.nav-link href="/admin/auditions" :active="request()->is('admin/auditions')">Auditions</x-layout.nav-link>
|
||||||
<x-layout.navbar.nav-link href="/admin/scoring" :active="request()->is('admin/scoring')">Scoring</x-layout.navbar.nav-link>
|
<x-layout.nav-link href="/admin/scoring" :active="request()->is('admin/scoring')">Scoring</x-layout.nav-link>
|
||||||
<x-layout.navbar.nav-link href="/admin/rooms" :active="request()->is('admin/rooms')">Rooms</x-layout.navbar.nav-link>
|
<x-layout.nav-link href="/admin/rooms" :active="request()->is('admin/rooms')">Rooms</x-layout.nav-link>
|
||||||
{{-- <a href="/dashboard" class="bg-indigo-700 text-white rounded-md px-3 py-2 text-sm font-medium" aria-current="page">Dashboard</a>--}}
|
{{-- <a href="/dashboard" class="bg-indigo-700 text-white rounded-md px-3 py-2 text-sm font-medium" aria-current="page">Dashboard</a>--}}
|
||||||
|
|
||||||
{{-- <a href="/students" class="text-white hover:bg-indigo-500 hover:bg-opacity-75 rounded-md px-3 py-2 text-sm font-medium">Students</a>--}}
|
{{-- <a href="/students" class="text-white hover:bg-indigo-500 hover:bg-opacity-75 rounded-md px-3 py-2 text-sm font-medium">Students</a>--}}
|
||||||
|
|
|
||||||
|
|
@ -53,12 +53,7 @@
|
||||||
|
|
||||||
<x-layout.page-section>
|
<x-layout.page-section>
|
||||||
<x-slot:section_name>Entry Listing</x-slot:section_name>
|
<x-slot:section_name>Entry Listing</x-slot:section_name>
|
||||||
<x-slot:section_description>
|
<x-slot:section_description>You have {{ $entries->count() }} entries</x-slot:section_description>
|
||||||
You have {{ $entries->count() }} entries <hr />
|
|
||||||
<p class="mt-3 text-sm">Note on results</p>
|
|
||||||
<p class="text-sm">Doublers will show declined on all but one entry. The rank shown on this screen does
|
|
||||||
not account for any doublers that declined a seat in that entries audition.</p>
|
|
||||||
</x-slot:section_description>
|
|
||||||
<div class="px-6 md:px-8 py-3">
|
<div class="px-6 md:px-8 py-3">
|
||||||
<x-table.table>
|
<x-table.table>
|
||||||
<thead>
|
<thead>
|
||||||
|
|
@ -72,12 +67,7 @@
|
||||||
@endif
|
@endif
|
||||||
<x-table.th spacer_only>
|
<x-table.th spacer_only>
|
||||||
<span class="sr-only">Edit</span>
|
<span class="sr-only">Edit</span>
|
||||||
|
|
||||||
</x-table.th>
|
</x-table.th>
|
||||||
<x-table.th>
|
|
||||||
Seat
|
|
||||||
</x-table.th>
|
|
||||||
<x-table.th>Rank</x-table.th>
|
|
||||||
</tr>
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
<x-table.body>
|
<x-table.body>
|
||||||
|
|
@ -117,24 +107,6 @@
|
||||||
@endif
|
@endif
|
||||||
</x-table.td>
|
</x-table.td>
|
||||||
@endif
|
@endif
|
||||||
<td></td>
|
|
||||||
@if($entry->audition->hasFlag('seats_published'))
|
|
||||||
<td>
|
|
||||||
@if($entry->seat)
|
|
||||||
{{ $entry->seat->ensemble->name }} - {{ $entry->seat->seat }}
|
|
||||||
@else
|
|
||||||
@if($entry->hasFlag('declined'))
|
|
||||||
Declined
|
|
||||||
@else
|
|
||||||
Not Seated
|
|
||||||
@endif
|
|
||||||
@endif
|
|
||||||
</td>
|
|
||||||
<td>
|
|
||||||
{{ $entry->rank('seating', false) }}
|
|
||||||
</td>
|
|
||||||
@endif
|
|
||||||
|
|
||||||
|
|
||||||
<x-table.td for_button>
|
<x-table.td for_button>
|
||||||
@php
|
@php
|
||||||
|
|
|
||||||
|
|
@ -21,6 +21,7 @@
|
||||||
@endif
|
@endif
|
||||||
<x-card.list.body class="mt-1">
|
<x-card.list.body class="mt-1">
|
||||||
@foreach($entry->audition->scoringGuide->subscores()->orderBy('display_order')->get() as $subscore)
|
@foreach($entry->audition->scoringGuide->subscores()->orderBy('display_order')->get() as $subscore)
|
||||||
|
@continue($limitedSubscores && ! in_array($subscore->id, $limitedSubscores))
|
||||||
@php
|
@php
|
||||||
if($oldScores) {
|
if($oldScores) {
|
||||||
$value = $oldScores['score'][$subscore->id];
|
$value = $oldScores['score'][$subscore->id];
|
||||||
|
|
|
||||||
|
|
@ -15,9 +15,11 @@
|
||||||
</ul>
|
</ul>
|
||||||
</x-slot:subheading>
|
</x-slot:subheading>
|
||||||
</x-card.heading>
|
</x-card.heading>
|
||||||
<x-form.form method="POST" action="{{ route($formRoute, $entry) }}">
|
<x-form.form method="POST" action="{{ route('judging.savePrelimScoreSheet', $entry) }}">
|
||||||
@method($formMethod)
|
@if($oldSheet)
|
||||||
|
{{-- if there are existing scores, make this a patch request --}}
|
||||||
|
@method('PATCH')
|
||||||
|
@endif
|
||||||
<x-card.list.body class="mt-1">
|
<x-card.list.body class="mt-1">
|
||||||
@foreach($entry->audition->prelimDefinition->scoringGuide->subscores()->orderBy('display_order')->get() as $subscore)
|
@foreach($entry->audition->prelimDefinition->scoringGuide->subscores()->orderBy('display_order')->get() as $subscore)
|
||||||
@php
|
@php
|
||||||
|
|
|
||||||
|
|
@ -8,9 +8,6 @@
|
||||||
<x-table.th>Draw #</x-table.th>
|
<x-table.th>Draw #</x-table.th>
|
||||||
<x-table.th>Student</x-table.th>
|
<x-table.th>Student</x-table.th>
|
||||||
<x-table.th>Doubler</x-table.th>
|
<x-table.th>Doubler</x-table.th>
|
||||||
@if($audition->prelimDefinition)
|
|
||||||
<x-table.th>Prelim Score</x-table.th>
|
|
||||||
@endif
|
|
||||||
<x-table.th>Total Score
|
<x-table.th>Total Score
|
||||||
@if($audition->bonusScore()->count() > 0)
|
@if($audition->bonusScore()->count() > 0)
|
||||||
<br>
|
<br>
|
||||||
|
|
@ -62,9 +59,6 @@
|
||||||
|
|
||||||
|
|
||||||
</x-table.td>
|
</x-table.td>
|
||||||
@if($audition->prelimDefinition)
|
|
||||||
<x-table.td>{{ round($entry->prelimTotalScore(),2) }}</x-table.td>
|
|
||||||
@endif
|
|
||||||
<x-table.td class="align-top">
|
<x-table.td class="align-top">
|
||||||
@if($audition->bonusScore()->count() > 0)
|
@if($audition->bonusScore()->count() > 0)
|
||||||
@if($entry->totalScore->bonus_total)
|
@if($entry->totalScore->bonus_total)
|
||||||
|
|
|
||||||
|
|
@ -11,6 +11,7 @@ use App\Http\Controllers\Admin\EntryController;
|
||||||
use App\Http\Controllers\Admin\EventController;
|
use App\Http\Controllers\Admin\EventController;
|
||||||
use App\Http\Controllers\Admin\ExportEntriesController;
|
use App\Http\Controllers\Admin\ExportEntriesController;
|
||||||
use App\Http\Controllers\Admin\ExportResultsController;
|
use App\Http\Controllers\Admin\ExportResultsController;
|
||||||
|
use App\Http\Controllers\Admin\ImpersonationController;
|
||||||
use App\Http\Controllers\Admin\PrelimDefinitionController;
|
use App\Http\Controllers\Admin\PrelimDefinitionController;
|
||||||
use App\Http\Controllers\Admin\PrintCards;
|
use App\Http\Controllers\Admin\PrintCards;
|
||||||
use App\Http\Controllers\Admin\PrintRoomAssignmentsController;
|
use App\Http\Controllers\Admin\PrintRoomAssignmentsController;
|
||||||
|
|
@ -19,8 +20,8 @@ use App\Http\Controllers\Admin\PrintStandNameTagsController;
|
||||||
use App\Http\Controllers\Admin\RecapController;
|
use App\Http\Controllers\Admin\RecapController;
|
||||||
use App\Http\Controllers\Admin\RoomController;
|
use App\Http\Controllers\Admin\RoomController;
|
||||||
use App\Http\Controllers\Admin\SchoolController;
|
use App\Http\Controllers\Admin\SchoolController;
|
||||||
use App\Http\Controllers\Admin\SchoolEmailDomainController;
|
|
||||||
use App\Http\Controllers\Admin\ScoringGuideController;
|
use App\Http\Controllers\Admin\ScoringGuideController;
|
||||||
|
use App\Http\Controllers\Admin\SplitScoreDefinitionController;
|
||||||
use App\Http\Controllers\Admin\StudentController;
|
use App\Http\Controllers\Admin\StudentController;
|
||||||
use App\Http\Controllers\Admin\UserController;
|
use App\Http\Controllers\Admin\UserController;
|
||||||
use App\Http\Controllers\Admin\YearEndResetController;
|
use App\Http\Controllers\Admin\YearEndResetController;
|
||||||
|
|
@ -38,7 +39,7 @@ Route::middleware(['auth', 'verified', CheckIfAdmin::class])->prefix('admin/')->
|
||||||
|
|
||||||
// Year-end procedures
|
// Year-end procedures
|
||||||
Route::get('/year_end_procedures', [YearEndResetController::class, 'index'])->name('admin.year_end_procedures');
|
Route::get('/year_end_procedures', [YearEndResetController::class, 'index'])->name('admin.year_end_procedures');
|
||||||
Route::post('/year_end_procedures', [YearEndResetController::class, 'execute'])->name('admin.execute_year_end_procedures');
|
Route::post('/year_end_procedures', [YearEndResetController::class, 'execute'])->name('admin.year_end_procedures');
|
||||||
|
|
||||||
Route::post('/auditions/roomUpdate', [
|
Route::post('/auditions/roomUpdate', [
|
||||||
AuditionController::class, 'roomUpdate',
|
AuditionController::class, 'roomUpdate',
|
||||||
|
|
@ -169,8 +170,6 @@ Route::middleware(['auth', 'verified', CheckIfAdmin::class])->prefix('admin/')->
|
||||||
});
|
});
|
||||||
|
|
||||||
// Admin School Routes
|
// Admin School Routes
|
||||||
Route::get('/schools/email_domains',
|
|
||||||
[SchoolEmailDomainController::class, 'index'])->name('admin.schools.email_domains');
|
|
||||||
Route::prefix('schools')->controller(SchoolController::class)->group(function () {
|
Route::prefix('schools')->controller(SchoolController::class)->group(function () {
|
||||||
Route::post('/{school}/add_domain', 'add_domain')->name('admin.schools.add_domain');
|
Route::post('/{school}/add_domain', 'add_domain')->name('admin.schools.add_domain');
|
||||||
Route::get('/', 'index')->name('admin.schools.index');
|
Route::get('/', 'index')->name('admin.schools.index');
|
||||||
|
|
@ -222,4 +221,27 @@ Route::middleware(['auth', 'verified', CheckIfAdmin::class])->prefix('admin/')->
|
||||||
Route::patch('/{prelimDefinition}', 'update')->name('admin.prelim_definitions.update');
|
Route::patch('/{prelimDefinition}', 'update')->name('admin.prelim_definitions.update');
|
||||||
Route::delete('/{prelimDefinition}', 'destroy')->name('admin.prelim_definitions.destroy');
|
Route::delete('/{prelimDefinition}', 'destroy')->name('admin.prelim_definitions.destroy');
|
||||||
});
|
});
|
||||||
|
|
||||||
|
// SplitScoreDefinition Routes
|
||||||
|
Route::prefix('split_score_definitions')->controller(SplitScoreDefinitionController::class)->group(function () {
|
||||||
|
Route::get('/', 'index')->name('admin.split_score_definitions.index');
|
||||||
|
Route::get('/new', 'create')->name('admin.split_score_definitions.create');
|
||||||
|
Route::post('/', 'store')->name('admin.split_score_definitions.store');
|
||||||
|
Route::get('/{splitScoreDefinition}', 'edit')->name('admin.split_score_definitions.edit');
|
||||||
|
Route::patch('/{splitScoreDefinition}', 'update')->name('admin.split_score_definitions.update');
|
||||||
|
Route::delete('/{splitScoreDefinition}', 'destroy')->name('admin.split_score_definitions.destroy');
|
||||||
});
|
});
|
||||||
|
|
||||||
|
});
|
||||||
|
|
||||||
|
// Impersonation Routes
|
||||||
|
Route::middleware(['auth', 'verified', CheckIfAdmin::class])->get('su/',
|
||||||
|
[ImpersonationController::class, 'index'])
|
||||||
|
->name('impersonate.index');
|
||||||
|
|
||||||
|
Route::middleware(['auth', 'verified', CheckIfAdmin::class])->post('su/start',
|
||||||
|
[ImpersonationController::class, 'start'])
|
||||||
|
->name('impersonate.start');
|
||||||
|
|
||||||
|
Route::post('su/stop', [ImpersonationController::class, 'stop'])
|
||||||
|
->name('impersonate.stop');
|
||||||
|
|
|
||||||
|
|
@ -22,7 +22,7 @@ Route::middleware(['auth', 'verified', CheckIfCanJudge::class])->prefix('judging
|
||||||
Route::get('/{prelimDefinition}', 'prelimEntryList')->name('judging.prelimEntryList');
|
Route::get('/{prelimDefinition}', 'prelimEntryList')->name('judging.prelimEntryList');
|
||||||
route::get('/enterScore/{entry}', 'prelimScoreEntryForm')->name('judging.prelimScoreEntryForm');
|
route::get('/enterScore/{entry}', 'prelimScoreEntryForm')->name('judging.prelimScoreEntryForm');
|
||||||
route::post('/enterScore/{entry}', 'savePrelimScoreSheet')->name('judging.savePrelimScoreSheet');
|
route::post('/enterScore/{entry}', 'savePrelimScoreSheet')->name('judging.savePrelimScoreSheet');
|
||||||
route::patch('/enterScore/{entry}', 'updatePrelimScoreSheet')->name('judging.updatePrelimScoreSheet');
|
route::patch('/enterScore/{entry}', 'updatePrelimScoreSheet')->name('judging.savePrelimScoreSheet');
|
||||||
});
|
});
|
||||||
|
|
||||||
// Bonus score judging routes
|
// Bonus score judging routes
|
||||||
|
|
|
||||||
|
|
@ -25,7 +25,7 @@ it('calls the YearEndCleanup action', function () {
|
||||||
$mock->shouldReceive('__invoke')->once();
|
$mock->shouldReceive('__invoke')->once();
|
||||||
app()->instance(YearEndCleanup::class, $mock);
|
app()->instance(YearEndCleanup::class, $mock);
|
||||||
actAsAdmin();
|
actAsAdmin();
|
||||||
$response = $this->post(route('admin.execute_year_end_procedures'));
|
$response = $this->post(route('admin.year_end_procedures'));
|
||||||
$response->assertRedirect(route('dashboard'))
|
$response->assertRedirect(route('dashboard'))
|
||||||
->with('success', 'Year end cleanup completed. ');
|
->with('success', 'Year end cleanup completed. ');
|
||||||
});
|
});
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,6 @@
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
|
use App\Models\Entry;
|
||||||
use App\Models\User;
|
use App\Models\User;
|
||||||
use Illuminate\Foundation\Testing\RefreshDatabase;
|
use Illuminate\Foundation\Testing\RefreshDatabase;
|
||||||
|
|
||||||
|
|
@ -14,8 +15,183 @@ describe('index method', function () {
|
||||||
$response = $this->get(route('monitor.index'));
|
$response = $this->get(route('monitor.index'));
|
||||||
$response->assertForbidden();
|
$response->assertForbidden();
|
||||||
});
|
});
|
||||||
it('needs additional tests written', function () {
|
|
||||||
// TODO: Write tests for new monitor pabe
|
it('presents a form to choose an entry', function () {
|
||||||
|
$user = User::factory()->create();
|
||||||
|
$user->addFlag('monitor');
|
||||||
|
actingAs($user);
|
||||||
|
$response = $this->get(route('monitor.index'));
|
||||||
|
$response->assertOk()
|
||||||
|
->assertViewIs('tabulation.choose_entry');
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
describe('method flagForm is a form to decide what type of flag to put on an entry', function () {
|
||||||
|
it('only allows those assigned to monitor to access this page', function () {
|
||||||
|
$user = User::factory()->create();
|
||||||
|
actingAs($user);
|
||||||
|
$response = $this->post(route('monitor.enterFlag'));
|
||||||
|
$response->assertStatus(403);
|
||||||
|
});
|
||||||
|
it('wont add flags to an entry in an audition with published seats', function () {
|
||||||
|
$user = User::factory()->create();
|
||||||
|
$user->addFlag('monitor');
|
||||||
|
$user->refresh();
|
||||||
|
actingAs($user);
|
||||||
|
$entry = Entry::factory()->create();
|
||||||
|
$entry->audition->addFlag('seats_published');
|
||||||
|
$response = $this->post(route('monitor.enterFlag'), ['entry_id' => $entry->id]);
|
||||||
|
$response->assertRedirect(route('monitor.index'))
|
||||||
|
->assertSessionHas('error');
|
||||||
|
expect($response->getSession()->get('error'))->toBe('Cannot set flags while results are published');
|
||||||
|
});
|
||||||
|
|
||||||
|
it('wont add flags to an entry in an audition with published advancement', function () {
|
||||||
|
$user = User::factory()->create();
|
||||||
|
$user->addFlag('monitor');
|
||||||
|
$user->refresh();
|
||||||
|
actingAs($user);
|
||||||
|
$entry = Entry::factory()->create();
|
||||||
|
$entry->audition->addFlag('advancement_published');
|
||||||
|
$response = $this->post(route('monitor.enterFlag'), ['entry_id' => $entry->id]);
|
||||||
|
$response->assertRedirect(route('monitor.index'))
|
||||||
|
->assertSessionHas('error');
|
||||||
|
expect($response->getSession()->get('error'))->toBe('Cannot set flags while results are published');
|
||||||
|
});
|
||||||
|
|
||||||
|
it('wont add flags to an entry in an audition with scores', function () {
|
||||||
|
$user = User::factory()->create();
|
||||||
|
$user->addFlag('monitor');
|
||||||
|
$user->refresh();
|
||||||
|
actingAs($user);
|
||||||
|
$entry = Entry::factory()->create();
|
||||||
|
DB::table('score_sheets')->insert([
|
||||||
|
'user_id' => $user->id,
|
||||||
|
'entry_id' => $entry->id,
|
||||||
|
'subscores' => json_encode([12, 3, 5]),
|
||||||
|
'seating_total' => 1,
|
||||||
|
'advancement_total' => 1,
|
||||||
|
]);
|
||||||
|
$response = $this->post(route('monitor.enterFlag'), ['entry_id' => $entry->id]);
|
||||||
|
$response->assertRedirect(route('monitor.index'))
|
||||||
|
->assertSessionHas('error');
|
||||||
|
expect($response->getSession()->get('error'))->toBe('That entry has existing scores');
|
||||||
|
});
|
||||||
|
|
||||||
|
it('displays a form to choose a flag for the entry', function () {
|
||||||
|
$user = User::factory()->create();
|
||||||
|
$user->addFlag('monitor');
|
||||||
|
$user->refresh();
|
||||||
|
actingAs($user);
|
||||||
|
$entry = Entry::factory()->create();
|
||||||
|
$response = $this->post(route('monitor.enterFlag'), ['entry_id' => $entry->id]);
|
||||||
|
$response->assertOk()
|
||||||
|
->assertViewIs('monitor_entry_flag_form');
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
describe('method storeFlag stores the flag and returns to the select entry form', function () {
|
||||||
|
it('only allows those assigned to monitor to access this page', function () {
|
||||||
|
$user = User::factory()->create();
|
||||||
|
$entry = Entry::factory()->create();
|
||||||
|
actingAs($user);
|
||||||
|
$response = $this->post(route('monitor.storeFlag', $entry), ['flag' => 'no_show']);
|
||||||
|
$response->assertForbidden();
|
||||||
|
});
|
||||||
|
it('wont add flags to an entry in an audition with published seats', function () {
|
||||||
|
$user = User::factory()->create();
|
||||||
|
$user->addFlag('monitor');
|
||||||
|
$user->refresh();
|
||||||
|
actingAs($user);
|
||||||
|
$entry = Entry::factory()->create();
|
||||||
|
$entry->audition->addFlag('seats_published');
|
||||||
|
$response = $this->post(route('monitor.storeFlag', $entry), ['flag' => 'no_show']);
|
||||||
|
$response->assertRedirect(route('monitor.index'))
|
||||||
|
->assertSessionHas('error');
|
||||||
|
expect($response->getSession()->get('error'))->toBe('Cannot set flags while results are published');
|
||||||
|
});
|
||||||
|
|
||||||
|
it('wont add flags to an entry in an audition with published advancement', function () {
|
||||||
|
$user = User::factory()->create();
|
||||||
|
$user->addFlag('monitor');
|
||||||
|
$user->refresh();
|
||||||
|
actingAs($user);
|
||||||
|
$entry = Entry::factory()->create();
|
||||||
|
$entry->audition->addFlag('advancement_published');
|
||||||
|
$response = $this->post(route('monitor.storeFlag', $entry), ['flag' => 'no_show']);
|
||||||
|
$response->assertRedirect(route('monitor.index'))
|
||||||
|
->assertSessionHas('error');
|
||||||
|
expect($response->getSession()->get('error'))->toBe('Cannot set flags while results are published');
|
||||||
|
});
|
||||||
|
|
||||||
|
it('wont add flags to an entry in an audition with scores', function () {
|
||||||
|
$user = User::factory()->create();
|
||||||
|
$user->addFlag('monitor');
|
||||||
|
$user->refresh();
|
||||||
|
actingAs($user);
|
||||||
|
$entry = Entry::factory()->create();
|
||||||
|
DB::table('score_sheets')->insert([
|
||||||
|
'user_id' => $user->id,
|
||||||
|
'entry_id' => $entry->id,
|
||||||
|
'subscores' => json_encode([12, 3, 5]),
|
||||||
|
'seating_total' => 1,
|
||||||
|
'advancement_total' => 1,
|
||||||
|
]);
|
||||||
|
$response = $this->post(route('monitor.storeFlag', $entry), ['flag' => 'no_show']);
|
||||||
|
$response->assertRedirect(route('monitor.index'))
|
||||||
|
->assertSessionHas('error');
|
||||||
|
expect($response->getSession()->get('error'))->toBe('That entry has existing scores');
|
||||||
|
});
|
||||||
|
|
||||||
|
it('wont add a bogus flag', function () {
|
||||||
|
$user = User::factory()->create();
|
||||||
|
$user->addFlag('monitor');
|
||||||
|
$user->refresh();
|
||||||
|
actingAs($user);
|
||||||
|
$entry = Entry::factory()->create();
|
||||||
|
$response = $this->post(route('monitor.storeFlag', $entry), ['action' => 'nonsense']);
|
||||||
|
$response->assertRedirect(route('monitor.index'))
|
||||||
|
->assertSessionHas('error');
|
||||||
|
expect($response->getSession()->get('error'))->toBe('Invalid action requested');
|
||||||
|
});
|
||||||
|
|
||||||
|
it('can add a failed-prelim tag to an entry', function () {
|
||||||
|
$user = User::factory()->create();
|
||||||
|
$user->addFlag('monitor');
|
||||||
|
$user->refresh();
|
||||||
|
actingAs($user);
|
||||||
|
$entry = Entry::factory()->create();
|
||||||
|
$response = $this->post(route('monitor.storeFlag', $entry), ['action' => 'failed-prelim']);
|
||||||
|
$response->assertRedirect(route('monitor.index'));
|
||||||
|
$entry->refresh();
|
||||||
|
expect($entry->hasFlag('failed_prelim'))->toBeTrue();
|
||||||
|
});
|
||||||
|
|
||||||
|
it('can add a no-show tag to an entry', function () {
|
||||||
|
$user = User::factory()->create();
|
||||||
|
$user->addFlag('monitor');
|
||||||
|
$user->refresh();
|
||||||
|
actingAs($user);
|
||||||
|
$entry = Entry::factory()->create();
|
||||||
|
$response = $this->post(route('monitor.storeFlag', $entry), ['action' => 'no-show']);
|
||||||
|
$response->assertRedirect(route('monitor.index'));
|
||||||
|
$entry->refresh();
|
||||||
|
expect($entry->hasFlag('no_show'))->toBeTrue();
|
||||||
|
});
|
||||||
|
|
||||||
|
it('can clear flags', function () {
|
||||||
|
$user = User::factory()->create();
|
||||||
|
$user->addFlag('monitor');
|
||||||
|
$user->refresh();
|
||||||
|
actingAs($user);
|
||||||
|
$entry = Entry::factory()->create();
|
||||||
|
$entry->addFlag('no_show');
|
||||||
|
$entry->refresh();
|
||||||
|
expect($entry->hasFlag('no_show'))->toBeTrue();
|
||||||
|
$response = $this->post(route('monitor.storeFlag', $entry), ['action' => 'clear']);
|
||||||
|
$response->assertRedirect(route('monitor.index'));
|
||||||
|
$entry->refresh();
|
||||||
|
expect($entry->hasFlag('no_show'))->toBeFalse();
|
||||||
|
});
|
||||||
|
|
||||||
});
|
});
|
||||||
});
|
|
||||||
|
|
|
||||||
|
|
@ -2,11 +2,6 @@ import { defineConfig } from 'vite';
|
||||||
import laravel from 'laravel-vite-plugin';
|
import laravel from 'laravel-vite-plugin';
|
||||||
|
|
||||||
export default defineConfig({
|
export default defineConfig({
|
||||||
server: {
|
|
||||||
cors: {
|
|
||||||
origin: /^https?:\/\/(?:(?:[^:]+\.)?localhost|auditionadmin\.test|127\.0\.0\.1|\[::1\])(?::\d+)?$/,
|
|
||||||
}
|
|
||||||
},
|
|
||||||
plugins: [
|
plugins: [
|
||||||
laravel({
|
laravel({
|
||||||
input: ['resources/css/app.css', 'resources/js/app.js'],
|
input: ['resources/css/app.css', 'resources/js/app.js'],
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue