Basic settings page working
This commit is contained in:
parent
4416bbb20c
commit
ba25b682f3
|
|
@ -0,0 +1,34 @@
|
||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Http\Controllers\Admin;
|
||||||
|
|
||||||
|
use App\Http\Controllers\Controller;
|
||||||
|
use App\Settings;
|
||||||
|
use Illuminate\Http\Request;
|
||||||
|
|
||||||
|
class AuditionSettings extends Controller
|
||||||
|
{
|
||||||
|
public function index()
|
||||||
|
{
|
||||||
|
return view('admin.audition-settings');
|
||||||
|
}
|
||||||
|
|
||||||
|
public function save(Request $request)
|
||||||
|
{
|
||||||
|
$validData = $request->validate([
|
||||||
|
'auditionName' => ['required'],
|
||||||
|
'auditionAbbreviation' => ['required', 'max:8'],
|
||||||
|
'organizerName' => ['required'],
|
||||||
|
'organizerEmail' => ['required', 'email'],
|
||||||
|
'registrationCode' => ['required'],
|
||||||
|
'late_fee' => ['nullable', 'numeric'],
|
||||||
|
'school_fee' => ['nullable', 'numeric'],
|
||||||
|
]);
|
||||||
|
// TODO implement olympic scoring
|
||||||
|
foreach ($validData as $key => $value) {
|
||||||
|
Settings::set($key, $value);
|
||||||
|
}
|
||||||
|
|
||||||
|
return view('admin.audition-settings')->with('success', 'Settings Saved');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -6,19 +6,24 @@ use App\Http\Controllers\Controller;
|
||||||
use App\Models\Event;
|
use App\Models\Event;
|
||||||
use Illuminate\Http\Request;
|
use Illuminate\Http\Request;
|
||||||
use Illuminate\Support\Facades\Auth;
|
use Illuminate\Support\Facades\Auth;
|
||||||
|
|
||||||
use function abort;
|
use function abort;
|
||||||
use function compact;
|
use function compact;
|
||||||
|
|
||||||
class EventController extends Controller
|
class EventController extends Controller
|
||||||
{
|
{
|
||||||
public function index() {
|
public function index()
|
||||||
|
{
|
||||||
$events = Event::all();
|
$events = Event::all();
|
||||||
|
|
||||||
return view('admin.event.index', compact('events'));
|
return view('admin.event.index', compact('events'));
|
||||||
}
|
}
|
||||||
|
|
||||||
public function store(Request $request)
|
public function store(Request $request)
|
||||||
{
|
{
|
||||||
if(! Auth::user()->is_admin) abort(403);
|
if (! Auth::user()->is_admin) {
|
||||||
|
abort(403);
|
||||||
|
}
|
||||||
request()->validate([
|
request()->validate([
|
||||||
'name' => ['required', 'unique:events,name'],
|
'name' => ['required', 'unique:events,name'],
|
||||||
]);
|
]);
|
||||||
|
|
@ -32,8 +37,11 @@ class EventController extends Controller
|
||||||
|
|
||||||
public function destroy(Request $request, Event $event)
|
public function destroy(Request $request, Event $event)
|
||||||
{
|
{
|
||||||
if(! Auth::user()->is_admin) abort(403);
|
if (! Auth::user()->is_admin) {
|
||||||
|
abort(403);
|
||||||
|
}
|
||||||
$event->delete();
|
$event->delete();
|
||||||
|
|
||||||
return redirect()->route('admin.events.index')->with('success', 'Event deleted successfully');
|
return redirect()->route('admin.events.index')->with('success', 'Event deleted successfully');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,7 @@
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
|
use App\Settings;
|
||||||
|
|
||||||
function tw_max_width_class_array(): array
|
function tw_max_width_class_array(): array
|
||||||
{
|
{
|
||||||
$return = [
|
$return = [
|
||||||
|
|
@ -22,3 +24,8 @@ function tw_max_width_class_array(): array
|
||||||
|
|
||||||
return $return;
|
return $return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
function auditionSetting($key) {
|
||||||
|
return Settings::get($key);
|
||||||
|
}
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,62 @@
|
||||||
|
<x-layout.app>
|
||||||
|
<x-slot:page_title>Audition Settings</x-slot:page_title>
|
||||||
|
<x-layout.page-section-container>
|
||||||
|
<x-form.form method="POST" action="{{ route('audition-settings-save') }}">
|
||||||
|
|
||||||
|
<x-layout.page-section>
|
||||||
|
<x-slot:section_name>Group Information</x-slot:section_name>
|
||||||
|
<x-form.body-grid columns="12" class="m-3">
|
||||||
|
<x-form.field label_text="Organization Name" name="auditionName" colspan="8" :value="auditionSetting('auditionName')"/>
|
||||||
|
<x-form.field label_text="Abbreviation" name="auditionAbbreviation" colspan="4" :value="auditionSetting('auditionAbbreviation')"/>
|
||||||
|
<x-form.field label_text="Organizer Name" name="organizerName" colspan="6" :value="auditionSetting('organizerName')"/>
|
||||||
|
<x-form.field label_text="Organizer Email" type="email" name="organizerEmail" colspan="6" :value="auditionSetting('organizerEmail')"/>
|
||||||
|
</x-form.body-grid>
|
||||||
|
</x-layout.page-section>
|
||||||
|
|
||||||
|
<x-layout.page-section>
|
||||||
|
<x-slot:section_name>Registration Settings</x-slot:section_name>
|
||||||
|
<x-slot:section_description>If students cannot advance to further honor groups, leave next event name blank</x-slot:section_description>
|
||||||
|
<x-form.body-grid columns="12" class="m-3">
|
||||||
|
<x-form.field label_text="Registration Code" name="registrationCode" colspan="3" :value="auditionSetting('registrationCode')"/>
|
||||||
|
<x-form.field label_text="Next Event Name" name="advanceTo" colspan="4" :value="auditionSetting('advanceTo')"/>
|
||||||
|
</x-form.body-grid>
|
||||||
|
</x-layout.page-section>
|
||||||
|
|
||||||
|
<x-layout.page-section>
|
||||||
|
<x-slot:section_name>Scoring Settings</x-slot:section_name>
|
||||||
|
<x-slot:section_description>If students cannot advance to further honor groups, leave next event name blank</x-slot:section_description>
|
||||||
|
<x-form.body-grid columns="12" class="m-3">
|
||||||
|
<div class="col-span-6 flex space-x-3">
|
||||||
|
<x-form.toggle-checkbox name="judging_enabled"/><span>Enable score entry by judges</span>
|
||||||
|
</div>
|
||||||
|
<div class="col-span-6 flex space-x-3">
|
||||||
|
<x-form.toggle-checkbox name="olympic_scoring"/><span>Olympic scoring</span>
|
||||||
|
</div>
|
||||||
|
</x-form.body-grid>
|
||||||
|
</x-layout.page-section>
|
||||||
|
|
||||||
|
<x-layout.page-section>
|
||||||
|
<x-slot:section_name>Financial Settings</x-slot:section_name>
|
||||||
|
<x-slot:section_description>If students cannot advance to further honor groups, leave next event name blank</x-slot:section_description>
|
||||||
|
<x-form.body-grid columns="12" class="m-3">
|
||||||
|
|
||||||
|
<x-form.select name="fee_structure" colspan="6">
|
||||||
|
<x-slot:label>Fee Structure</x-slot:label>
|
||||||
|
<option>One fee per entry</option>
|
||||||
|
<option>One fee per student</option>
|
||||||
|
</x-form.select>
|
||||||
|
|
||||||
|
<x-form.field label_text="Late Fee" name="late_fee" colspan="3" :value="auditionSetting('late_fee')"/>
|
||||||
|
<x-form.field label_text="School Membership Fee" name="school_fee" colspan="3" :value="auditionSetting('school_fee')"/>
|
||||||
|
|
||||||
|
</x-form.body-grid>
|
||||||
|
</x-layout.page-section>
|
||||||
|
|
||||||
|
<div class="grid grid-cols-12">
|
||||||
|
<div class="col-span-2 col-start-11 my-5 mr-3">
|
||||||
|
<x-form.button type="submit" Save Settings>Save Settings</x-form.button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</x-form.form>
|
||||||
|
</x-layout.page-section-container>
|
||||||
|
</x-layout.app>
|
||||||
|
|
@ -21,6 +21,7 @@
|
||||||
{{-- TODO convert to named routes --}}
|
{{-- TODO convert to named routes --}}
|
||||||
<div class="absolute left-1/2 z-10 mt-5 flex w-screen max-w-min -translate-x-1/2 px-4" x-show="open" x-cloak>
|
<div class="absolute left-1/2 z-10 mt-5 flex w-screen max-w-min -translate-x-1/2 px-4" x-show="open" x-cloak>
|
||||||
<div class="w-56 shrink rounded-xl bg-white p-4 text-sm font-semibold leading-6 text-gray-900 shadow-lg ring-1 ring-gray-900/5">
|
<div class="w-56 shrink rounded-xl bg-white p-4 text-sm font-semibold leading-6 text-gray-900 shadow-lg ring-1 ring-gray-900/5">
|
||||||
|
<x-layout.navbar.menus.menu-item :href="route('audition-settings')">Audition Settings</x-layout.navbar.menus.menu-item>
|
||||||
<x-layout.navbar.menus.menu-item :href="route('admin.events.index')">Events</x-layout.navbar.menus.menu-item>
|
<x-layout.navbar.menus.menu-item :href="route('admin.events.index')">Events</x-layout.navbar.menus.menu-item>
|
||||||
<x-layout.navbar.menus.menu-item :href="route('admin.auditions.index')">Auditions</x-layout.navbar.menus.menu-item>
|
<x-layout.navbar.menus.menu-item :href="route('admin.auditions.index')">Auditions</x-layout.navbar.menus.menu-item>
|
||||||
<x-layout.navbar.menus.menu-item :href="route('admin.ensembles.index')">Ensembles</x-layout.navbar.menus.menu-item>
|
<x-layout.navbar.menus.menu-item :href="route('admin.ensembles.index')">Ensembles</x-layout.navbar.menus.menu-item>
|
||||||
|
|
|
||||||
|
|
@ -5,7 +5,7 @@
|
||||||
<x-layout.page-section first>
|
<x-layout.page-section first>
|
||||||
<x-slot:section_name>User Information</x-slot:section_name>
|
<x-slot:section_name>User Information</x-slot:section_name>
|
||||||
<x-slot:section_description>Use a permanent address where you receive mail</x-slot:section_description>
|
<x-slot:section_description>Use a permanent address where you receive mail</x-slot:section_description>
|
||||||
<x-form.form method="PATCH" action="/user/{{ Auth::user()->id }}">
|
<x-form.form method="PATCH" action="/user/{{ Auth::user()->id }}" class="mt-4 mb-5">
|
||||||
<x-form.body-grid columns="6" class="!max-w-full">
|
<x-form.body-grid columns="6" class="!max-w-full">
|
||||||
<x-form.field name="first_name" label_text="First Name" value="{{ Auth::user()->first_name }}" colspan="3" required />
|
<x-form.field name="first_name" label_text="First Name" value="{{ Auth::user()->first_name }}" colspan="3" required />
|
||||||
<x-form.field name="last_name" label_text="Last Name" value="{{ Auth::user()->last_name }}" colspan="3" required />
|
<x-form.field name="last_name" label_text="Last Name" value="{{ Auth::user()->last_name }}" colspan="3" required />
|
||||||
|
|
|
||||||
|
|
@ -16,7 +16,7 @@
|
||||||
<x-layout.app>
|
<x-layout.app>
|
||||||
<x-slot:page_title>Test Page</x-slot:page_title>
|
<x-slot:page_title>Test Page</x-slot:page_title>
|
||||||
@php
|
@php
|
||||||
dump($auditionService->getPublishedAuditions());
|
dump(auditionSetting('auditionName'));
|
||||||
@endphp
|
@endphp
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,112 @@
|
||||||
|
<?php
|
||||||
|
|
||||||
|
// Admin Routes
|
||||||
|
use App\Http\Middleware\CheckIfAdmin;
|
||||||
|
use Illuminate\Support\Facades\Route;
|
||||||
|
|
||||||
|
Route::middleware(['auth', 'verified', CheckIfAdmin::class])->prefix('admin/')->group(function () {
|
||||||
|
Route::view('/', 'admin.dashboard');
|
||||||
|
|
||||||
|
Route::post('/auditions/roomUpdate', [\App\Http\Controllers\Admin\AuditionController::class, 'roomUpdate']); // Endpoint for JS assigning auditions to rooms
|
||||||
|
Route::post('/scoring/assign_guide_to_audition', [\App\Http\Controllers\Admin\AuditionController::class, 'scoringGuideUpdate']); // Endpoint for JS assigning scoring guides to auditions
|
||||||
|
|
||||||
|
Route::get('/settings', [\App\Http\Controllers\Admin\AuditionSettings::class, 'index'])->name('audition-settings');
|
||||||
|
Route::post('/settings', [\App\Http\Controllers\Admin\AuditionSettings::class, 'save'])->name('audition-settings-save');
|
||||||
|
|
||||||
|
// Admin Ensemble Routes
|
||||||
|
Route::prefix('ensembles')->controller(\App\Http\Controllers\Admin\EnsembleController::class)->group(function () {
|
||||||
|
Route::get('/', 'index')->name('admin.ensembles.index');
|
||||||
|
Route::post('/', 'store')->name('admin.ensembles.store');
|
||||||
|
Route::delete('/{ensemble}', 'destroy')->name('admin.ensembles.destroy');
|
||||||
|
Route::post('/updateEnsembleRank', 'updateEnsembleRank')->name('admin.ensembles.updateEnsembleRank');
|
||||||
|
Route::patch('/{ensemble}', 'updateEnsemble')->name('admin.ensembles.updateEnsemble');
|
||||||
|
Route::get('/seating-limits', 'seatingLimits')->name('admin.ensembles.seatingLimits');
|
||||||
|
Route::get('/seating-limits/{ensemble}', 'seatingLimits')->name('admin.ensembles.seatingLimits.ensemble');
|
||||||
|
Route::post('/seating-limits/{ensemble}', 'seatingLimitsSet')->name('admin.ensembles.seatingLimits.ensemble.set');
|
||||||
|
});
|
||||||
|
|
||||||
|
// Admin Event Routes
|
||||||
|
Route::prefix('events')->controller(\App\Http\Controllers\Admin\EventController::class)->group(function () {
|
||||||
|
Route::get('/', 'index')->name('admin.events.index');
|
||||||
|
Route::post('/', 'store')->name('admin.events.store');
|
||||||
|
Route::delete('/{event}', 'destroy')->name('admin.events.destroy');
|
||||||
|
});
|
||||||
|
|
||||||
|
// Admin Rooms Routes
|
||||||
|
Route::prefix('rooms')->controller(\App\Http\Controllers\Admin\RoomController::class)->group(function () {
|
||||||
|
Route::get('/', 'index')->name('admin.rooms.index');
|
||||||
|
Route::get('/create', 'create')->name('admin.rooms.create');
|
||||||
|
Route::post('/', 'store')->name('admin.rooms.store');
|
||||||
|
Route::post('/{room}/edit', 'edit')->name('admin.rooms.edit');
|
||||||
|
Route::patch('/{room}', 'update')->name('admin.rooms.update');
|
||||||
|
Route::delete('/{room}', 'destroy')->name('admin.rooms.destroy');
|
||||||
|
Route::get('/judging_assignments', 'judgingAssignment')->name('admin.rooms.judgingAssignment'); // Screen to assign judges to rooms
|
||||||
|
Route::match(['post', 'delete'], '/{room}/judge', 'updateJudgeAssignment')->name('admin.rooms.updateJudgeAssignment');
|
||||||
|
|
||||||
|
});
|
||||||
|
|
||||||
|
// Admin Scoring Guides
|
||||||
|
Route::prefix('scoring')->controller(\App\Http\Controllers\Admin\ScoringGuideController::class)->group(function () {
|
||||||
|
Route::get('/', 'index')->name('admin.scoring.index'); // Scoring Setup Homepage
|
||||||
|
Route::post('/guides', 'store')->name('admin.scoring.store'); // Save a new scoring guide
|
||||||
|
Route::get('/guides/{guide}/edit', 'edit')->name('admin.scoring.edit'); // Edit scoring guide
|
||||||
|
Route::patch('/guides/{guide}/edit', 'update')->name('admin.scoring.update'); // Save changes to audition guide (rename)
|
||||||
|
Route::post('/guides/{guide}/subscore', 'subscore_store')->name('admin.scoring.subscore_store'); // Save a new subscore
|
||||||
|
Route::post('/reorder-display', 'reorder_display')->name('admin.scoring.reorder_display');
|
||||||
|
Route::post('/reorder-tiebreak', 'reorder_tiebreak')->name('admin.scoring.reorder_tiebreak');
|
||||||
|
});
|
||||||
|
|
||||||
|
// Admin Auditions Routes
|
||||||
|
Route::prefix('auditions')->controller(\App\Http\Controllers\Admin\AuditionController::class)->group(function () {
|
||||||
|
Route::get('/', 'index')->name('admin.auditions.index');
|
||||||
|
Route::get('/create', 'create')->name('admin.auditions.create');
|
||||||
|
Route::post('/', 'store')->name('admin.auditions.store');
|
||||||
|
Route::get('/{audition}/edit', 'edit')->name('admin.auditions.edit');
|
||||||
|
Route::patch('/{audition}', 'update')->name('admin.auditions.update');
|
||||||
|
Route::post('/reorder', 'reorder')->name('admin.auditions.reorder');
|
||||||
|
Route::delete('/{audition}', 'destroy')->name('admin.auditions.destroy');
|
||||||
|
Route::get('/run_draw', 'prepareDraw')->name('admin.auditions.prepareDraw');
|
||||||
|
Route::post('/run_draw', 'runDraw')->name('admin.auditions.runDraw');
|
||||||
|
});
|
||||||
|
|
||||||
|
// Admin Entries Routes
|
||||||
|
Route::prefix('entries')->controller(\App\Http\Controllers\Admin\EntryController::class)->group(function () {
|
||||||
|
Route::get('/', 'index');
|
||||||
|
Route::get('/create', 'create');
|
||||||
|
Route::post('/', 'store');
|
||||||
|
Route::get('/{entry}/edit', 'edit');
|
||||||
|
Route::patch('/{entry}', 'update');
|
||||||
|
|
||||||
|
});
|
||||||
|
|
||||||
|
// Admin Student Routes
|
||||||
|
Route::prefix('students')->controller(\App\Http\Controllers\Admin\StudentController::class)->group(function () {
|
||||||
|
Route::get('/', 'index');
|
||||||
|
Route::get('/create', 'create');
|
||||||
|
Route::post('/', 'store');
|
||||||
|
Route::get('/{student}/edit', 'edit');
|
||||||
|
Route::patch('/{student}', 'update');
|
||||||
|
});
|
||||||
|
|
||||||
|
// Admin School Routes
|
||||||
|
Route::prefix('schools')->controller(\App\Http\Controllers\Admin\SchoolController::class)->group(function () {
|
||||||
|
Route::post('/{school}/add_domain', 'add_domain');
|
||||||
|
Route::get('/', 'index');
|
||||||
|
Route::get('/create', 'create');
|
||||||
|
Route::get('/{school}/edit', 'edit');
|
||||||
|
Route::patch('/{school}', 'update');
|
||||||
|
Route::post('/', 'store');
|
||||||
|
Route::delete('/domain/{domain}', 'destroy_domain');
|
||||||
|
|
||||||
|
});
|
||||||
|
|
||||||
|
// Admin User Routes
|
||||||
|
Route::prefix('users')->controller(\App\Http\Controllers\Admin\UserController::class)->group(function () {
|
||||||
|
Route::get('/', 'index');
|
||||||
|
Route::get('/create', 'create');
|
||||||
|
Route::post('/', 'store');
|
||||||
|
Route::get('/{user}/edit', 'edit');
|
||||||
|
Route::patch('/{user}', 'update');
|
||||||
|
Route::delete('/{user}', 'destroy');
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
@ -0,0 +1,13 @@
|
||||||
|
<?php
|
||||||
|
// Judging Routes
|
||||||
|
use App\Http\Controllers\JudgingController;
|
||||||
|
use App\Http\Middleware\CheckIfCanJudge;
|
||||||
|
use Illuminate\Support\Facades\Route;
|
||||||
|
|
||||||
|
Route::middleware(['auth', 'verified', CheckIfCanJudge::class])->prefix('judging')->controller(JudgingController::class)->group(function () {
|
||||||
|
Route::get('/', 'index');
|
||||||
|
Route::get('/audition/{audition}', 'auditionEntryList');
|
||||||
|
Route::get('/entry/{entry}', 'entryScoreSheet');
|
||||||
|
Route::post('/entry/{entry}', 'saveScoreSheet');
|
||||||
|
Route::patch('/entry/{entry}', 'updateScoreSheet');
|
||||||
|
});
|
||||||
|
|
@ -0,0 +1,31 @@
|
||||||
|
<?php
|
||||||
|
// Tabulation Routes
|
||||||
|
use App\Http\Controllers\Tabulation\DoublerDecisionController;
|
||||||
|
use App\Http\Middleware\CheckIfCanTab;
|
||||||
|
use Illuminate\Support\Facades\Route;
|
||||||
|
|
||||||
|
Route::middleware(['auth', 'verified', CheckIfCanTab::class])->group(function () {
|
||||||
|
|
||||||
|
// Score Management
|
||||||
|
Route::prefix('scores/')->controller(\App\Http\Controllers\Tabulation\ScoreController::class)->group(function () {
|
||||||
|
Route::get('/choose_entry', 'chooseEntry')->name('scores.chooseEntry');
|
||||||
|
Route::get('/entry', 'entryScoreSheet')->name('scores.entryScoreSheet');
|
||||||
|
Route::post('/entry/{entry}', 'saveEntryScoreSheet')->name('scores.saveEntryScoreSheet');
|
||||||
|
Route::delete('/{score}', [\App\Http\Controllers\Tabulation\ScoreController::class, 'destroyScore'])->name('scores.destroy');
|
||||||
|
});
|
||||||
|
|
||||||
|
// Generic Tabulation Routes
|
||||||
|
Route::prefix('tabulation/')->controller(\App\Http\Controllers\Tabulation\TabulationController::class)->group(function () {
|
||||||
|
Route::get('/status', 'status');
|
||||||
|
Route::match(['get', 'post'], '/auditions/{audition}', 'auditionSeating')->name('tabulation.audition.seat');
|
||||||
|
Route::post('/auditions/{audition}/publish-seats', 'publishSeats')->name('tabulation.seat.publish');
|
||||||
|
Route::post('/auditions/{audition}/unpublish-seats', 'unpublishSeats')->name('tabulation.seat.unpublish');
|
||||||
|
});
|
||||||
|
|
||||||
|
// Doubler decision routes
|
||||||
|
Route::prefix('doubler-decision')->controller(DoublerDecisionController::class)->group(function () {
|
||||||
|
Route::post('{entry}/accept', 'accept')->name('doubler.accept');
|
||||||
|
Route::post('{entry}/decline', 'decline')->name('doubler.decline');
|
||||||
|
});
|
||||||
|
|
||||||
|
});
|
||||||
|
|
@ -0,0 +1,47 @@
|
||||||
|
<?php
|
||||||
|
|
||||||
|
// Dashboard Related Routes
|
||||||
|
use App\Http\Controllers\DashboardController;
|
||||||
|
use App\Http\Controllers\EntryController;
|
||||||
|
use App\Http\Controllers\SchoolController;
|
||||||
|
use App\Http\Controllers\StudentController;
|
||||||
|
use App\Http\Controllers\UserController;
|
||||||
|
use Illuminate\Support\Facades\Route;
|
||||||
|
|
||||||
|
Route::middleware(['auth', 'verified'])->group(function () {
|
||||||
|
Route::get('/dashboard', [DashboardController::class, 'dashboard'])->name('dashboard');
|
||||||
|
Route::get('/profile', [DashboardController::class, 'profile']);
|
||||||
|
Route::get('/my_school', [DashboardController::class, 'my_school']);
|
||||||
|
});
|
||||||
|
|
||||||
|
// Entry Related Routes
|
||||||
|
Route::middleware(['auth', 'verified', 'can:create,App\Models\Entry'])->controller(EntryController::class)->group(function () {
|
||||||
|
Route::get('/entries', 'index');
|
||||||
|
Route::get('/entries/create', 'create');
|
||||||
|
Route::post('/entries', 'store');
|
||||||
|
Route::delete('/entries/{entry}', 'destroy');
|
||||||
|
});
|
||||||
|
|
||||||
|
// User Related Routes
|
||||||
|
Route::middleware(['auth', 'verified'])->controller(UserController::class)->group(function () {
|
||||||
|
Route::patch('/users/{user}/set_school', 'set_school');
|
||||||
|
Route::patch('/users/{$user}', 'update');
|
||||||
|
});
|
||||||
|
|
||||||
|
// Student Related Routes
|
||||||
|
Route::middleware(['auth', 'verified', 'can:create,App\Models\Student'])->controller(StudentController::class)->group(function () {
|
||||||
|
Route::get('/students', 'index');
|
||||||
|
Route::post('students', 'store');
|
||||||
|
Route::get('/students/{student}/edit', 'edit');
|
||||||
|
Route::patch('/students/{student}', 'update');
|
||||||
|
Route::delete('/students/{student}', 'destroy');
|
||||||
|
});
|
||||||
|
|
||||||
|
// School Related Routes
|
||||||
|
Route::middleware(['auth', 'verified'])->controller(SchoolController::class)->group(function () {
|
||||||
|
Route::get('/schools/create', 'create');
|
||||||
|
Route::post('/schools', 'store');
|
||||||
|
Route::get('/schools/{school}/edit', 'edit');
|
||||||
|
Route::get('/schools/{school}', 'show');
|
||||||
|
Route::patch('/schools/{school}', 'update');
|
||||||
|
});
|
||||||
187
routes/web.php
187
routes/web.php
|
|
@ -15,195 +15,16 @@ use App\Http\Middleware\CheckIfCanTab;
|
||||||
use Illuminate\Support\Facades\Auth;
|
use Illuminate\Support\Facades\Auth;
|
||||||
use Illuminate\Support\Facades\Route;
|
use Illuminate\Support\Facades\Route;
|
||||||
|
|
||||||
|
require __DIR__.'/admin.php';
|
||||||
|
require __DIR__.'/judging.php';
|
||||||
|
require __DIR__.'/tabulation.php';
|
||||||
|
require __DIR__.'/user.php';
|
||||||
|
|
||||||
Route::get('/test', [TestController::class, 'flashTest'])->middleware('auth', 'verified');
|
Route::get('/test', [TestController::class, 'flashTest'])->middleware('auth', 'verified');
|
||||||
|
|
||||||
Route::view('/', 'welcome')->middleware('guest')->name('home');
|
Route::view('/', 'welcome')->middleware('guest')->name('home');
|
||||||
Route::get('/results', [App\Http\Controllers\ResultsPage::class, '__invoke'])->name('results');
|
Route::get('/results', [App\Http\Controllers\ResultsPage::class, '__invoke'])->name('results');
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// Judging Routes
|
|
||||||
Route::middleware(['auth', 'verified', CheckIfCanJudge::class])->prefix('judging')->controller(JudgingController::class)->group(function () {
|
|
||||||
Route::get('/', 'index');
|
|
||||||
Route::get('/audition/{audition}', 'auditionEntryList');
|
|
||||||
Route::get('/entry/{entry}', 'entryScoreSheet');
|
|
||||||
Route::post('/entry/{entry}', 'saveScoreSheet');
|
|
||||||
Route::patch('/entry/{entry}', 'updateScoreSheet');
|
|
||||||
});
|
|
||||||
|
|
||||||
// Tabulation Routes
|
|
||||||
Route::middleware(['auth', 'verified', CheckIfCanTab::class])->group(function () {
|
|
||||||
|
|
||||||
// Score Management
|
|
||||||
Route::prefix('scores/')->controller(\App\Http\Controllers\Tabulation\ScoreController::class)->group(function () {
|
|
||||||
Route::get('/choose_entry', 'chooseEntry')->name('scores.chooseEntry');
|
|
||||||
Route::get('/entry', 'entryScoreSheet')->name('scores.entryScoreSheet');
|
|
||||||
Route::post('/entry/{entry}', 'saveEntryScoreSheet')->name('scores.saveEntryScoreSheet');
|
|
||||||
Route::delete('/{score}', [\App\Http\Controllers\Tabulation\ScoreController::class, 'destroyScore'])->name('scores.destroy');
|
|
||||||
});
|
|
||||||
|
|
||||||
// Generic Tabulation Routes
|
|
||||||
Route::prefix('tabulation/')->controller(\App\Http\Controllers\Tabulation\TabulationController::class)->group(function () {
|
|
||||||
Route::get('/status', 'status');
|
|
||||||
Route::match(['get', 'post'], '/auditions/{audition}', 'auditionSeating')->name('tabulation.audition.seat');
|
|
||||||
Route::post('/auditions/{audition}/publish-seats', 'publishSeats')->name('tabulation.seat.publish');
|
|
||||||
Route::post('/auditions/{audition}/unpublish-seats', 'unpublishSeats')->name('tabulation.seat.unpublish');
|
|
||||||
});
|
|
||||||
|
|
||||||
// Doubler decision routes
|
|
||||||
Route::prefix('doubler-decision')->controller(DoublerDecisionController::class)->group(function () {
|
|
||||||
Route::post('{entry}/accept', 'accept')->name('doubler.accept');
|
|
||||||
Route::post('{entry}/decline', 'decline')->name('doubler.decline');
|
|
||||||
});
|
|
||||||
|
|
||||||
});
|
|
||||||
|
|
||||||
// Admin Routes
|
|
||||||
Route::middleware(['auth', 'verified', CheckIfAdmin::class])->prefix('admin/')->group(function () {
|
|
||||||
Route::view('/', 'admin.dashboard');
|
|
||||||
|
|
||||||
Route::post('/auditions/roomUpdate', [\App\Http\Controllers\Admin\AuditionController::class, 'roomUpdate']); // Endpoint for JS assigning auditions to rooms
|
|
||||||
Route::post('/scoring/assign_guide_to_audition', [\App\Http\Controllers\Admin\AuditionController::class, 'scoringGuideUpdate']); // Endpoint for JS assigning scoring guides to auditions
|
|
||||||
|
|
||||||
// Admin Ensemble Routes
|
|
||||||
Route::prefix('ensembles')->controller(\App\Http\Controllers\Admin\EnsembleController::class)->group(function () {
|
|
||||||
Route::get('/', 'index')->name('admin.ensembles.index');
|
|
||||||
Route::post('/', 'store')->name('admin.ensembles.store');
|
|
||||||
Route::delete('/{ensemble}', 'destroy')->name('admin.ensembles.destroy');
|
|
||||||
Route::post('/updateEnsembleRank', 'updateEnsembleRank')->name('admin.ensembles.updateEnsembleRank');
|
|
||||||
Route::patch('/{ensemble}', 'updateEnsemble')->name('admin.ensembles.updateEnsemble');
|
|
||||||
Route::get('/seating-limits', 'seatingLimits')->name('admin.ensembles.seatingLimits');
|
|
||||||
Route::get('/seating-limits/{ensemble}', 'seatingLimits')->name('admin.ensembles.seatingLimits.ensemble');
|
|
||||||
Route::post('/seating-limits/{ensemble}', 'seatingLimitsSet')->name('admin.ensembles.seatingLimits.ensemble.set');
|
|
||||||
});
|
|
||||||
|
|
||||||
// Admin Event Routes
|
|
||||||
Route::prefix('events')->controller(\App\Http\Controllers\Admin\EventController::class)->group(function () {
|
|
||||||
Route::get('/', 'index')->name('admin.events.index');
|
|
||||||
Route::post('/', 'store')->name('admin.events.store');
|
|
||||||
Route::delete('/{event}', 'destroy')->name('admin.events.destroy');
|
|
||||||
});
|
|
||||||
|
|
||||||
// Admin Rooms Routes
|
|
||||||
Route::prefix('rooms')->controller(\App\Http\Controllers\Admin\RoomController::class)->group(function () {
|
|
||||||
Route::get('/', 'index')->name('admin.rooms.index');
|
|
||||||
Route::get('/create', 'create')->name('admin.rooms.create');
|
|
||||||
Route::post('/', 'store')->name('admin.rooms.store');
|
|
||||||
Route::post('/{room}/edit', 'edit')->name('admin.rooms.edit');
|
|
||||||
Route::patch('/{room}', 'update')->name('admin.rooms.update');
|
|
||||||
Route::delete('/{room}', 'destroy')->name('admin.rooms.destroy');
|
|
||||||
Route::get('/judging_assignments', 'judgingAssignment')->name('admin.rooms.judgingAssignment'); // Screen to assign judges to rooms
|
|
||||||
Route::match(['post', 'delete'], '/{room}/judge', 'updateJudgeAssignment')->name('admin.rooms.updateJudgeAssignment');
|
|
||||||
|
|
||||||
});
|
|
||||||
|
|
||||||
// Admin Scoring Guides
|
|
||||||
Route::prefix('scoring')->controller(\App\Http\Controllers\Admin\ScoringGuideController::class)->group(function () {
|
|
||||||
Route::get('/', 'index')->name('admin.scoring.index'); // Scoring Setup Homepage
|
|
||||||
Route::post('/guides', 'store')->name('admin.scoring.store'); // Save a new scoring guide
|
|
||||||
Route::get('/guides/{guide}/edit', 'edit')->name('admin.scoring.edit'); // Edit scoring guide
|
|
||||||
Route::patch('/guides/{guide}/edit', 'update')->name('admin.scoring.update'); // Save changes to audition guide (rename)
|
|
||||||
Route::post('/guides/{guide}/subscore', 'subscore_store')->name('admin.scoring.subscore_store'); // Save a new subscore
|
|
||||||
Route::post('/reorder-display', 'reorder_display')->name('admin.scoring.reorder_display');
|
|
||||||
Route::post('/reorder-tiebreak', 'reorder_tiebreak')->name('admin.scoring.reorder_tiebreak');
|
|
||||||
});
|
|
||||||
|
|
||||||
// Admin Auditions Routes
|
|
||||||
Route::prefix('auditions')->controller(\App\Http\Controllers\Admin\AuditionController::class)->group(function () {
|
|
||||||
Route::get('/', 'index')->name('admin.auditions.index');
|
|
||||||
Route::get('/create', 'create')->name('admin.auditions.create');
|
|
||||||
Route::post('/', 'store')->name('admin.auditions.store');
|
|
||||||
Route::get('/{audition}/edit', 'edit')->name('admin.auditions.edit');
|
|
||||||
Route::patch('/{audition}', 'update')->name('admin.auditions.update');
|
|
||||||
Route::post('/reorder', 'reorder')->name('admin.auditions.reorder');
|
|
||||||
Route::delete('/{audition}', 'destroy')->name('admin.auditions.destroy');
|
|
||||||
Route::get('/run_draw', 'prepareDraw')->name('admin.auditions.prepareDraw');
|
|
||||||
Route::post('/run_draw', 'runDraw')->name('admin.auditions.runDraw');
|
|
||||||
});
|
|
||||||
|
|
||||||
// Admin Entries Routes
|
|
||||||
Route::prefix('entries')->controller(\App\Http\Controllers\Admin\EntryController::class)->group(function () {
|
|
||||||
Route::get('/', 'index');
|
|
||||||
Route::get('/create', 'create');
|
|
||||||
Route::post('/', 'store');
|
|
||||||
Route::get('/{entry}/edit', 'edit');
|
|
||||||
Route::patch('/{entry}', 'update');
|
|
||||||
|
|
||||||
});
|
|
||||||
|
|
||||||
// Admin Student Routes
|
|
||||||
Route::prefix('students')->controller(\App\Http\Controllers\Admin\StudentController::class)->group(function () {
|
|
||||||
Route::get('/', 'index');
|
|
||||||
Route::get('/create', 'create');
|
|
||||||
Route::post('/', 'store');
|
|
||||||
Route::get('/{student}/edit', 'edit');
|
|
||||||
Route::patch('/{student}', 'update');
|
|
||||||
});
|
|
||||||
|
|
||||||
// Admin School Routes
|
|
||||||
Route::prefix('schools')->controller(\App\Http\Controllers\Admin\SchoolController::class)->group(function () {
|
|
||||||
Route::post('/{school}/add_domain', 'add_domain');
|
|
||||||
Route::get('/', 'index');
|
|
||||||
Route::get('/create', 'create');
|
|
||||||
Route::get('/{school}/edit', 'edit');
|
|
||||||
Route::patch('/{school}', 'update');
|
|
||||||
Route::post('/', 'store');
|
|
||||||
Route::delete('/domain/{domain}', 'destroy_domain');
|
|
||||||
|
|
||||||
});
|
|
||||||
|
|
||||||
// Admin User Routes
|
|
||||||
Route::prefix('users')->controller(\App\Http\Controllers\Admin\UserController::class)->group(function () {
|
|
||||||
Route::get('/', 'index');
|
|
||||||
Route::get('/create', 'create');
|
|
||||||
Route::post('/', 'store');
|
|
||||||
Route::get('/{user}/edit', 'edit');
|
|
||||||
Route::patch('/{user}', 'update');
|
|
||||||
Route::delete('/{user}', 'destroy');
|
|
||||||
});
|
|
||||||
});
|
|
||||||
|
|
||||||
// Dashboard Related Routes
|
|
||||||
Route::middleware(['auth', 'verified'])->group(function () {
|
|
||||||
Route::get('/dashboard', [DashboardController::class, 'dashboard'])->name('dashboard');
|
|
||||||
Route::get('/profile', [DashboardController::class, 'profile']);
|
|
||||||
Route::get('/my_school', [DashboardController::class, 'my_school']);
|
|
||||||
});
|
|
||||||
|
|
||||||
// Entry Related Routes
|
|
||||||
Route::middleware(['auth', 'verified', 'can:create,App\Models\Entry'])->controller(EntryController::class)->group(function () {
|
|
||||||
Route::get('/entries', 'index');
|
|
||||||
Route::get('/entries/create', 'create');
|
|
||||||
Route::post('/entries', 'store');
|
|
||||||
Route::delete('/entries/{entry}', 'destroy');
|
|
||||||
});
|
|
||||||
|
|
||||||
// User Related Routes
|
|
||||||
Route::middleware(['auth', 'verified'])->controller(UserController::class)->group(function () {
|
|
||||||
Route::patch('/users/{user}/set_school', 'set_school');
|
|
||||||
Route::patch('/users/{$user}', 'update');
|
|
||||||
});
|
|
||||||
|
|
||||||
// Student Related Routes
|
|
||||||
Route::middleware(['auth', 'verified', 'can:create,App\Models\Student'])->controller(StudentController::class)->group(function () {
|
|
||||||
Route::get('/students', 'index');
|
|
||||||
Route::post('students', 'store');
|
|
||||||
Route::get('/students/{student}/edit', 'edit');
|
|
||||||
Route::patch('/students/{student}', 'update');
|
|
||||||
Route::delete('/students/{student}', 'destroy');
|
|
||||||
});
|
|
||||||
|
|
||||||
// School Related Routes
|
|
||||||
Route::middleware(['auth', 'verified'])->controller(SchoolController::class)->group(function () {
|
|
||||||
Route::get('/schools/create', 'create');
|
|
||||||
Route::post('/schools', 'store');
|
|
||||||
Route::get('/schools/{school}/edit', 'edit');
|
|
||||||
Route::get('/schools/{school}', 'show');
|
|
||||||
Route::patch('/schools/{school}', 'update');
|
|
||||||
});
|
|
||||||
|
|
||||||
// Filter Related Routes
|
// Filter Related Routes
|
||||||
Route::prefix('filters')->middleware(['auth', 'verified'])->controller(FilterController::class)->group(function () {
|
Route::prefix('filters')->middleware(['auth', 'verified'])->controller(FilterController::class)->group(function () {
|
||||||
Route::post('/admin_entry_filter', 'adminEntryFilter');
|
Route::post('/admin_entry_filter', 'adminEntryFilter');
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue