Compare commits

..

29 Commits

Author SHA1 Message Date
Matt Young 80d7bc3ebe Fix issue with year end resets. 2025-12-13 14:52:11 -06:00
Matt Young 38d7826218 catch exception on judging controller 2025-12-13 11:04:56 -06:00
Matt Young 59629e227d correct missing template info 2025-12-08 20:24:07 -06:00
Matt Young 755f8bdf4a correct testing issue. Monitor controller needs proper tests written. 2025-12-08 15:58:24 -06:00
Matt Young bf502f4cbb fix duplicate route name 2025-12-08 15:49:44 -06:00
Matt Young 2ffe14e43c fix duplicate route nqame 2025-12-08 11:30:18 -06:00
Matt Young d55be47f41 Update logging config. 2025-12-08 10:56:41 -06:00
Matt Young 1c3bb39805 Add console command to force recalculation of judge totals 2025-11-20 11:21:17 -06:00
Matt Young 55d5dba840 Fix error where a modified subscore would not count for seating if there is no advancement. 2025-11-20 10:37:45 -06:00
Matt Young a5b203af2e Allow printing of blank sheet of cards 2025-11-16 15:29:33 -06:00
Matt Young 5bbcccdc22 update vite config 2025-11-16 15:23:42 -06:00
Matt Young a9551a1dd6 update packages 2025-11-09 16:34:32 -06:00
Matt Young 7d94ee2cfb add page listing school email domains. 2025-11-09 15:47:08 -06:00
Matt Young 87e3ec322d Quickfix dealing with a student incorrectly identifying as a doubler when not entered for seating in one audition but only advancement 2025-11-08 17:16:21 -06:00
Matt Young 6f657415aa Fix issue with seating including advance only entries. 2025-11-08 15:55:26 -06:00
Matt Young 67ceae6f01 Fix issue in advancement - ignore seating only 2025-11-08 13:43:08 -06:00
Matt Young a59217db41 Fix error in card printing 2025-11-06 17:22:40 -06:00
Matt Young 402cbf8c83 Show what a student is auditioning for on their cards if advancement audition 2025-11-06 07:30:09 -06:00
Matt Young be621606e2 Show doublers on cards. 2025-11-05 06:55:12 -06:00
Matt Young 59c5ae8526 Show doublers on sign in sheets. 2025-11-05 06:48:52 -06:00
Matt Young 7347059d96 only bill for students entered for seating. 2025-11-05 06:40:39 -06:00
Matt Young 834de902ac Update results on directors page to add explaination. 2025-11-03 09:02:41 -06:00
Matt Young 165d2c9f6c Fixed issue with results output 2025-11-03 07:13:59 -06:00
Matt Young 3208b31524 Undo prelim score on results page 2025-11-01 15:41:59 -05:00
Matt Young b8a4cf5f39 Undo prelim score on results page 2025-11-01 13:44:46 -05:00
Matt Young 67622ec0c9 Undo prelim score on results page 2025-11-01 12:50:37 -05:00
Matt Young fb77923812 Show prelim score on seating page. 2025-11-01 12:45:02 -05:00
Matt Young bfee058078 Show prelim score on seating page. 2025-11-01 12:41:53 -05:00
Matt Young 10a4d1a140 Add abilitly for admin to manually set password for users 2025-10-28 11:35:30 -05:00
35 changed files with 806 additions and 441 deletions

View File

@ -78,11 +78,15 @@ class PrintSignInSheets
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['instrument'], $this->bodyRowHeight, $entry->audition->name, 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(0, $this->bodyRowHeight, ' ', 1, 1, 'L');
}

View File

@ -58,17 +58,37 @@ class QuarterPageCards implements PrintCards
$this->pdf->Cell(4.5, .5, $entry->audition->name.' #'.$entry->draw_number);
// Fill in student information
$nameLine = $entry->student->full_name();
if ($entry->student->isDoublerInEvent($entry->audition->event_id)) {
$nameLine .= ' (D)';
}
$this->pdf->SetFont('Arial', '', 10);
$xLoc = $this->offset[$this->quadOn][0] + 1;
$yLoc = $this->offset[$this->quadOn][1] + 3.1;
$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->Cell(4.5, .25, $entry->student->school->name);
$this->pdf->setXY($xLoc, $yLoc + .5);
if (! is_null($entry->audition->room_id)) {
$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++;
}

View File

@ -33,7 +33,7 @@ class GetExportData
foreach ($events as $event) {
$auditions = $event->auditions;
foreach ($auditions as $audition) {
$entries = $ranker->rank('seating', $audition);
$entries = $ranker($audition, 'seating');
foreach ($entries as $entry) {
$thisRow = $audition->name.',';
$thisRow .= $entry->raw_rank ?? '';
@ -41,7 +41,7 @@ class GetExportData
$thisRow .= $entry->student->full_name().',';
$thisRow .= $entry->student->school->name.',';
$thisRow .= $entry->student->grade.',';
$thisRow .= $entry->score_totals[0] ?? '';
$thisRow .= $entry->totalScore->seating_total ?? '';
$thisRow .= ',';
if ($entry->hasFlag('failed_prelim')) {
$thisRow .= 'Failed Prelim';

View File

@ -24,7 +24,7 @@ class RankAuditionEntries
*
* @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') {
throw new AuditionAdminException('Invalid rank type (must be seating or advancement)');
@ -33,8 +33,8 @@ class RankAuditionEntries
$cache_duration = 15;
if ($rank_type === 'seating') {
return cache()->remember('rank_seating_'.$audition->id, $cache_duration, function () use ($audition) {
return $this->get_seating_ranks($audition);
return cache()->remember('rank_seating_'.$audition->id, $cache_duration, function () use ($audition, $pullDeclinedEntries) {
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) {
$totalColumn = 'seating_total_with_bonus';
@ -53,6 +53,7 @@ class RankAuditionEntries
}
$sortedEntries = $audition->entries()
->where('for_seating', true)
->whereHas('totalScore')
->with('totalScore')
->with('student.school')
@ -74,7 +75,7 @@ class RankAuditionEntries
$rankOn = 1;
foreach ($sortedEntries as $entry) {
if ($entry->hasFlag('declined')) {
if ($entry->hasFlag('declined') && $pullDeclinedEntries) {
$entry->seatingRank = 'declined';
} else {
$entry->seatingRank = $rankOn;

View File

@ -65,14 +65,14 @@ class YearEndCleanup
if (is_array($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('room_user')->truncate();
DB::table('rooms')->delete();
DB::table('rooms')->where('id', '>', 0)->delete();
}
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']);
}

View File

@ -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);
}
}

View File

@ -8,14 +8,14 @@ use Illuminate\Console\Command;
/**
* @codeCoverageIgnore
*/
class RecalculateScores extends Command
class RecalculateTotalScores extends Command
{
/**
* The name and signature of the console command.
*
* @var string
*/
protected $signature = 'audition:recalculate-scores';
protected $signature = 'audition:recalculate-total-scores';
/**
* The console command description.

View File

@ -27,11 +27,15 @@ class PrintCards extends Controller
public function print(\App\Actions\Print\PrintCards $printer)
{
//dump(request()->all());
if (request()->audition == null) {
return redirect()->back()->with('error', 'You must specify at least one audition');
// dump(request()->all());
// if (request()->audition == null) {
// 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);
// Process Filters
@ -62,6 +66,6 @@ class PrintCards extends Controller
}
$cards = $cards->sortBy($sorts);
$printer->print($cards);
//return view('admin.print_cards.print', compact('cards'));
// return view('admin.print_cards.print', compact('cards'));
}
}

View File

@ -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'));
}
}

View File

@ -110,6 +110,10 @@ class ScoringGuideController extends Controller
'Cannot update a subscore for a different scoring guide');
}
$validateData = $validateData = $request->validated();
if (! auditionSetting('advanceTo')) {
$validateData['for_advance'] = 0;
$validateData['for_seating'] = 1;
}
$subscore->update([
'name' => $validateData['name'],

View File

@ -15,9 +15,12 @@ use App\Models\AuditLogEntry;
use App\Models\School;
use App\Models\User;
use Illuminate\Http\Request;
use Illuminate\Support\Facades\Hash;
use Illuminate\Support\Facades\Mail;
use Illuminate\Support\Str;
use function auditionLog;
class UserController extends Controller
{
public function index()
@ -31,7 +34,8 @@ class UserController extends Controller
{
$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();
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');
}
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);
}
}

View File

@ -3,6 +3,7 @@
namespace App\Http\Controllers\Judging;
use App\Actions\Tabulation\EnterScore;
use App\Exceptions\AuditionAdminException;
use App\Http\Controllers\Controller;
use App\Models\Audition;
use App\Models\Entry;
@ -30,7 +31,7 @@ class JudgingController extends Controller
$rooms = Auth::user()->judgingAssignments()->with('auditions')->with('prelimAuditions')->get();
$bonusScoresToJudge = Auth::user()->bonusJudgingAssignments()->with('auditions')->get();
//$rooms->load('auditions');
// $rooms->load('auditions');
return view('judging.index', compact('rooms', 'bonusScoresToJudge'));
}
@ -100,7 +101,11 @@ class JudgingController extends Controller
// Enter the score
/** @noinspection PhpUnhandledExceptionInspection */
$enterScore(Auth::user(), $entry, $validatedData['score']);
try {
$enterScore(Auth::user(), $entry, $validatedData['score']);
} catch (AuditionAdminException $e) {
return redirect()->back()->with('error', $e->getMessage());
}
// Deal with an advancement vote if needed
$this->advancementVote($request, $entry);

View File

@ -45,7 +45,15 @@ class PrelimJudgingController extends Controller
$oldSheet = PrelimScoreSheet::where('user_id', Auth::id())->where('entry_id',
$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'));
}
/**

View File

@ -73,7 +73,7 @@ class AdvancementController extends Controller
$entries = $ranker($audition, 'advancement');
$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');
});
@ -81,7 +81,7 @@ class AdvancementController extends Controller
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');
});

View File

@ -29,7 +29,7 @@ class Entry extends Model
/**
* @throws AuditionAdminException
*/
public function rank(string $type)
public function rank(string $type, bool $pullDeclinedEntries = true)
{
$ranker = app(RankAuditionEntries::class);
@ -39,11 +39,11 @@ class Entry extends Model
}
// 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 ($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;

View File

@ -35,7 +35,7 @@ class InvoiceOneFeePerStudent implements InvoiceDataService
/** @noinspection PhpArrayIndexImmediatelyRewrittenInspection */
$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) {
$firstEntryForStudent = true;
foreach ($entries[$student->id] ?? [] as $entry) {

View File

@ -35,7 +35,7 @@ class InvoiceOneFeePerStudentPerEvent implements InvoiceDataService
/** @noinspection PhpArrayIndexImmediatelyRewrittenInspection */
$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) {
$eventsEntered = [];
foreach ($entries[$student->id] ?? [] as $entry) {

4
composer.lock generated
View File

@ -10004,12 +10004,12 @@
],
"aliases": [],
"minimum-stability": "stable",
"stability-flags": [],
"stability-flags": {},
"prefer-stable": true,
"prefer-lowest": false,
"platform": {
"php": "^8.2"
},
"platform-dev": [],
"platform-dev": {},
"plugin-api-version": "2.6.0"
}

View File

@ -78,7 +78,7 @@ return [
'url' => env('LOG_SLACK_WEBHOOK_URL'),
'username' => env('LOG_SLACK_USERNAME', 'Laravel Log'),
'emoji' => env('LOG_SLACK_EMOJI', ':boom:'),
'level' => env('LOG_LEVEL', 'critical'),
'level' => env('LOG_LEVEL', 'debug'),
'replace_placeholders' => true,
],

737
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@ -18,6 +18,7 @@
</include>
</source>
<php>
<ini name="memory_limit" value="512M"/>
<env name="APP_ENV" value="testing"/>
<env name="APP_MAINTENANCE_DRIVER" value="file"/>
<env name="BCRYPT_ROUNDS" value="4"/>

View File

@ -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>

View File

@ -54,6 +54,21 @@
</x-form.form>
</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.heading>User Actions</x-card.heading>
<x-table.table>

View File

@ -13,8 +13,7 @@
<tr>
<x-table.th>Name</x-table.th>
<x-table.th>School</x-table.th>
<x-table.th>Email</x-table.th>
<x-table.th>Cell Phone</x-table.th>
<x-table.th>Cell Phone<br />Email</x-table.th>
<x-table.th>Judging Preference</x-table.th>
<x-table.th>Privileges</x-table.th>
</tr>
@ -22,10 +21,16 @@
<x-table.body>
@foreach($users as $user)
<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->email }}</x-table.td>
<x-table.td>{{ $user->cell_phone }}</x-table.td>
<x-table.td>{{ $user->cell_phone }}<br/>{{ $user->email }}</x-table.td>
<x-table.td>{{ $user->judging_preference }}</x-table.td>
<x-table.td>
@if($user->is_admin)

View File

@ -2,7 +2,7 @@
<x-layout.page-header>Year End Reset</x-layout.page-header>
<x-card.card class="mt-5 max-w-xl m-auto">
<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="Remove Auditions From Rooms" value="removeAuditionsFromRoom" />
<x-form.checkbox name="options[]" label="Unassign Judges" value="unassignJudges" />

View File

@ -23,6 +23,7 @@
<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.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.entries.index')}}" class="block p-2 hover:text-indigo-600">Entries</a>
@if(auditionSetting('nomination_ensemble_rules') !== 'disabled')

View File

@ -29,14 +29,14 @@
<option value="user">Director</option>
<option value="admin" selected>Admin</option>
</x-form.select>
<x-layout.nav-link href="/admin" :active="request()->is('admin')">Dashboard</x-layout.nav-link>
<x-layout.nav-link href="/admin/users" :active="request()->is('admin/users')">Users</x-layout.nav-link>
<x-layout.nav-link href="/admin/schools" :active="request()->is('admin/schools')">Schools</x-layout.nav-link>
<x-layout.nav-link href="/admin/students" :active="request()->is('admin/students')">Students</x-layout.nav-link>
<x-layout.nav-link href="/admin/entries" :active="request()->is('admin/entries')">Entries</x-layout.nav-link>
<x-layout.nav-link href="/admin/auditions" :active="request()->is('admin/auditions')">Auditions</x-layout.nav-link>
<x-layout.nav-link href="/admin/scoring" :active="request()->is('admin/scoring')">Scoring</x-layout.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" :active="request()->is('admin')">Dashboard</x-layout.navbar.nav-link>
<x-layout.navbar.nav-link href="/admin/users" :active="request()->is('admin/users')">Users</x-layout.navbar.nav-link>
<x-layout.navbar.nav-link href="/admin/schools" :active="request()->is('admin/schools')">Schools</x-layout.navbar.nav-link>
<x-layout.navbar.nav-link href="/admin/students" :active="request()->is('admin/students')">Students</x-layout.navbar.nav-link>
<x-layout.navbar.nav-link href="/admin/entries" :active="request()->is('admin/entries')">Entries</x-layout.navbar.nav-link>
<x-layout.navbar.nav-link href="/admin/auditions" :active="request()->is('admin/auditions')">Auditions</x-layout.navbar.nav-link>
<x-layout.navbar.nav-link href="/admin/scoring" :active="request()->is('admin/scoring')">Scoring</x-layout.navbar.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="/students" class="text-white hover:bg-indigo-500 hover:bg-opacity-75 rounded-md px-3 py-2 text-sm font-medium">Students</a>--}}

View File

@ -53,7 +53,12 @@
<x-layout.page-section>
<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">
<x-table.table>
<thead>
@ -67,7 +72,12 @@
@endif
<x-table.th spacer_only>
<span class="sr-only">Edit</span>
</x-table.th>
<x-table.th>
Seat
</x-table.th>
<x-table.th>Rank</x-table.th>
</tr>
</thead>
<x-table.body>
@ -107,6 +117,24 @@
@endif
</x-table.td>
@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>
@php

View File

@ -15,11 +15,9 @@
</ul>
</x-slot:subheading>
</x-card.heading>
<x-form.form method="POST" action="{{ route('judging.savePrelimScoreSheet', $entry) }}">
@if($oldSheet)
{{-- if there are existing scores, make this a patch request --}}
@method('PATCH')
@endif
<x-form.form method="POST" action="{{ route($formRoute, $entry) }}">
@method($formMethod)
<x-card.list.body class="mt-1">
@foreach($entry->audition->prelimDefinition->scoringGuide->subscores()->orderBy('display_order')->get() as $subscore)
@php

View File

@ -8,6 +8,9 @@
<x-table.th>Draw #</x-table.th>
<x-table.th>Student</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
@if($audition->bonusScore()->count() > 0)
<br>
@ -59,6 +62,9 @@
</x-table.td>
@if($audition->prelimDefinition)
<x-table.td>{{ round($entry->prelimTotalScore(),2) }}</x-table.td>
@endif
<x-table.td class="align-top">
@if($audition->bonusScore()->count() > 0)
@if($entry->totalScore->bonus_total)

View File

@ -19,6 +19,7 @@ use App\Http\Controllers\Admin\PrintStandNameTagsController;
use App\Http\Controllers\Admin\RecapController;
use App\Http\Controllers\Admin\RoomController;
use App\Http\Controllers\Admin\SchoolController;
use App\Http\Controllers\Admin\SchoolEmailDomainController;
use App\Http\Controllers\Admin\ScoringGuideController;
use App\Http\Controllers\Admin\StudentController;
use App\Http\Controllers\Admin\UserController;
@ -37,7 +38,7 @@ Route::middleware(['auth', 'verified', CheckIfAdmin::class])->prefix('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', [
AuditionController::class, 'roomUpdate',
@ -168,6 +169,8 @@ Route::middleware(['auth', 'verified', CheckIfAdmin::class])->prefix('admin/')->
});
// 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::post('/{school}/add_domain', 'add_domain')->name('admin.schools.add_domain');
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::patch('/{user}', 'update')->name('admin.users.update');
Route::delete('/{user}', 'destroy')->name('admin.users.destroy');
Route::post('/{user}/set_password', 'setPassword')->name('admin.users.setPassword');
});
// Admin Card Routes

View File

@ -22,7 +22,7 @@ Route::middleware(['auth', 'verified', CheckIfCanJudge::class])->prefix('judging
Route::get('/{prelimDefinition}', 'prelimEntryList')->name('judging.prelimEntryList');
route::get('/enterScore/{entry}', 'prelimScoreEntryForm')->name('judging.prelimScoreEntryForm');
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

View File

@ -25,7 +25,7 @@ it('calls the YearEndCleanup action', function () {
$mock->shouldReceive('__invoke')->once();
app()->instance(YearEndCleanup::class, $mock);
actAsAdmin();
$response = $this->post(route('admin.year_end_procedures'));
$response = $this->post(route('admin.execute_year_end_procedures'));
$response->assertRedirect(route('dashboard'))
->with('success', 'Year end cleanup completed. ');
});

View File

@ -1,6 +1,5 @@
<?php
use App\Models\Entry;
use App\Models\User;
use Illuminate\Foundation\Testing\RefreshDatabase;
@ -15,183 +14,8 @@ describe('index method', function () {
$response = $this->get(route('monitor.index'));
$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();
});
});

View File

@ -2,6 +2,11 @@ import { defineConfig } from 'vite';
import laravel from 'laravel-vite-plugin';
export default defineConfig({
server: {
cors: {
origin: /^https?:\/\/(?:(?:[^:]+\.)?localhost|auditionadmin\.test|127\.0\.0\.1|\[::1\])(?::\d+)?$/,
}
},
plugins: [
laravel({
input: ['resources/css/app.css', 'resources/js/app.js'],