Compare commits
29 Commits
import_fun
...
master
| Author | SHA1 | Date |
|---|---|---|
|
|
80d7bc3ebe | |
|
|
38d7826218 | |
|
|
59629e227d | |
|
|
755f8bdf4a | |
|
|
bf502f4cbb | |
|
|
2ffe14e43c | |
|
|
d55be47f41 | |
|
|
1c3bb39805 | |
|
|
55d5dba840 | |
|
|
a5b203af2e | |
|
|
5bbcccdc22 | |
|
|
a9551a1dd6 | |
|
|
7d94ee2cfb | |
|
|
87e3ec322d | |
|
|
6f657415aa | |
|
|
67ceae6f01 | |
|
|
a59217db41 | |
|
|
402cbf8c83 | |
|
|
be621606e2 | |
|
|
59c5ae8526 | |
|
|
7347059d96 | |
|
|
834de902ac | |
|
|
165d2c9f6c | |
|
|
3208b31524 | |
|
|
b8a4cf5f39 | |
|
|
67622ec0c9 | |
|
|
fb77923812 | |
|
|
bfee058078 | |
|
|
10a4d1a140 |
|
|
@ -78,11 +78,15 @@ 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, $entry->student->full_name(), 1, 0, 'L');
|
$this->pdf->Cell($this->columnWidth['name'], $this->bodyRowHeight, $nameLine, 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,17 +58,37 @@ 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, $entry->student->full_name());
|
$this->pdf->Cell(4.5, .25, $nameLine);
|
||||||
$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->rank('seating', $audition);
|
$entries = $ranker($audition, 'seating');
|
||||||
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->score_totals[0] ?? '';
|
$thisRow .= $entry->totalScore->seating_total ?? '';
|
||||||
$thisRow .= ',';
|
$thisRow .= ',';
|
||||||
if ($entry->hasFlag('failed_prelim')) {
|
if ($entry->hasFlag('failed_prelim')) {
|
||||||
$thisRow .= 'Failed Prelim';
|
$thisRow .= 'Failed Prelim';
|
||||||
|
|
|
||||||
|
|
@ -24,7 +24,7 @@ class RankAuditionEntries
|
||||||
*
|
*
|
||||||
* @throws AuditionAdminException
|
* @throws AuditionAdminException
|
||||||
*/
|
*/
|
||||||
public function __invoke(Audition $audition, string $rank_type): Collection|Entry
|
public function __invoke(Audition $audition, string $rank_type, bool $pullDeclinedEntries = true): 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) {
|
return cache()->remember('rank_seating_'.$audition->id, $cache_duration, function () use ($audition, $pullDeclinedEntries) {
|
||||||
return $this->get_seating_ranks($audition);
|
return $this->get_seating_ranks($audition, $pullDeclinedEntries);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -44,7 +44,7 @@ class RankAuditionEntries
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private function get_seating_ranks(Audition $audition): Collection|Entry
|
private function get_seating_ranks(Audition $audition, bool $pullDeclinedEntries = true): Collection|Entry
|
||||||
{
|
{
|
||||||
if ($audition->bonusScore()->count() > 0) {
|
if ($audition->bonusScore()->count() > 0) {
|
||||||
$totalColumn = 'seating_total_with_bonus';
|
$totalColumn = 'seating_total_with_bonus';
|
||||||
|
|
@ -53,6 +53,7 @@ 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')
|
||||||
|
|
@ -74,7 +75,7 @@ class RankAuditionEntries
|
||||||
|
|
||||||
$rankOn = 1;
|
$rankOn = 1;
|
||||||
foreach ($sortedEntries as $entry) {
|
foreach ($sortedEntries as $entry) {
|
||||||
if ($entry->hasFlag('declined')) {
|
if ($entry->hasFlag('declined') && $pullDeclinedEntries) {
|
||||||
$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' => null]);
|
DB::table('auditions')->update(['room_id' => 0]);
|
||||||
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')->delete();
|
DB::table('rooms')->where('id', '>', 0)->delete();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (in_array('removeAuditionsFromRoom', $options)) {
|
if (in_array('removeAuditionsFromRoom', $options)) {
|
||||||
DB::table('auditions')->update(['room_id' => null]);
|
DB::table('auditions')->update(['room_id' => 0]);
|
||||||
DB::table('auditions')->update(['order_in_room' => '0']);
|
DB::table('auditions')->update(['order_in_room' => '0']);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,41 @@
|
||||||
|
<?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 RecalculateScores extends Command
|
class RecalculateTotalScores 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-scores';
|
protected $signature = 'audition:recalculate-total-scores';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The console command description.
|
* The console command description.
|
||||||
|
|
@ -28,10 +28,14 @@ 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);
|
$selectedAuditionIds = array_keys(request()->audition);
|
||||||
|
} else {
|
||||||
|
$selectedAuditionIds = [];
|
||||||
|
}
|
||||||
$cardQuery = Entry::whereIn('audition_id', $selectedAuditionIds);
|
$cardQuery = Entry::whereIn('audition_id', $selectedAuditionIds);
|
||||||
|
|
||||||
// Process Filters
|
// Process Filters
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,16 @@
|
||||||
|
<?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,6 +110,10 @@ 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'],
|
||||||
|
|
|
||||||
|
|
@ -15,9 +15,12 @@ use App\Models\AuditLogEntry;
|
||||||
use App\Models\School;
|
use App\Models\School;
|
||||||
use App\Models\User;
|
use App\Models\User;
|
||||||
use Illuminate\Http\Request;
|
use Illuminate\Http\Request;
|
||||||
|
use Illuminate\Support\Facades\Hash;
|
||||||
use Illuminate\Support\Facades\Mail;
|
use Illuminate\Support\Facades\Mail;
|
||||||
use Illuminate\Support\Str;
|
use Illuminate\Support\Str;
|
||||||
|
|
||||||
|
use function auditionLog;
|
||||||
|
|
||||||
class UserController extends Controller
|
class UserController extends Controller
|
||||||
{
|
{
|
||||||
public function index()
|
public function index()
|
||||||
|
|
@ -31,7 +34,8 @@ class UserController extends Controller
|
||||||
{
|
{
|
||||||
|
|
||||||
$schools = School::orderBy('name')->get();
|
$schools = School::orderBy('name')->get();
|
||||||
$logEntries = AuditLogEntry::whereJsonContains('affected->users', $user->id)->orderBy('created_at', 'desc')->get();
|
$logEntries = AuditLogEntry::whereJsonContains('affected->users', $user->id)->orderBy('created_at',
|
||||||
|
'desc')->get();
|
||||||
$userActions = AuditLogEntry::where('user', $user->email)->orderBy('created_at', 'desc')->get();
|
$userActions = AuditLogEntry::where('user', $user->email)->orderBy('created_at', 'desc')->get();
|
||||||
|
|
||||||
return view('admin.users.edit', compact('user', 'schools', 'logEntries', 'userActions'));
|
return view('admin.users.edit', compact('user', 'schools', 'logEntries', 'userActions'));
|
||||||
|
|
@ -122,4 +126,22 @@ class UserController extends Controller
|
||||||
|
|
||||||
return redirect()->route('admin.users.index')->with('success', 'User deleted successfully');
|
return redirect()->route('admin.users.index')->with('success', 'User deleted successfully');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function setPassword(User $user, Request $request)
|
||||||
|
{
|
||||||
|
$validated = $request->validate([
|
||||||
|
'admin_password' => ['required', 'string', 'current_password:web'],
|
||||||
|
'new_password' => ['required', 'string', 'confirmed', 'min:8'],
|
||||||
|
]);
|
||||||
|
$user->forceFill([
|
||||||
|
'password' => Hash::make($validated['new_password']),
|
||||||
|
])->save();
|
||||||
|
|
||||||
|
auditionLog('Manually set password for '.$user->email, [
|
||||||
|
'users' => [$user->id],
|
||||||
|
]);
|
||||||
|
|
||||||
|
return redirect()->route('admin.users.index')->with('success',
|
||||||
|
'Password changed successfully for '.$user->email);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -3,6 +3,7 @@
|
||||||
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;
|
||||||
|
|
@ -100,7 +101,11 @@ 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,7 +45,15 @@ 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;
|
||||||
|
|
||||||
return view('judging.prelim_entry_form', compact('entry', 'oldSheet'));
|
if ($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()->orderBy('draw_number')->get()->filter(function ($entry) {
|
$unscoredEntries = $audition->entries()->where('for_advancement', true)->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->every(function ($entry) {
|
$scoringComplete = $audition->entries->where('for_advancement', true)->every(function ($entry) {
|
||||||
return $entry->totalScore || $entry->hasFlag('no_show');
|
return $entry->totalScore || $entry->hasFlag('no_show');
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -29,7 +29,7 @@ class Entry extends Model
|
||||||
/**
|
/**
|
||||||
* @throws AuditionAdminException
|
* @throws AuditionAdminException
|
||||||
*/
|
*/
|
||||||
public function rank(string $type)
|
public function rank(string $type, bool $pullDeclinedEntries = true)
|
||||||
{
|
{
|
||||||
$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);
|
$rankedEntries = $ranker($this->audition, $type, $pullDeclinedEntries);
|
||||||
|
|
||||||
// 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;
|
return $rankedEntries->where('id', $this->id)->first()->seatingRank ?? 'No Rank';
|
||||||
}
|
}
|
||||||
|
|
||||||
return $rankedEntries->where('id', $this->id)->first()->advancementRank;
|
return $rankedEntries->where('id', $this->id)->first()->advancementRank;
|
||||||
|
|
|
||||||
|
|
@ -35,7 +35,7 @@ class InvoiceOneFeePerStudent implements InvoiceDataService
|
||||||
/** @noinspection PhpArrayIndexImmediatelyRewrittenInspection */
|
/** @noinspection PhpArrayIndexImmediatelyRewrittenInspection */
|
||||||
$invoiceData['grandTotal'] = 0;
|
$invoiceData['grandTotal'] = 0;
|
||||||
|
|
||||||
$entries = $school->entries()->with('audition')->orderBy('created_at', 'desc')->get()->groupBy('student_id');
|
$entries = $school->entries()->where('for_seating', true)->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()->with('audition')->orderBy('created_at', 'desc')->get()->groupBy('student_id');
|
$entries = $school->entries()->where('for_seating', true)->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', 'critical'),
|
'level' => env('LOG_LEVEL', 'debug'),
|
||||||
'replace_placeholders' => true,
|
'replace_placeholders' => true,
|
||||||
],
|
],
|
||||||
|
|
||||||
|
|
|
||||||
File diff suppressed because it is too large
Load Diff
|
|
@ -18,6 +18,7 @@
|
||||||
</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,30 @@
|
||||||
|
<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>
|
||||||
|
|
@ -54,6 +54,21 @@
|
||||||
</x-form.form>
|
</x-form.form>
|
||||||
</x-card.card>
|
</x-card.card>
|
||||||
|
|
||||||
|
<x-card.card class="max-w-lg mx-auto mt-5" x-data="{ showPasswordForm: false}">
|
||||||
|
<x-card.heading @click="showPasswordForm = !showPasswordForm">
|
||||||
|
Manually Set Password
|
||||||
|
</x-card.heading>
|
||||||
|
<div class="mb-5 mt-3" x-cloak x-show="showPasswordForm">
|
||||||
|
<x-form.form method="POST" action="{{ route('admin.users.setPassword', $user) }}">
|
||||||
|
<x-form.field name="admin_password" label_text="YOUR password" type="password"/>
|
||||||
|
<x-form.field name="new_password" label_text="New password for {{ $user->email }}" type="password"/>
|
||||||
|
<x-form.field name="new_password_confirmation" label_text="Confirm new password for {{ $user->email }}"
|
||||||
|
type="password"/>
|
||||||
|
<x-form.button class="mt-3">Update Password</x-form.button>
|
||||||
|
</x-form.form>
|
||||||
|
</div>
|
||||||
|
</x-card.card>
|
||||||
|
|
||||||
<x-card.card class="mt-5">
|
<x-card.card class="mt-5">
|
||||||
<x-card.heading>User Actions</x-card.heading>
|
<x-card.heading>User Actions</x-card.heading>
|
||||||
<x-table.table>
|
<x-table.table>
|
||||||
|
|
|
||||||
|
|
@ -13,8 +13,7 @@
|
||||||
<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>Email</x-table.th>
|
<x-table.th>Cell Phone<br />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>
|
||||||
|
|
@ -22,10 +21,16 @@
|
||||||
<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><a href="{{ route('admin.users.edit',$user) }}">{{ $user->full_name(true) }}</a>{{ $user->hasFlag('head_director') ? ' *':'' }}</x-table.td>
|
<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->email }}</x-table.td>
|
<x-table.td>{{ $user->cell_phone }}<br/>{{ $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.year_end_procedures') }}">
|
<x-form.form action="{{ route('admin.execute_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" />
|
||||||
|
|
|
||||||
|
|
@ -23,6 +23,7 @@
|
||||||
<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.nav-link href="/admin" :active="request()->is('admin')">Dashboard</x-layout.nav-link>
|
<x-layout.navbar.nav-link href="/admin" :active="request()->is('admin')">Dashboard</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/users" :active="request()->is('admin/users')">Users</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/schools" :active="request()->is('admin/schools')">Schools</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/students" :active="request()->is('admin/students')">Students</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/entries" :active="request()->is('admin/entries')">Entries</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/auditions" :active="request()->is('admin/auditions')">Auditions</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/scoring" :active="request()->is('admin/scoring')">Scoring</x-layout.navbar.nav-link>
|
||||||
<x-layout.nav-link href="/admin/rooms" :active="request()->is('admin/rooms')">Rooms</x-layout.nav-link>
|
<x-layout.navbar.nav-link href="/admin/rooms" :active="request()->is('admin/rooms')">Rooms</x-layout.navbar.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,7 +53,12 @@
|
||||||
|
|
||||||
<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>You have {{ $entries->count() }} entries</x-slot:section_description>
|
<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>
|
||||||
|
|
@ -67,7 +72,12 @@
|
||||||
@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>
|
||||||
|
|
@ -107,6 +117,24 @@
|
||||||
@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
|
||||||
|
|
|
||||||
|
|
@ -15,11 +15,9 @@
|
||||||
</ul>
|
</ul>
|
||||||
</x-slot:subheading>
|
</x-slot:subheading>
|
||||||
</x-card.heading>
|
</x-card.heading>
|
||||||
<x-form.form method="POST" action="{{ route('judging.savePrelimScoreSheet', $entry) }}">
|
<x-form.form method="POST" action="{{ route($formRoute, $entry) }}">
|
||||||
@if($oldSheet)
|
@method($formMethod)
|
||||||
{{-- 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,6 +8,9 @@
|
||||||
<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>
|
||||||
|
|
@ -59,6 +62,9 @@
|
||||||
|
|
||||||
|
|
||||||
</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)
|
||||||
|
|
|
||||||
|
|
@ -19,6 +19,7 @@ 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\StudentController;
|
use App\Http\Controllers\Admin\StudentController;
|
||||||
use App\Http\Controllers\Admin\UserController;
|
use App\Http\Controllers\Admin\UserController;
|
||||||
|
|
@ -37,7 +38,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.year_end_procedures');
|
Route::post('/year_end_procedures', [YearEndResetController::class, 'execute'])->name('admin.execute_year_end_procedures');
|
||||||
|
|
||||||
Route::post('/auditions/roomUpdate', [
|
Route::post('/auditions/roomUpdate', [
|
||||||
AuditionController::class, 'roomUpdate',
|
AuditionController::class, 'roomUpdate',
|
||||||
|
|
@ -168,6 +169,8 @@ 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');
|
||||||
|
|
@ -191,6 +194,7 @@ Route::middleware(['auth', 'verified', CheckIfAdmin::class])->prefix('admin/')->
|
||||||
Route::get('/{user}/edit', 'edit')->name('admin.users.edit');
|
Route::get('/{user}/edit', 'edit')->name('admin.users.edit');
|
||||||
Route::patch('/{user}', 'update')->name('admin.users.update');
|
Route::patch('/{user}', 'update')->name('admin.users.update');
|
||||||
Route::delete('/{user}', 'destroy')->name('admin.users.destroy');
|
Route::delete('/{user}', 'destroy')->name('admin.users.destroy');
|
||||||
|
Route::post('/{user}/set_password', 'setPassword')->name('admin.users.setPassword');
|
||||||
});
|
});
|
||||||
|
|
||||||
// Admin Card Routes
|
// Admin Card Routes
|
||||||
|
|
|
||||||
|
|
@ -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.savePrelimScoreSheet');
|
route::patch('/enterScore/{entry}', 'updatePrelimScoreSheet')->name('judging.updatePrelimScoreSheet');
|
||||||
});
|
});
|
||||||
|
|
||||||
// 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.year_end_procedures'));
|
$response = $this->post(route('admin.execute_year_end_procedures'));
|
||||||
$response->assertRedirect(route('dashboard'))
|
$response->assertRedirect(route('dashboard'))
|
||||||
->with('success', 'Year end cleanup completed. ');
|
->with('success', 'Year end cleanup completed. ');
|
||||||
});
|
});
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,5 @@
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
use App\Models\Entry;
|
|
||||||
use App\Models\User;
|
use App\Models\User;
|
||||||
use Illuminate\Foundation\Testing\RefreshDatabase;
|
use Illuminate\Foundation\Testing\RefreshDatabase;
|
||||||
|
|
||||||
|
|
@ -15,183 +14,8 @@ 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 () {
|
||||||
it('presents a form to choose an entry', function () {
|
// TODO: Write tests for new monitor pabe
|
||||||
$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,6 +2,11 @@ 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