Compare commits
39 Commits
pass_fail_
...
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 | |
|
|
2dfb745861 | |
|
|
3315efc83b | |
|
|
4548be098a | |
|
|
1acb286ac8 | |
|
|
6ca05bf4d5 | |
|
|
550614a317 | |
|
|
a5f11fb897 | |
|
|
69be2b7ed0 | |
|
|
956d70a90e | |
|
|
0ca239d297 |
|
|
@ -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';
|
||||||
|
|
|
||||||
|
|
@ -8,19 +8,27 @@ use App\Models\User;
|
||||||
|
|
||||||
class AssignUserToSchool
|
class AssignUserToSchool
|
||||||
{
|
{
|
||||||
public function __invoke(User $user, School|int $school): void
|
public function __invoke(User $user, School|int|null $school): void
|
||||||
{
|
{
|
||||||
$this->assign($user, $school);
|
$this->assign($user, $school);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function assign(User $user, School|int $school, bool $addDomainToSchool = true): void
|
public function assign(User $user, School|int|null $school, bool $addDomainToSchool = true): void
|
||||||
{
|
{
|
||||||
|
if (! User::where('id', $user->id)->exists()) {
|
||||||
|
throw new AuditionAdminException('User does not exist');
|
||||||
|
}
|
||||||
|
|
||||||
if (is_int($school)) {
|
if (is_int($school)) {
|
||||||
$school = School::find($school);
|
$school = School::find($school);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (! User::where('id', $user->id)->exists()) {
|
if (is_null($school)) {
|
||||||
throw new AuditionAdminException('User does not exist');
|
$user->update([
|
||||||
|
'school_id' => null,
|
||||||
|
]);
|
||||||
|
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (is_null($school) || ! School::where('id', $school->id)->exists()) {
|
if (is_null($school) || ! School::where('id', $school->id)->exists()) {
|
||||||
|
|
|
||||||
|
|
@ -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.
|
||||||
|
|
@ -0,0 +1,124 @@
|
||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Console\Commands;
|
||||||
|
|
||||||
|
use App\Models\Audition;
|
||||||
|
use App\Models\Event;
|
||||||
|
use App\Models\Room;
|
||||||
|
use App\Models\ScoringGuide;
|
||||||
|
use App\Services\CsvImportService;
|
||||||
|
use Carbon\Carbon;
|
||||||
|
use Illuminate\Console\Command;
|
||||||
|
|
||||||
|
use function auditionSetting;
|
||||||
|
use function Laravel\Prompts\select;
|
||||||
|
|
||||||
|
class importCheckAuditionsCommand extends Command
|
||||||
|
{
|
||||||
|
protected $signature = 'import:check-auditions';
|
||||||
|
|
||||||
|
protected $description = 'Check the import file for auditions that do not exist in the database';
|
||||||
|
|
||||||
|
protected $csvImporter;
|
||||||
|
|
||||||
|
public function __construct(CsvImportService $csvImporter)
|
||||||
|
{
|
||||||
|
parent::__construct();
|
||||||
|
$this->csvImporter = $csvImporter;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function handle(): void
|
||||||
|
{
|
||||||
|
$lowestPossibleGrade = 1;
|
||||||
|
$highestPossibleGrade = 12;
|
||||||
|
$events = Event::all();
|
||||||
|
$rows = $this->csvImporter->readCsv(storage_path('app/import/import.csv'));
|
||||||
|
$checkedAuditions = collect();
|
||||||
|
foreach ($rows as $row) {
|
||||||
|
if ($checkedAuditions->contains($row['Instrument'])) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
$checkedAuditions->push($row['Instrument']);
|
||||||
|
|
||||||
|
if (Audition::where('name', $row['Instrument'])->count() > 0) {
|
||||||
|
$this->info('Audition '.$row['Instrument'].' already exists');
|
||||||
|
} else {
|
||||||
|
$this->newLine();
|
||||||
|
$this->alert('Audition '.$row['Instrument'].' does not exist');
|
||||||
|
if ($events->count() === 1) {
|
||||||
|
$newEventId = $events->first()->id;
|
||||||
|
} else {
|
||||||
|
$newEventId = select(
|
||||||
|
label: 'Which event does this audition belong to?',
|
||||||
|
options: $events->pluck('name', 'id')->toArray(),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
$newEventName = $row['Instrument'];
|
||||||
|
$newEventScoreOrder = Audition::max('score_order') + 1;
|
||||||
|
$newEventEntryDeadline = Carbon::yesterday('America/Chicago')->format('Y-m-d');
|
||||||
|
$newEventEntryFee = Audition::max('entry_fee');
|
||||||
|
$newEventMinimumGrade = select(
|
||||||
|
label: 'What is the minimum grade for this audition?',
|
||||||
|
options: range($lowestPossibleGrade, $highestPossibleGrade)
|
||||||
|
);
|
||||||
|
$newEventMaximumGrade = select(
|
||||||
|
label: 'What is the maximum grade for this audition?',
|
||||||
|
options: range($newEventMinimumGrade, $highestPossibleGrade)
|
||||||
|
);
|
||||||
|
$newEventRoomId = select(
|
||||||
|
label: 'Which room does this audition belong to?',
|
||||||
|
options: Room::pluck('name', 'id')->toArray(),
|
||||||
|
);
|
||||||
|
$newEventScoringGuideId = select(
|
||||||
|
label: 'Which scoring guide should this audition use',
|
||||||
|
options: ScoringGuide::pluck('name', 'id')->toArray(),
|
||||||
|
);
|
||||||
|
if (auditionSetting('advanceTo')) {
|
||||||
|
$newEventForSeating = select(
|
||||||
|
label: 'Is this audition for seating?',
|
||||||
|
options: [
|
||||||
|
1 => 'Yes',
|
||||||
|
0 => 'No',
|
||||||
|
]
|
||||||
|
);
|
||||||
|
$newEventForAdvance = select(
|
||||||
|
label: 'Is this audition for '.auditionSetting('advanceTo').'?',
|
||||||
|
options: [
|
||||||
|
1 => 'Yes',
|
||||||
|
0 => 'No',
|
||||||
|
]
|
||||||
|
);
|
||||||
|
} else {
|
||||||
|
$newEventForSeating = 1;
|
||||||
|
$newEventForAdvance = 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
$this->info('New event ID: '.$newEventId);
|
||||||
|
$this->info('New event name: '.$newEventName);
|
||||||
|
$this->info('New event score order: '.$newEventScoreOrder);
|
||||||
|
$this->info('New event entry deadline: '.$newEventEntryDeadline);
|
||||||
|
$this->info('New event entry fee: '.$newEventEntryFee);
|
||||||
|
$this->info('New event minimum grade: '.$newEventMinimumGrade);
|
||||||
|
$this->info('New event maximum grade: '.$newEventMaximumGrade);
|
||||||
|
$this->info('New event room ID: '.$newEventRoomId);
|
||||||
|
$this->info('New event scoring guide ID: '.$newEventScoringGuideId);
|
||||||
|
$this->info('New event for seating: '.$newEventForSeating);
|
||||||
|
$this->info('New event for advance: '.$newEventForAdvance);
|
||||||
|
|
||||||
|
Audition::create([
|
||||||
|
'event_id' => $newEventId,
|
||||||
|
'name' => $newEventName,
|
||||||
|
'score_order' => $newEventScoreOrder,
|
||||||
|
'entry_deadline' => $newEventEntryDeadline,
|
||||||
|
'entry_fee' => $newEventEntryFee,
|
||||||
|
'minimum_grade' => $newEventMinimumGrade,
|
||||||
|
'maximum_grade' => $newEventMaximumGrade,
|
||||||
|
'room_id' => $newEventRoomId,
|
||||||
|
'scoring_guide_id' => $newEventScoringGuideId,
|
||||||
|
'for_seating' => $newEventForSeating,
|
||||||
|
'for_advancement' => $newEventForAdvance,
|
||||||
|
]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,44 @@
|
||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Console\Commands;
|
||||||
|
|
||||||
|
use const PHP_EOL;
|
||||||
|
|
||||||
|
use App\Models\School;
|
||||||
|
use App\Services\CsvImportService;
|
||||||
|
use Illuminate\Console\Command;
|
||||||
|
|
||||||
|
class importCheckSchoolsCommand extends Command
|
||||||
|
{
|
||||||
|
protected $signature = 'import:check-schools';
|
||||||
|
|
||||||
|
protected $description = 'Check the import file for schools that do not exist in the database';
|
||||||
|
|
||||||
|
protected $csvImporter;
|
||||||
|
|
||||||
|
public function __construct(CsvImportService $csvImporter)
|
||||||
|
{
|
||||||
|
parent::__construct();
|
||||||
|
$this->csvImporter = $csvImporter;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function handle(): void
|
||||||
|
{
|
||||||
|
$rows = $this->csvImporter->readCsv(storage_path('app/import/import.csv'));
|
||||||
|
$checkedSchools = collect();
|
||||||
|
foreach ($rows as $row) {
|
||||||
|
if ($checkedSchools->contains($row['School'])) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
$checkedSchools->push($row['School']);
|
||||||
|
if (School::where('name', $row['School'])->count() > 0) {
|
||||||
|
$this->info('School '.$row['School'].' already exists');
|
||||||
|
} else {
|
||||||
|
$this->newLine();
|
||||||
|
$this->alert('School '.$row['School'].' does not exist'.PHP_EOL.'Creating school...');
|
||||||
|
School::create(['name' => $row['School']]);
|
||||||
|
$this->info('School '.$row['School'].' created');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,67 @@
|
||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Console\Commands;
|
||||||
|
|
||||||
|
use App\Models\Entry;
|
||||||
|
use App\Models\School;
|
||||||
|
use App\Models\Student;
|
||||||
|
use App\Services\CsvImportService;
|
||||||
|
use Illuminate\Console\Command;
|
||||||
|
|
||||||
|
class importCheckStudentsCommand extends Command
|
||||||
|
{
|
||||||
|
protected $signature = 'import:check-students';
|
||||||
|
|
||||||
|
protected $description = 'Check the import file for students that do not exist in the database';
|
||||||
|
|
||||||
|
protected $csvImporter;
|
||||||
|
|
||||||
|
public function __construct(CsvImportService $csvImporter)
|
||||||
|
{
|
||||||
|
parent::__construct();
|
||||||
|
$this->csvImporter = $csvImporter;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function handle(): void
|
||||||
|
{
|
||||||
|
$purge = $this->confirm('Do you want to purge the database of existing students and entries?', false);
|
||||||
|
if ($purge) {
|
||||||
|
Entry::all()->map(function ($entry) {
|
||||||
|
$entry->delete();
|
||||||
|
});
|
||||||
|
Student::all()->map(function ($student) {
|
||||||
|
$student->delete();
|
||||||
|
});
|
||||||
|
$this->info('Database purged');
|
||||||
|
}
|
||||||
|
$schools = School::pluck('id', 'name');
|
||||||
|
$rows = $this->csvImporter->readCsv(storage_path('app/import/import.csv'));
|
||||||
|
$checkedStudents = collect();
|
||||||
|
foreach ($rows as $row) {
|
||||||
|
$uniqueData = $row['School'].$row['LastName'].$row['LastName'];
|
||||||
|
if ($checkedStudents->contains($uniqueData)) {
|
||||||
|
// continue;
|
||||||
|
}
|
||||||
|
$checkedStudents->push($uniqueData);
|
||||||
|
|
||||||
|
$currentFirstName = $row['FirstName'];
|
||||||
|
$currentLastName = $row['LastName'];
|
||||||
|
$currentSchoolName = $row['School'];
|
||||||
|
$currentSchoolId = $schools[$currentSchoolName];
|
||||||
|
|
||||||
|
if (Student::where('first_name', $currentFirstName)->where('last_name',
|
||||||
|
$currentLastName)->where('school_id', $currentSchoolId)->count() > 0) {
|
||||||
|
$this->info('Student '.$currentFirstName.' '.$currentLastName.' from '.$currentSchoolName.' already exists');
|
||||||
|
} else {
|
||||||
|
$this->alert('Student '.$currentFirstName.' '.$currentLastName.' from '.$currentSchoolName.' does not exist');
|
||||||
|
$newStudent = Student::create([
|
||||||
|
'school_id' => $currentSchoolId,
|
||||||
|
'first_name' => $currentFirstName,
|
||||||
|
'last_name' => $currentLastName,
|
||||||
|
'grade' => $row['Grade'],
|
||||||
|
]);
|
||||||
|
$this->info('Student '.$currentFirstName.' '.$currentLastName.' from '.$currentSchoolName.' created with id of: '.$newStudent->id);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,74 @@
|
||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Console\Commands;
|
||||||
|
|
||||||
|
use App\Models\Audition;
|
||||||
|
use App\Models\Entry;
|
||||||
|
use App\Models\School;
|
||||||
|
use App\Models\Student;
|
||||||
|
use App\Services\CsvImportService;
|
||||||
|
use Illuminate\Console\Command;
|
||||||
|
|
||||||
|
class importImportEntriesCommand extends Command
|
||||||
|
{
|
||||||
|
protected $signature = 'import';
|
||||||
|
|
||||||
|
protected $description = 'Import entries from the import.csv file. First check schools, then students, then auditions, then run this import command';
|
||||||
|
|
||||||
|
protected $csvImporter;
|
||||||
|
|
||||||
|
public function __construct(CsvImportService $csvImporter)
|
||||||
|
{
|
||||||
|
parent::__construct();
|
||||||
|
$this->csvImporter = $csvImporter;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function handle(): void
|
||||||
|
{
|
||||||
|
$checkAuditions = $this->confirm('Do you want to check the auditions in the import for validity first?', true);
|
||||||
|
if ($checkAuditions) {
|
||||||
|
$this->call('import:check-auditions');
|
||||||
|
}
|
||||||
|
|
||||||
|
$checkSchools = $this->confirm('Do you want to check the schools in the import for validity first?', true);
|
||||||
|
if ($checkSchools) {
|
||||||
|
$this->call('import:check-schools');
|
||||||
|
}
|
||||||
|
|
||||||
|
$checkStudents = $this->confirm('Do you want to check the students in the import for validity first?', true);
|
||||||
|
if ($checkStudents) {
|
||||||
|
$this->call('import:check-students');
|
||||||
|
}
|
||||||
|
|
||||||
|
$purge = $this->confirm('Do you want to purge the database of existing entries?', false);
|
||||||
|
if ($purge) {
|
||||||
|
Entry::all()->map(function ($entry) {
|
||||||
|
$entry->delete();
|
||||||
|
});
|
||||||
|
$this->info('Database purged');
|
||||||
|
}
|
||||||
|
$schools = School::pluck('id', 'name');
|
||||||
|
$auditions = Audition::pluck('id', 'name');
|
||||||
|
$rows = $this->csvImporter->readCsv(storage_path('app/import/import.csv'));
|
||||||
|
foreach ($rows as $row) {
|
||||||
|
$schoolId = $schools[$row['School']];
|
||||||
|
$student = Student::where('first_name', $row['FirstName'])->where('last_name',
|
||||||
|
$row['LastName'])->where('school_id', $schoolId)->first();
|
||||||
|
if (! $student) {
|
||||||
|
$this->error('Student '.$row['FirstName'].' '.$row['LastName'].' from '.$row['School'].' does not exist');
|
||||||
|
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
$auditionId = $auditions[$row['Instrument']];
|
||||||
|
try {
|
||||||
|
Entry::create([
|
||||||
|
'student_id' => $student->id,
|
||||||
|
'audition_id' => $auditionId,
|
||||||
|
]);
|
||||||
|
} catch (\Exception $e) {
|
||||||
|
$this->warn('Entry already exists for student '.$student->full_name().' in audition '.$row['Instrument']);
|
||||||
|
}
|
||||||
|
$this->info('Entry created for student '.$student->full_name().' in audition '.$row['Instrument']);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -4,12 +4,14 @@ namespace App\Http\Controllers\Admin;
|
||||||
|
|
||||||
use App\Http\Controllers\Controller;
|
use App\Http\Controllers\Controller;
|
||||||
use App\Http\Requests\AuditionStoreOrUpdateRequest;
|
use App\Http\Requests\AuditionStoreOrUpdateRequest;
|
||||||
|
use App\Http\Requests\BulkAuditionEditRequest;
|
||||||
use App\Models\Audition;
|
use App\Models\Audition;
|
||||||
use App\Models\Event;
|
use App\Models\Event;
|
||||||
use App\Models\Room;
|
use App\Models\Room;
|
||||||
use Illuminate\Http\JsonResponse;
|
use Illuminate\Http\JsonResponse;
|
||||||
use Illuminate\Http\Request;
|
use Illuminate\Http\Request;
|
||||||
|
|
||||||
|
use function compact;
|
||||||
use function redirect;
|
use function redirect;
|
||||||
use function request;
|
use function request;
|
||||||
use function response;
|
use function response;
|
||||||
|
|
@ -84,6 +86,57 @@ class AuditionController extends Controller
|
||||||
return to_route('admin.auditions.index')->with('success', 'Audition updated successfully');
|
return to_route('admin.auditions.index')->with('success', 'Audition updated successfully');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function bulkEditForm()
|
||||||
|
{
|
||||||
|
$auditions = Audition::with(['event'])->withCount('entries')->orderBy('score_order')->orderBy('created_at',
|
||||||
|
'desc')->get()->groupBy('event_id');
|
||||||
|
$events = Event::orderBy('name')->get();
|
||||||
|
|
||||||
|
return view('admin.auditions.bulk_edit_form', compact('auditions', 'events'));
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
public function bulkUpdate(BulkAuditionEditRequest $request)
|
||||||
|
{
|
||||||
|
$validated = collect($request->validated());
|
||||||
|
|
||||||
|
$auditions = Audition::whereIn('id', $validated['auditions'])->get();
|
||||||
|
foreach ($auditions as $audition) {
|
||||||
|
if ($validated->has('event_id')) {
|
||||||
|
$audition->event_id = $validated['event_id'];
|
||||||
|
}
|
||||||
|
if ($validated->has('entry_deadline')) {
|
||||||
|
$audition->entry_deadline = $validated['entry_deadline'];
|
||||||
|
}
|
||||||
|
if ($validated->has('entry_fee')) {
|
||||||
|
|
||||||
|
$audition->entry_fee = $validated['entry_fee'];
|
||||||
|
}
|
||||||
|
if ($validated->has('minimum_grade')) {
|
||||||
|
$originalMinimumGrade = $audition->minimum_grade;
|
||||||
|
$audition->minimum_grade = $validated['minimum_grade'];
|
||||||
|
}
|
||||||
|
if ($validated->has('maximum_grade')) {
|
||||||
|
$originalMaximumGrade = $audition->maximum_grade;
|
||||||
|
$audition->maximum_grade = $validated['maximum_grade'];
|
||||||
|
}
|
||||||
|
if ($validated->has('for_seating')) {
|
||||||
|
$audition->for_seating = $validated['for_seating'];
|
||||||
|
}
|
||||||
|
if ($validated->has('for_advancement')) {
|
||||||
|
$audition->for_advancement = $validated['for_advancement'];
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($audition->minimum_grade > $audition->maximum_grade) {
|
||||||
|
$audition->minimum_grade = $originalMinimumGrade;
|
||||||
|
$audition->maximum_grade = $originalMaximumGrade;
|
||||||
|
}
|
||||||
|
$audition->save();
|
||||||
|
}
|
||||||
|
|
||||||
|
return to_route('admin.auditions.index')->with('success', $auditions->count().' Auditions updated successfully');
|
||||||
|
}
|
||||||
|
|
||||||
public function reorder(Request $request)
|
public function reorder(Request $request)
|
||||||
{
|
{
|
||||||
$order = $request->order;
|
$order = $request->order;
|
||||||
|
|
|
||||||
|
|
@ -37,6 +37,20 @@ class BonusScoreDefinitionController extends Controller
|
||||||
return to_route('admin.bonus-scores.index')->with('success', 'Bonus Score Created');
|
return to_route('admin.bonus-scores.index')->with('success', 'Bonus Score Created');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function update(BonusScoreDefinition $bonusScore)
|
||||||
|
{
|
||||||
|
$validData = request()->validate([
|
||||||
|
'name' => 'required|unique:bonus_score_definitions,name,'.$bonusScore->id,
|
||||||
|
'max_score' => 'required|numeric',
|
||||||
|
'weight' => 'required|numeric',
|
||||||
|
]);
|
||||||
|
|
||||||
|
$bonusScore->update($validData);
|
||||||
|
|
||||||
|
return to_route('admin.bonus-scores.index')->with('success', 'Bonus Score Updated');
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
public function destroy(BonusScoreDefinition $bonusScore)
|
public function destroy(BonusScoreDefinition $bonusScore)
|
||||||
{
|
{
|
||||||
if ($bonusScore->auditions()->count() > 0) {
|
if ($bonusScore->auditions()->count() > 0) {
|
||||||
|
|
|
||||||
|
|
@ -13,8 +13,12 @@ class EventController extends Controller
|
||||||
public function index()
|
public function index()
|
||||||
{
|
{
|
||||||
$events = Event::all();
|
$events = Event::all();
|
||||||
|
$renameModalXdata = '';
|
||||||
|
foreach ($events as $event) {
|
||||||
|
$renameModalXdata .= 'showRenameModal_'.$event->id.': false, ';
|
||||||
|
}
|
||||||
|
|
||||||
return view('admin.event.index', compact('events'));
|
return view('admin.event.index', compact('events', 'renameModalXdata'));
|
||||||
}
|
}
|
||||||
|
|
||||||
public function store(Request $request)
|
public function store(Request $request)
|
||||||
|
|
@ -30,6 +34,21 @@ class EventController extends Controller
|
||||||
return redirect()->route('admin.events.index')->with('success', 'Event created successfully');
|
return redirect()->route('admin.events.index')->with('success', 'Event created successfully');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function update(Request $request, Event $event)
|
||||||
|
{
|
||||||
|
if ($request->name !== $event->name) {
|
||||||
|
$validated = request()->validate([
|
||||||
|
'name' => ['required', 'unique:events,name'],
|
||||||
|
]);
|
||||||
|
|
||||||
|
$event->update([
|
||||||
|
'name' => $validated['name'],
|
||||||
|
]);
|
||||||
|
}
|
||||||
|
|
||||||
|
return redirect()->route('admin.events.index')->with('success', 'Event renamed successfully');
|
||||||
|
}
|
||||||
|
|
||||||
public function destroy(Request $request, Event $event)
|
public function destroy(Request $request, Event $event)
|
||||||
{
|
{
|
||||||
if ($event->auditions()->count() > 0) {
|
if ($event->auditions()->count() > 0) {
|
||||||
|
|
|
||||||
|
|
@ -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'));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -86,7 +86,6 @@ class ScoringGuideController extends Controller
|
||||||
$validateData['for_advance'] = 0;
|
$validateData['for_advance'] = 0;
|
||||||
$validateData['for_seating'] = 1;
|
$validateData['for_seating'] = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
SubscoreDefinition::create([
|
SubscoreDefinition::create([
|
||||||
'scoring_guide_id' => $guide->id,
|
'scoring_guide_id' => $guide->id,
|
||||||
'name' => $validateData['name'],
|
'name' => $validateData['name'],
|
||||||
|
|
@ -111,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'));
|
||||||
|
|
@ -64,6 +68,7 @@ class UserController extends Controller
|
||||||
$profileUpdater->update($user, $profileData);
|
$profileUpdater->update($user, $profileData);
|
||||||
|
|
||||||
// Deal with school assignment
|
// Deal with school assignment
|
||||||
|
dump($request->get('school_id'));
|
||||||
if ($user->school_id != $request->get('school_id')) {
|
if ($user->school_id != $request->get('school_id')) {
|
||||||
$schoolAssigner($user, $request->get('school_id'));
|
$schoolAssigner($user, $request->get('school_id'));
|
||||||
}
|
}
|
||||||
|
|
@ -121,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);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -46,7 +46,12 @@ class DoublerRequestController extends Controller
|
||||||
public function makeRequest(DoublerRequestsStoreRequest $request)
|
public function makeRequest(DoublerRequestsStoreRequest $request)
|
||||||
{
|
{
|
||||||
foreach ($request->getDoublerRequests() as $thisRequest) {
|
foreach ($request->getDoublerRequests() as $thisRequest) {
|
||||||
|
if (! $thisRequest['request']) {
|
||||||
|
DoublerRequest::where('event_id', $thisRequest['event_id'])
|
||||||
|
->where('student_id', $thisRequest['student_id'])->delete();
|
||||||
|
|
||||||
|
continue;
|
||||||
|
}
|
||||||
DoublerRequest::upsert([
|
DoublerRequest::upsert([
|
||||||
'event_id' => $thisRequest['event_id'],
|
'event_id' => $thisRequest['event_id'],
|
||||||
'student_id' => $thisRequest['student_id'],
|
'student_id' => $thisRequest['student_id'],
|
||||||
|
|
|
||||||
|
|
@ -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');
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,74 @@
|
||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Http\Requests;
|
||||||
|
|
||||||
|
use Illuminate\Foundation\Http\FormRequest;
|
||||||
|
|
||||||
|
class BulkAuditionEditRequest extends FormRequest
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* Determine if the user is authorized to make this request.
|
||||||
|
*/
|
||||||
|
public function authorize(): bool
|
||||||
|
{
|
||||||
|
return true;
|
||||||
|
// TODO write authorize
|
||||||
|
}
|
||||||
|
|
||||||
|
protected function prepareForValidation(): void
|
||||||
|
{
|
||||||
|
if (! $this->has('editEvent')) {
|
||||||
|
$this->request->remove('event_id');
|
||||||
|
}
|
||||||
|
if (! $this->has('editDeadline')) {
|
||||||
|
$this->request->remove('entry_deadline');
|
||||||
|
}
|
||||||
|
if (! $this->has('editFee')) {
|
||||||
|
$this->request->remove('entry_fee');
|
||||||
|
}
|
||||||
|
if (! $this->has('editMinGrade')) {
|
||||||
|
$this->request->remove('minimum_grade');
|
||||||
|
}
|
||||||
|
if (! $this->has('editMaxGrade')) {
|
||||||
|
$this->request->remove('maximum_grade');
|
||||||
|
}
|
||||||
|
if (! $this->has('editScope')) {
|
||||||
|
$this->request->remove('for_seating');
|
||||||
|
$this->request->remove('for_advancement');
|
||||||
|
}
|
||||||
|
if ($this->has('editScope')) {
|
||||||
|
if ($this->has('for_seating')) {
|
||||||
|
$this->merge(['for_seating' => true]);
|
||||||
|
} else {
|
||||||
|
$this->merge(['for_seating' => false]);
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($this->has('for_advancement')) {
|
||||||
|
$this->merge(['for_advancement' => true]);
|
||||||
|
} else {
|
||||||
|
$this->merge(['for_advancement' => false]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get the validation rules that apply to the request.
|
||||||
|
*
|
||||||
|
* @return array<string, \Illuminate\Contracts\Validation\ValidationRule|array<mixed>|string>
|
||||||
|
*/
|
||||||
|
public function rules(): array
|
||||||
|
{
|
||||||
|
return [
|
||||||
|
'auditions' => 'required|array|min:1',
|
||||||
|
'auditions.*' => 'required|exists:auditions,id',
|
||||||
|
'event_id' => 'sometimes|exists:events,id',
|
||||||
|
'entry_deadline' => 'sometimes|date',
|
||||||
|
'entry_fee' => 'sometimes|numeric',
|
||||||
|
'minimum_grade' => 'sometimes|integer|min:1',
|
||||||
|
'maximum_grade' => 'sometimes|integer|min:1',
|
||||||
|
'for_seating' => 'sometimes|boolean',
|
||||||
|
'for_advancement' => 'sometimes|boolean',
|
||||||
|
'editScope' => 'sometimes|boolean',
|
||||||
|
];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -16,7 +16,7 @@ class DoublerRequestsStoreRequest extends FormRequest
|
||||||
|
|
||||||
// Validate student IDs (second keys) and their values
|
// Validate student IDs (second keys) and their values
|
||||||
'doubler_requests.*.*' => [
|
'doubler_requests.*.*' => [
|
||||||
'required',
|
'nullable',
|
||||||
'string',
|
'string',
|
||||||
'max:50',
|
'max:50',
|
||||||
// Custom validation rule to check if the student ID exists in DB
|
// Custom validation rule to check if the student ID exists in DB
|
||||||
|
|
@ -53,7 +53,6 @@ class DoublerRequestsStoreRequest extends FormRequest
|
||||||
public function getDoublerRequests(): array
|
public function getDoublerRequests(): array
|
||||||
{
|
{
|
||||||
$validated = $this->validated()['doubler_requests'] ?? [];
|
$validated = $this->validated()['doubler_requests'] ?? [];
|
||||||
|
|
||||||
$result = [];
|
$result = [];
|
||||||
|
|
||||||
foreach ($validated as $eventId => $students) {
|
foreach ($validated as $eventId => $students) {
|
||||||
|
|
|
||||||
|
|
@ -3,6 +3,8 @@
|
||||||
namespace App\Http\Requests;
|
namespace App\Http\Requests;
|
||||||
|
|
||||||
use App\Models\Audition;
|
use App\Models\Audition;
|
||||||
|
use App\Models\Entry;
|
||||||
|
use App\Models\Student;
|
||||||
use Auth;
|
use Auth;
|
||||||
use Carbon\Carbon;
|
use Carbon\Carbon;
|
||||||
use Illuminate\Foundation\Http\FormRequest;
|
use Illuminate\Foundation\Http\FormRequest;
|
||||||
|
|
@ -44,6 +46,7 @@ class EntryStoreRequest extends FormRequest
|
||||||
$validator->after(function ($validator) {
|
$validator->after(function ($validator) {
|
||||||
$auditionId = $this->input('audition_id');
|
$auditionId = $this->input('audition_id');
|
||||||
$audition = Audition::find($auditionId);
|
$audition = Audition::find($auditionId);
|
||||||
|
$student = Student::find($this->input('student_id'));
|
||||||
|
|
||||||
if (! $audition) {
|
if (! $audition) {
|
||||||
$validator->errors()->add('audition_id', 'The selected audition does not exist.');
|
$validator->errors()->add('audition_id', 'The selected audition does not exist.');
|
||||||
|
|
@ -51,6 +54,11 @@ class EntryStoreRequest extends FormRequest
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (Entry::where('student_id', $this->input('student_id'))->where('audition_id', $auditionId)->exists()) {
|
||||||
|
$validator->errors()->add('student_id',
|
||||||
|
$student->full_name().' is already entered in the '.$audition->name.' audition.');
|
||||||
|
}
|
||||||
|
|
||||||
if (! Auth::user()->is_admin) { //Admins don't care about deadlines
|
if (! Auth::user()->is_admin) { //Admins don't care about deadlines
|
||||||
$currentDate = Carbon::now('America/Chicago')->format('Y-m-d');
|
$currentDate = Carbon::now('America/Chicago')->format('Y-m-d');
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -21,6 +21,15 @@ class SubscoreDefinitionRequest extends FormRequest
|
||||||
*
|
*
|
||||||
* @return array<string, \Illuminate\Contracts\Validation\ValidationRule|array<mixed>|string>
|
* @return array<string, \Illuminate\Contracts\Validation\ValidationRule|array<mixed>|string>
|
||||||
*/
|
*/
|
||||||
|
protected function prepareForValidation()
|
||||||
|
{
|
||||||
|
// Handle checkboxes
|
||||||
|
$this->merge([
|
||||||
|
'for_seating' => $this->has('for_seating') ? true : false,
|
||||||
|
'for_advance' => $this->has('for_advance') ? true : false,
|
||||||
|
]);
|
||||||
|
}
|
||||||
|
|
||||||
public function rules(): array
|
public function rules(): array
|
||||||
{
|
{
|
||||||
$guideId = $this->route('guide')->id; // get the guide ID from route model binding
|
$guideId = $this->route('guide')->id; // get the guide ID from route model binding
|
||||||
|
|
@ -36,19 +45,13 @@ class SubscoreDefinitionRequest extends FormRequest
|
||||||
],
|
],
|
||||||
'max_score' => ['required', 'integer'],
|
'max_score' => ['required', 'integer'],
|
||||||
'weight' => ['required', 'integer'],
|
'weight' => ['required', 'integer'],
|
||||||
'for_seating' => ['sometimes', 'nullable'],
|
'for_seating' => ['boolean'],
|
||||||
'for_advance' => ['sometimes', 'nullable'],
|
'for_advance' => ['boolean'],
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
protected function passedValidation()
|
protected function passedValidation()
|
||||||
{
|
{
|
||||||
// Normalize the boolean inputs
|
|
||||||
$this->merge([
|
|
||||||
'for_seating' => $this->has('for_seating') ? (bool) $this->input('for_seating') : false,
|
|
||||||
'for_advance' => $this->has('for_advance') ? (bool) $this->input('for_advance') : false,
|
|
||||||
]);
|
|
||||||
|
|
||||||
// Apply your custom logic
|
// Apply your custom logic
|
||||||
if (! auditionSetting('advanceTo')) {
|
if (! auditionSetting('advanceTo')) {
|
||||||
$this->merge(['for_seating' => true]);
|
$this->merge(['for_seating' => true]);
|
||||||
|
|
|
||||||
|
|
@ -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;
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,42 @@
|
||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Services;
|
||||||
|
|
||||||
|
class CsvImportService
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* Read a CSV file and return its contents as an array
|
||||||
|
*
|
||||||
|
* @param string $filePath Full path to the CSV file
|
||||||
|
* @param bool $trimHeaders Whether to trim whitespace from header names
|
||||||
|
* @return array Array of rows with header keys
|
||||||
|
*/
|
||||||
|
public function readCsv(string $filePath, bool $trimHeaders = true): array
|
||||||
|
{
|
||||||
|
if (! file_exists($filePath)) {
|
||||||
|
throw new \RuntimeException("File not found: {$filePath}");
|
||||||
|
}
|
||||||
|
|
||||||
|
$handle = fopen($filePath, 'r');
|
||||||
|
if ($handle === false) {
|
||||||
|
throw new \RuntimeException("Unable to open file: {$filePath}");
|
||||||
|
}
|
||||||
|
|
||||||
|
$header = null;
|
||||||
|
$rows = [];
|
||||||
|
|
||||||
|
while (($line = fgetcsv($handle, 0, ',')) !== false) {
|
||||||
|
if (! $header) {
|
||||||
|
$header = $trimHeaders ? array_map('trim', $line) : $line;
|
||||||
|
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
$row = array_combine($header, $line);
|
||||||
|
$rows[] = $row;
|
||||||
|
}
|
||||||
|
|
||||||
|
fclose($handle);
|
||||||
|
|
||||||
|
return $rows;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -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,114 @@
|
||||||
|
<x-layout.app x-data="{ selectAuditionsForm: true, newValuesForm: false }">
|
||||||
|
<x-slot:page_title>Bulk Edit Auditions</x-slot:page_title>
|
||||||
|
|
||||||
|
@if($errors->any())
|
||||||
|
<div class="mt-3">
|
||||||
|
@foreach($errors->all() as $error)
|
||||||
|
<div class="ml-3">
|
||||||
|
<span
|
||||||
|
class="inline-flex items-center rounded-md bg-red-50 px-2 py-1 text-xs font-medium text-red-700 inset-ring inset-ring-red-600/10 dark:bg-red-400/10 dark:text-red-400 dark:inset-ring-red-400/20">{{$error}}</span>
|
||||||
|
</div>
|
||||||
|
@endforeach
|
||||||
|
</div>
|
||||||
|
@endif
|
||||||
|
|
||||||
|
<x-form.form method="POST" action="{{ route('admin.auditions.bulkEdit') }}">
|
||||||
|
<div x-show="selectAuditionsForm" x-cloak>
|
||||||
|
@foreach($events as $event)
|
||||||
|
<x-card.card class="mb-3">
|
||||||
|
<x-card.heading>
|
||||||
|
{{ $event->name }}
|
||||||
|
<x-slot:right_side>
|
||||||
|
<x-form.button type="button" @click="checkAllCheckboxesByClass('event-{{$event->id}}')">Select all {{ $event->name }}</x-form.button>
|
||||||
|
</x-slot:right_side>
|
||||||
|
</x-card.heading>
|
||||||
|
<div class="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-4 p-3">
|
||||||
|
@foreach($auditions[$event->id] as $audition)
|
||||||
|
<div>
|
||||||
|
<x-form.checkbox name="auditions[{{ $audition->id }}]" label="{{$audition->name}}" value="{{ $audition->id }}"
|
||||||
|
class="event-{{$event->id}}"/>
|
||||||
|
</div>
|
||||||
|
@endforeach
|
||||||
|
</div>
|
||||||
|
</x-card.card>
|
||||||
|
@endforeach
|
||||||
|
<x-form.button type="button" @click="selectAuditionsForm = false; newValuesForm = true">Edit Selected
|
||||||
|
Auditions
|
||||||
|
</x-form.button>
|
||||||
|
</div>
|
||||||
|
<div x-show="newValuesForm" x-cloak>
|
||||||
|
<x-card.card class="max-w-xl mx-auto" x-data="{ editName: false, editEvent: false, editDeadline: false, editFee: false, editMinGrade: false, editMaxGrade: false, editScope: false }">
|
||||||
|
<x-card.heading>Select Values to Edit</x-card.heading>
|
||||||
|
|
||||||
|
<div class="grid grid-cols-2 gap-4 p-3 border-b-2">
|
||||||
|
<div>
|
||||||
|
<x-form.checkbox name="editEvent" label="Edit Audition Event" x-model="editEvent"/>
|
||||||
|
</div>
|
||||||
|
<x-form.select name="event_id" x-show="editEvent" x-cloak>
|
||||||
|
<x-slot:label></x-slot:label>
|
||||||
|
@foreach($events as $event)
|
||||||
|
<option value="{{ $event->id }}">{{ $event->name }}</option>
|
||||||
|
@endforeach
|
||||||
|
</x-form.select>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="grid grid-cols-2 gap-4 p-3 border-b-2">
|
||||||
|
<div>
|
||||||
|
<x-form.checkbox name="editDeadline" label="Edit Entry Deadline" x-model="editDeadline"/>
|
||||||
|
</div>
|
||||||
|
<x-form.field name="entry_deadline" type="date" x-cloak x-show="editDeadline"/>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="grid grid-cols-2 gap-4 p-3 border-b-2">
|
||||||
|
<div>
|
||||||
|
<x-form.checkbox name="editFee" label="Edit Entry Fee" x-model="editFee"/>
|
||||||
|
</div>
|
||||||
|
<x-form.field name="entry_fee" type="number" placeholder="Enter New Entry Fee" x-cloak x-show="editFee" />
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="grid grid-cols-2 gap-4 p-3 border-b-2">
|
||||||
|
<div>
|
||||||
|
<x-form.checkbox name="editMinGrade" label="Edit Minimum Grade" x-model="editMinGrade"/>
|
||||||
|
</div>
|
||||||
|
<x-form.field name="minimum_grade" type="number" placeholder="Enter New Minimum Grade" x-cloak x-show="editMinGrade" />
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="grid grid-cols-2 gap-4 p-3 border-b-2">
|
||||||
|
<div>
|
||||||
|
<x-form.checkbox name="editMaxGrade" label="Edit Maximum Grade" x-model="editMaxGrade"/>
|
||||||
|
</div>
|
||||||
|
<x-form.field name="maximum_grade" type="number" placeholder="Enter New Maximum Grade " x-cloak x-show="editMaxGrade" />
|
||||||
|
</div>
|
||||||
|
|
||||||
|
@if(auditionSetting('advanceTo'))
|
||||||
|
<div class="grid grid-cols-2 gap-4 p-3 border-b-2">
|
||||||
|
<div>
|
||||||
|
<x-form.checkbox name="editScope" label="Edit Audition Scope" x-model="editScope"/>
|
||||||
|
</div>
|
||||||
|
<div class="grid grid-cols-2" x-show="editScope" x-cloak>
|
||||||
|
<div class="align-top">
|
||||||
|
<x-form.checkbox name="for_seating" label="For Seats" description="Students will be seated in this audition" checked />
|
||||||
|
</div>
|
||||||
|
<div class="align-top">
|
||||||
|
<x-form.checkbox name="for_advancement" label="For {{ auditionSetting('advanceTo') }}" description="Students compete for advancement" checked/>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
@endif
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
</x-card.card>
|
||||||
|
</div>
|
||||||
|
<x-form.button x-cloak x-show="newValuesForm" class="mt-3 max-w-xl mx-auto">Submit Changes</x-form.button>
|
||||||
|
</x-form.form>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
function checkAllCheckboxesByClass(className) {
|
||||||
|
const checkboxes = document.querySelectorAll(`input[type="checkbox"].${className}`);
|
||||||
|
checkboxes.forEach(checkbox => {
|
||||||
|
checkbox.checked = true;
|
||||||
|
});
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
</x-layout.app>
|
||||||
|
|
@ -2,7 +2,7 @@
|
||||||
<x-slot:page_title>Audition Administration</x-slot:page_title>
|
<x-slot:page_title>Audition Administration</x-slot:page_title>
|
||||||
<x-card.card>
|
<x-card.card>
|
||||||
<x-table.table with_title_area sortable="false" id="auditions-table">
|
<x-table.table with_title_area sortable="false" id="auditions-table">
|
||||||
<x-slot:title class="ml-3">Auditions</x-slot:title>
|
<x-slot:title class="ml-3">Auditions <span class="font-normal text-sm"><a href="{{ route('admin.auditions.bulkEditForm') }}">[Bulk Edit]</a></span></x-slot:title>
|
||||||
<x-slot:subtitle class="ml-3">Drag to reorder. Double click to edit.</x-slot:subtitle>
|
<x-slot:subtitle class="ml-3">Drag to reorder. Double click to edit.</x-slot:subtitle>
|
||||||
<x-slot:title_block_right class="mr-3">
|
<x-slot:title_block_right class="mr-3">
|
||||||
<x-form.button href="{{ route('admin.auditions.create') }}">New Audition</x-form.button>
|
<x-form.button href="{{ route('admin.auditions.create') }}">New Audition</x-form.button>
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,16 @@
|
||||||
|
<x-modal-body show-var="showEditBonusScoreModal{{ $bonusScoreModalId }}">
|
||||||
|
<x-slot:title>
|
||||||
|
Edit Bonus Score
|
||||||
|
</x-slot:title>
|
||||||
|
<x-form.form id="update-bonus-score-form" action="{{ route('admin.bonus-scores.update', $bonusScore) }}" method="PATCH">
|
||||||
|
<x-form.body-grid columns="12">
|
||||||
|
<x-form.field name="name" label_text="Name" colspan="8" value="{{ $bonusScore->name }}" />
|
||||||
|
<x-form.field name="max_score" type="number" label_text="Max Points" colspan="2" value="{{ $bonusScore->max_score }}" />
|
||||||
|
<x-form.field name="weight" label_text="Weight" colspan="2" value="{{ $bonusScore->weight }}" />
|
||||||
|
<div class="col-start-9 col-span-4 row-start-2">
|
||||||
|
<x-form.button >Update Bonus Score</x-form.button>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</x-form.body-grid>
|
||||||
|
</x-form.form>
|
||||||
|
</x-modal-body>
|
||||||
|
|
@ -8,10 +8,11 @@
|
||||||
@endif
|
@endif
|
||||||
|
|
||||||
@foreach($bonusScores as $bonusScore)
|
@foreach($bonusScores as $bonusScore)
|
||||||
<x-card.card class="mx-auto max-w-xl mb-5">
|
<x-card.card class="mx-auto max-w-xl mb-5" x-data="{ showEditBonusScoreModal{{$bonusScore->id}}: false }">
|
||||||
<x-card.heading>
|
<x-card.heading>
|
||||||
|
@php($bonusScoreModalId = $bonusScore->id)
|
||||||
{{ $bonusScore->name }}
|
@include('admin.bonus-scores.index-edit-bonus-score-modal')
|
||||||
|
{{ $bonusScore->name }} <button class="text-sm font-normal" x-on:click="showEditBonusScoreModal{{$bonusScore->id}}=true">[Edit]</button>
|
||||||
<x-slot:subheading>
|
<x-slot:subheading>
|
||||||
Max Points: {{ $bonusScore->max_score }} | Weight: {{ $bonusScore->weight }}
|
Max Points: {{ $bonusScore->max_score }} | Weight: {{ $bonusScore->weight }}
|
||||||
</x-slot:subheading>
|
</x-slot:subheading>
|
||||||
|
|
|
||||||
|
|
@ -2,9 +2,20 @@
|
||||||
<x-layout.app>
|
<x-layout.app>
|
||||||
<x-card.card class="mx-auto max-w-2xl">
|
<x-card.card class="mx-auto max-w-2xl">
|
||||||
<x-card.heading>Create Entry</x-card.heading>
|
<x-card.heading>Create Entry</x-card.heading>
|
||||||
<x-form.form id='createEntryForm' method="POST" action="/admin/entries">
|
@if ($errors->any())
|
||||||
|
<div class="mt-3">
|
||||||
|
@foreach($errors->all() as $error)
|
||||||
|
<div class="ml-3">
|
||||||
|
<span
|
||||||
|
class="inline-flex items-center rounded-md bg-red-50 px-2 py-1 text-xs font-medium text-red-700 inset-ring inset-ring-red-600/10 dark:bg-red-400/10 dark:text-red-400 dark:inset-ring-red-400/20">{{$error}}</span>
|
||||||
|
</div>
|
||||||
|
@endforeach
|
||||||
|
</div>
|
||||||
|
@endif
|
||||||
|
<x-form.form id='createEntryForm' method="POST" action="/admin/entries" class="mt-3">
|
||||||
<x-form.body-grid columns="3" x-data="studentAuditionFilter()">
|
<x-form.body-grid columns="3" x-data="studentAuditionFilter()">
|
||||||
|
|
||||||
|
|
||||||
<x-form.select name="student_id" colspan="2" x-model="selectedStudentId" @change="filterAuditions">
|
<x-form.select name="student_id" colspan="2" x-model="selectedStudentId" @change="filterAuditions">
|
||||||
<x-slot:label>Student</x-slot:label>
|
<x-slot:label>Student</x-slot:label>
|
||||||
<option value="" disabled selected>Select a student</option>
|
<option value="" disabled selected>Select a student</option>
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,14 @@
|
||||||
|
<x-modal-body show-var="{{$currentRenameModalName}}">
|
||||||
|
<x-slot:title>
|
||||||
|
Rename Event
|
||||||
|
</x-slot:title>
|
||||||
|
<x-form.form id="update-bonus-score-form" action="{{ route('admin.events.update', $event) }}" method="PATCH">
|
||||||
|
<x-form.body-grid columns="12">
|
||||||
|
<x-form.field name="name" label_text="Name" colspan="8" value="{{ $event->name }}" />
|
||||||
|
<div class="col-start-9 col-span-4 row-start-2">
|
||||||
|
<x-form.button >Update Event</x-form.button>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</x-form.body-grid>
|
||||||
|
</x-form.form>
|
||||||
|
</x-modal-body>
|
||||||
|
|
@ -8,15 +8,28 @@
|
||||||
</x-slot:right_side>
|
</x-slot:right_side>
|
||||||
</x-card.heading>
|
</x-card.heading>
|
||||||
|
|
||||||
|
<div x-data="{ {{ $renameModalXdata}} }">
|
||||||
|
@foreach($events as $event)
|
||||||
|
@php($currentRenameModalName = "showRenameModal_".$event->id)
|
||||||
|
@include('admin.event.index-rename-event-modal')
|
||||||
|
@endforeach
|
||||||
|
|
||||||
<x-table.table>
|
<x-table.table>
|
||||||
<x-table.body>
|
<x-table.body>
|
||||||
@foreach($events as $event)
|
@foreach($events as $event)
|
||||||
|
|
||||||
<tr>
|
<tr>
|
||||||
<x-table.td>{{ $event->name }}, {{ $event->auditions()->count() }} Auditions</x-table.td>
|
|
||||||
|
<x-table.td>{{ $event->name }}
|
||||||
|
<button class="text-xs" @click="showRenameModal_{{$event->id}} = true">[rename]</button>
|
||||||
|
<br/>
|
||||||
|
<span class="text-xs">{{ $event->auditions()->count() }} Auditions</span>
|
||||||
|
</x-table.td>
|
||||||
<x-table.td class="text-right">
|
<x-table.td class="text-right">
|
||||||
|
|
||||||
@if($event->auditions()->count() == 0)
|
@if($event->auditions()->count() == 0)
|
||||||
<form method="POST" action="{{ route('admin.events.destroy', ['event' => $event->id]) }}">
|
<form method="POST"
|
||||||
|
action="{{ route('admin.events.destroy', ['event' => $event->id]) }}">
|
||||||
@csrf
|
@csrf
|
||||||
@method('DELETE')
|
@method('DELETE')
|
||||||
<button type="submit" class="text-red-600 text-right">Delete Event</button>
|
<button type="submit" class="text-red-600 text-right">Delete Event</button>
|
||||||
|
|
@ -39,5 +52,6 @@
|
||||||
</tr>
|
</tr>
|
||||||
</tfoot>
|
</tfoot>
|
||||||
</x-table.table>
|
</x-table.table>
|
||||||
|
</div>
|
||||||
</x-card.card>
|
</x-card.card>
|
||||||
</x-layout.app>
|
</x-layout.app>
|
||||||
|
|
|
||||||
|
|
@ -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" />
|
||||||
|
|
|
||||||
|
|
@ -2,7 +2,9 @@
|
||||||
'label' => false,
|
'label' => false,
|
||||||
'description' => '',
|
'description' => '',
|
||||||
'checked' => false,
|
'checked' => false,
|
||||||
'id' => false])
|
'id' => false,
|
||||||
|
'value' => 1,
|
||||||
|
])
|
||||||
@php
|
@php
|
||||||
if(! $id):
|
if(! $id):
|
||||||
$id = $name;
|
$id = $name;
|
||||||
|
|
@ -14,7 +16,7 @@
|
||||||
aria-describedby="comments-description"
|
aria-describedby="comments-description"
|
||||||
name="{{ $name }}"
|
name="{{ $name }}"
|
||||||
type="checkbox"
|
type="checkbox"
|
||||||
value="1"
|
value="{{ $value }}"
|
||||||
@if($checked) checked @endif
|
@if($checked) checked @endif
|
||||||
{{ $attributes->merge(['class' => "h-4 w-4 rounded border-gray-300 text-indigo-600 focus:ring-indigo-600"]) }}>
|
{{ $attributes->merge(['class' => "h-4 w-4 rounded border-gray-300 text-indigo-600 focus:ring-indigo-600"]) }}>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
||||||
|
|
@ -17,7 +17,7 @@
|
||||||
<script src="{{ asset('js/sort_table_by_column.js') }}"></script>
|
<script src="{{ asset('js/sort_table_by_column.js') }}"></script>
|
||||||
<script src="https://cdn.jsdelivr.net/npm/sortablejs@1.14.0/Sortable.min.js"></script>
|
<script src="https://cdn.jsdelivr.net/npm/sortablejs@1.14.0/Sortable.min.js"></script>
|
||||||
</head>
|
</head>
|
||||||
<body class="h-full">
|
<body {{ $attributes->merge(['class' => 'h-full']) }}>
|
||||||
<div class="min-h-full">
|
<div class="min-h-full">
|
||||||
{{-- @if(request()->is('*admin*'))--}}
|
{{-- @if(request()->is('*admin*'))--}}
|
||||||
{{-- <x-layout.navbar.navbar-admin />--}}
|
{{-- <x-layout.navbar.navbar-admin />--}}
|
||||||
|
|
|
||||||
|
|
@ -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>--}}
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,14 @@
|
||||||
<x-layout.app>
|
<x-layout.app>
|
||||||
<x-slot:page_title>Doubler Requests</x-slot:page_title>
|
<x-slot:page_title>Doubler Requests</x-slot:page_title>
|
||||||
|
@foreach($errors->all() as $error)
|
||||||
|
<span
|
||||||
|
class="inline-flex items-center rounded-md bg-red-50 px-2 py-1 text-xs font-medium text-red-700 inset-ring inset-ring-red-600/10 dark:bg-red-400/10 dark:text-red-400 dark:inset-ring-red-400/20">
|
||||||
|
{{ $error }}
|
||||||
|
</span>
|
||||||
|
|
||||||
|
@endforeach
|
||||||
<x-form.form method="POST" action="{{route('doubler_request.make_request')}}">
|
<x-form.form method="POST" action="{{route('doubler_request.make_request')}}">
|
||||||
|
|
||||||
@foreach($events as $event)
|
@foreach($events as $event)
|
||||||
<x-card.card class="mb-5">
|
<x-card.card class="mb-5">
|
||||||
<x-card.heading>{{ $event->name }}</x-card.heading>
|
<x-card.heading>{{ $event->name }}</x-card.heading>
|
||||||
|
|
@ -24,7 +32,7 @@
|
||||||
</x-table.td>
|
</x-table.td>
|
||||||
<x-table.td>
|
<x-table.td>
|
||||||
<x-form.field
|
<x-form.field
|
||||||
value="{{ $existingRequests[$event->id][$student->id] ?? '' }}"
|
value="{{ $existingRequests[$event->id][$student->id]['request'] ?? '' }}"
|
||||||
name="doubler_requests[{{$event->id}}][{{$student->id}}]"/>
|
name="doubler_requests[{{$event->id}}][{{$student->id}}]"/>
|
||||||
</x-table.td>
|
</x-table.td>
|
||||||
</tr>
|
</tr>
|
||||||
|
|
|
||||||
|
|
@ -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',
|
||||||
|
|
@ -66,6 +67,7 @@ Route::middleware(['auth', 'verified', CheckIfAdmin::class])->prefix('admin/')->
|
||||||
Route::get('/judges', 'judges')->name('admin.bonus-scores.judges');
|
Route::get('/judges', 'judges')->name('admin.bonus-scores.judges');
|
||||||
Route::delete('{bonusScore}/judges/', 'removeJudge')->name('admin.bonus-scores.judges.remove');
|
Route::delete('{bonusScore}/judges/', 'removeJudge')->name('admin.bonus-scores.judges.remove');
|
||||||
Route::post('{bonusScore}/judges/', 'assignJudge')->name('admin.bonus-scores.judges.assign');
|
Route::post('{bonusScore}/judges/', 'assignJudge')->name('admin.bonus-scores.judges.assign');
|
||||||
|
Route::patch('/{bonusScore}', 'update')->name('admin.bonus-scores.update');
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
@ -87,6 +89,7 @@ Route::middleware(['auth', 'verified', CheckIfAdmin::class])->prefix('admin/')->
|
||||||
Route::get('/', 'index')->name('admin.events.index');
|
Route::get('/', 'index')->name('admin.events.index');
|
||||||
Route::post('/', 'store')->name('admin.events.store');
|
Route::post('/', 'store')->name('admin.events.store');
|
||||||
Route::delete('/{event}', 'destroy')->name('admin.events.destroy');
|
Route::delete('/{event}', 'destroy')->name('admin.events.destroy');
|
||||||
|
Route::patch('/{event}', 'update')->name('admin.events.update');
|
||||||
});
|
});
|
||||||
|
|
||||||
// Admin Rooms Routes
|
// Admin Rooms Routes
|
||||||
|
|
@ -131,6 +134,8 @@ Route::middleware(['auth', 'verified', CheckIfAdmin::class])->prefix('admin/')->
|
||||||
Route::patch('/{audition}', 'update')->name('admin.auditions.update');
|
Route::patch('/{audition}', 'update')->name('admin.auditions.update');
|
||||||
Route::post('/reorder', 'reorder')->name('admin.auditions.reorder');
|
Route::post('/reorder', 'reorder')->name('admin.auditions.reorder');
|
||||||
Route::delete('/{audition}', 'destroy')->name('admin.auditions.destroy');
|
Route::delete('/{audition}', 'destroy')->name('admin.auditions.destroy');
|
||||||
|
Route::get('/bulk-edit', 'bulkEditForm')->name('admin.auditions.bulkEditForm');
|
||||||
|
Route::post('/bulk-edit', 'bulkUpdate')->name('admin.auditions.bulkEdit');
|
||||||
});
|
});
|
||||||
|
|
||||||
// Admin Audition Draw Routes
|
// Admin Audition Draw Routes
|
||||||
|
|
@ -164,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');
|
||||||
|
|
@ -187,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
|
||||||
|
|
|
||||||
|
|
@ -64,5 +64,5 @@ Route::middleware([
|
||||||
'auth', 'verified',
|
'auth', 'verified',
|
||||||
])->controller(DoublerRequestController::class)->prefix('doubler_request')->group(function () {
|
])->controller(DoublerRequestController::class)->prefix('doubler_request')->group(function () {
|
||||||
Route::get('/', 'index')->name('doubler_request.index');
|
Route::get('/', 'index')->name('doubler_request.index');
|
||||||
Route::post('/', 'makeRequest')->name('doubler_request.make_request');
|
Route::post('/makeRequest', 'makeRequest')->name('doubler_request.make_request');
|
||||||
});
|
});
|
||||||
|
|
|
||||||
|
|
@ -79,6 +79,26 @@ describe('EventController::Store', function () {
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
describe('EventController::Update', function () {
|
||||||
|
beforeEach(function () {
|
||||||
|
$this->event = Event::factory()->create();
|
||||||
|
});
|
||||||
|
it('denies access to a non-admin user', function () {
|
||||||
|
$this->patch(route('admin.events.update', $this->event), [])->assertRedirect(route('home'));
|
||||||
|
actAsNormal();
|
||||||
|
$this->patch(route('admin.events.update', $this->event), [])->assertRedirect(route('dashboard'));
|
||||||
|
actAsTab();
|
||||||
|
$this->patch(route('admin.events.update', $this->event), [])->assertRedirect(route('dashboard'));
|
||||||
|
});
|
||||||
|
it('updates an event', function () {
|
||||||
|
actAsAdmin();
|
||||||
|
$this->patch(route('admin.events.update', $this->event), ['name' => 'Renamed Test Event']);
|
||||||
|
$this->assertDatabaseHas('events', [
|
||||||
|
'name' => 'Renamed Test Event',
|
||||||
|
]);
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
describe('EventController::Destroy', function () {
|
describe('EventController::Destroy', function () {
|
||||||
it('denies access to a non-admin user', function () {
|
it('denies access to a non-admin user', function () {
|
||||||
$event = \App\Models\Event::factory()->create();
|
$event = \App\Models\Event::factory()->create();
|
||||||
|
|
|
||||||
|
|
@ -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