2020-04-26 04:09:32 +00:00
|
|
|
<?php
|
|
|
|
|
2020-10-21 00:01:41 +00:00
|
|
|
/*
|
|
|
|
* Copyright © 2020 Miguel Nogueira
|
|
|
|
*
|
|
|
|
* This file is part of Raspberry Staff Manager.
|
|
|
|
*
|
|
|
|
* Raspberry Staff Manager is free software: you can redistribute it and/or modify
|
|
|
|
* it under the terms of the GNU General Public License as published by
|
|
|
|
* the Free Software Foundation, either version 3 of the License, or
|
|
|
|
* (at your option) any later version.
|
|
|
|
*
|
|
|
|
* Raspberry Staff Manager is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU General Public License
|
|
|
|
* along with Raspberry Staff Manager. If not, see <https://www.gnu.org/licenses/>.
|
|
|
|
*/
|
|
|
|
|
2020-04-26 04:09:32 +00:00
|
|
|
use Illuminate\Support\Facades\Route;
|
2020-09-02 16:43:27 +00:00
|
|
|
use Mcamara\LaravelLocalization\Facades\LaravelLocalization;
|
2020-04-26 04:09:32 +00:00
|
|
|
|
|
|
|
/*
|
|
|
|
|--------------------------------------------------------------------------
|
|
|
|
| Web Routes
|
|
|
|
|--------------------------------------------------------------------------
|
|
|
|
|
|
|
|
|
| Here is where you can register web routes for your application. These
|
|
|
|
| routes are loaded by the RouteServiceProvider within a group which
|
|
|
|
| contains the "web" middleware group. Now create something great!
|
|
|
|
|
|
|
|
|
*/
|
2020-10-21 00:01:41 +00:00
|
|
|
Route::group(['prefix' => LaravelLocalization::setLocale(), 'middleware' => ['localeSessionRedirect', 'localizationRedirect', 'localeViewPath']], function () {
|
|
|
|
Route::group(['prefix' => 'auth', 'middleware' => ['usernameUUID']], function () {
|
2020-09-03 19:06:29 +00:00
|
|
|
Auth::routes(['verify' => true]);
|
2020-07-17 21:44:10 +00:00
|
|
|
|
2020-09-02 16:43:27 +00:00
|
|
|
Route::post('/twofa/authenticate', 'Auth\TwofaController@verify2FA')
|
|
|
|
->name('verify2FA');
|
|
|
|
});
|
2020-05-13 21:47:51 +00:00
|
|
|
|
2020-10-21 00:01:41 +00:00
|
|
|
Route::get('/', 'HomeController@index')
|
2020-09-02 16:43:27 +00:00
|
|
|
->middleware('eligibility');
|
2020-04-29 02:20:00 +00:00
|
|
|
|
2020-09-02 16:43:27 +00:00
|
|
|
Route::post('/form/contact', 'ContactController@create')
|
|
|
|
->name('sendSubmission');
|
2020-04-29 02:20:00 +00:00
|
|
|
|
2020-10-21 00:01:41 +00:00
|
|
|
Route::group(['middleware' => ['auth', 'forcelogout', '2fa', 'verified']], function () {
|
2020-09-02 16:43:27 +00:00
|
|
|
Route::get('/dashboard', 'DashboardController@index')
|
|
|
|
->name('dashboard')
|
|
|
|
->middleware('eligibility');
|
2020-06-27 18:15:33 +00:00
|
|
|
|
2020-09-02 16:43:27 +00:00
|
|
|
Route::get('users/directory', 'ProfileController@index')
|
|
|
|
->name('directory');
|
2020-04-30 15:38:54 +00:00
|
|
|
|
2020-10-21 00:01:41 +00:00
|
|
|
Route::group(['prefix' => '/applications'], function () {
|
2020-09-02 16:43:27 +00:00
|
|
|
Route::get('/my-applications', 'ApplicationController@showUserApps')
|
|
|
|
->name('showUserApps')
|
|
|
|
->middleware('eligibility');
|
2020-05-22 02:49:16 +00:00
|
|
|
|
2020-09-02 16:43:27 +00:00
|
|
|
Route::get('/view/{application}', 'ApplicationController@showUserApp')
|
|
|
|
->name('showUserApp');
|
2020-06-26 23:32:33 +00:00
|
|
|
|
2020-09-02 16:43:27 +00:00
|
|
|
Route::post('/{application}/comments', 'CommentController@insert')
|
|
|
|
->name('addApplicationComment');
|
2020-06-26 23:32:33 +00:00
|
|
|
|
2020-09-02 16:43:27 +00:00
|
|
|
Route::delete('/comments/{comment}/delete', 'CommentController@delete')
|
|
|
|
->name('deleteApplicationComment');
|
2020-06-26 23:32:33 +00:00
|
|
|
|
2020-09-02 23:39:59 +00:00
|
|
|
Route::patch('/notes/save/{application}', 'AppointmentController@saveNotes')
|
2020-09-02 16:43:27 +00:00
|
|
|
->name('saveNotes');
|
2020-05-29 23:20:39 +00:00
|
|
|
|
2020-09-02 16:43:27 +00:00
|
|
|
Route::patch('/update/{application}/{newStatus}', 'ApplicationController@updateApplicationStatus')
|
|
|
|
->name('updateApplicationStatus');
|
2020-07-12 16:01:33 +00:00
|
|
|
|
2020-09-02 16:43:27 +00:00
|
|
|
Route::delete('{application}/delete', 'ApplicationController@delete')
|
|
|
|
->name('deleteApplication');
|
2020-07-11 01:43:59 +00:00
|
|
|
|
2020-09-02 16:43:27 +00:00
|
|
|
Route::get('/staff/all', 'ApplicationController@showAllApps')
|
|
|
|
->name('allApplications');
|
2020-07-11 01:43:59 +00:00
|
|
|
|
2020-09-02 16:43:27 +00:00
|
|
|
Route::get('/staff/outstanding', 'ApplicationController@showAllPendingApps')
|
|
|
|
->name('staffPendingApps');
|
2020-07-11 01:43:59 +00:00
|
|
|
|
2020-09-02 16:43:27 +00:00
|
|
|
Route::get('/staff/peer-review', 'ApplicationController@showPeerReview')
|
|
|
|
->name('peerReview');
|
2020-07-11 01:43:59 +00:00
|
|
|
|
2020-09-02 16:43:27 +00:00
|
|
|
Route::get('/staff/pending-interview', 'ApplicationController@showPendingInterview')
|
|
|
|
->name('pendingInterview');
|
2020-05-08 05:06:24 +00:00
|
|
|
|
2020-09-02 16:43:27 +00:00
|
|
|
Route::post('{application}/staff/vote', 'VoteController@vote')
|
|
|
|
->name('voteApplication');
|
|
|
|
});
|
2020-05-22 02:49:16 +00:00
|
|
|
|
2020-10-21 00:01:41 +00:00
|
|
|
Route::group(['prefix' => 'appointments'], function () {
|
2020-09-02 16:43:27 +00:00
|
|
|
Route::post('schedule/appointments/{application}', 'AppointmentController@saveAppointment')
|
|
|
|
->name('scheduleAppointment');
|
2020-05-22 02:49:16 +00:00
|
|
|
|
2020-09-02 16:43:27 +00:00
|
|
|
Route::patch('update/appointments/{application}/{status}', 'AppointmentController@updateAppointment')
|
|
|
|
->name('updateAppointment');
|
|
|
|
});
|
2020-05-08 05:06:24 +00:00
|
|
|
|
2020-10-21 00:01:41 +00:00
|
|
|
Route::group(['prefix' => 'apply', 'middleware' => ['eligibility']], function () {
|
2020-09-02 16:43:27 +00:00
|
|
|
Route::get('positions/{vacancySlug}', 'ApplicationController@renderApplicationForm')
|
|
|
|
->name('renderApplicationForm');
|
2020-05-08 07:10:25 +00:00
|
|
|
|
2020-09-02 16:43:27 +00:00
|
|
|
Route::post('positions/{vacancySlug}/submit', 'ApplicationController@saveApplicationAnswers')
|
|
|
|
->name('saveApplicationForm');
|
|
|
|
});
|
2020-05-08 05:06:24 +00:00
|
|
|
|
2020-10-21 00:01:41 +00:00
|
|
|
Route::group(['prefix' => '/profile'], function () {
|
2020-09-02 16:43:27 +00:00
|
|
|
Route::get('/settings', 'ProfileController@showProfile')
|
|
|
|
->name('showProfileSettings');
|
2020-05-13 21:47:51 +00:00
|
|
|
|
2020-09-02 16:43:27 +00:00
|
|
|
Route::patch('/settings/save', 'ProfileController@saveProfile')
|
|
|
|
->name('saveProfileSettings');
|
2020-05-13 21:47:51 +00:00
|
|
|
|
2020-09-02 16:43:27 +00:00
|
|
|
Route::get('user/{user}', 'ProfileController@showSingleProfile')
|
|
|
|
->name('showSingleProfile');
|
2020-05-13 21:47:51 +00:00
|
|
|
|
2020-09-02 16:43:27 +00:00
|
|
|
Route::get('/settings/account', 'UserController@showAccount')
|
|
|
|
->name('showAccountSettings');
|
2020-05-13 21:47:51 +00:00
|
|
|
|
2020-09-02 16:43:27 +00:00
|
|
|
Route::patch('/settings/account/change-password', 'UserController@changePassword')
|
|
|
|
->name('changePassword');
|
2020-05-13 21:47:51 +00:00
|
|
|
|
2020-09-02 16:43:27 +00:00
|
|
|
Route::patch('/settings/account/change-email', 'UserController@changeEmail')
|
|
|
|
->name('changeEmail');
|
2020-05-08 05:06:24 +00:00
|
|
|
|
2020-09-02 16:43:27 +00:00
|
|
|
Route::post('/settings/account/flush-sessions', 'UserController@flushSessions')
|
|
|
|
->name('flushSessions');
|
2020-07-17 21:44:10 +00:00
|
|
|
|
2020-09-02 16:43:27 +00:00
|
|
|
Route::patch('/settings/account/twofa/enable', 'UserController@add2FASecret')
|
|
|
|
->name('enable2FA');
|
2020-07-17 21:44:10 +00:00
|
|
|
|
2020-09-02 16:43:27 +00:00
|
|
|
Route::patch('/settings/account/twofa/disable', 'UserController@remove2FASecret')
|
|
|
|
->name('disable2FA');
|
|
|
|
});
|
2020-05-08 05:06:24 +00:00
|
|
|
|
2020-10-21 00:01:41 +00:00
|
|
|
Route::group(['prefix' => '/hr'], function () {
|
2020-09-02 16:43:27 +00:00
|
|
|
Route::get('staff-members', 'UserController@showStaffMembers')
|
|
|
|
->name('staffMemberList');
|
2020-05-02 23:45:29 +00:00
|
|
|
|
2020-09-02 16:43:27 +00:00
|
|
|
Route::get('players', 'UserController@showPlayers')
|
|
|
|
->name('registeredPlayerList');
|
2020-06-26 23:32:33 +00:00
|
|
|
|
2020-09-02 16:43:27 +00:00
|
|
|
Route::post('players/search', 'UserController@showPlayersLike')
|
|
|
|
->name('searchRegisteredPLayerList');
|
2020-06-26 23:32:33 +00:00
|
|
|
|
2020-09-02 16:43:27 +00:00
|
|
|
Route::patch('staff-members/terminate/{user}', 'UserController@terminate')
|
|
|
|
->name('terminateStaffMember');
|
|
|
|
});
|
2020-05-03 04:04:26 +00:00
|
|
|
|
2020-10-21 00:01:41 +00:00
|
|
|
Route::group(['prefix' => 'admin'], function () {
|
2020-09-02 16:43:27 +00:00
|
|
|
Route::get('settings', 'OptionsController@index')
|
|
|
|
->name('showSettings');
|
2020-08-30 22:06:01 +00:00
|
|
|
|
2020-09-02 16:43:27 +00:00
|
|
|
Route::post('settings/save', 'OptionsController@saveSettings')
|
|
|
|
->name('saveSettings');
|
2020-06-26 23:32:33 +00:00
|
|
|
|
2020-09-02 16:43:27 +00:00
|
|
|
Route::post('players/ban/{user}', 'BanController@insert')
|
|
|
|
->name('banUser');
|
2020-06-26 23:32:33 +00:00
|
|
|
|
2020-09-02 16:43:27 +00:00
|
|
|
Route::delete('players/unban/{user}', 'BanController@delete')
|
|
|
|
->name('unbanUser');
|
2020-07-16 20:21:28 +00:00
|
|
|
|
2020-09-02 16:43:27 +00:00
|
|
|
Route::delete('players/delete/{user}', 'UserController@delete')
|
|
|
|
->name('deleteUser');
|
2020-06-26 23:32:33 +00:00
|
|
|
|
2020-09-02 16:43:27 +00:00
|
|
|
Route::patch('players/update/{user}', 'UserController@update')
|
|
|
|
->name('updateUser');
|
2020-06-26 23:32:33 +00:00
|
|
|
|
2020-09-02 16:43:27 +00:00
|
|
|
Route::get('positions', 'VacancyController@index')
|
|
|
|
->name('showPositions');
|
2020-05-07 23:24:56 +00:00
|
|
|
|
2020-09-02 16:43:27 +00:00
|
|
|
Route::post('positions/save', 'VacancyController@store')
|
|
|
|
->name('savePosition');
|
2020-05-07 23:24:56 +00:00
|
|
|
|
2020-09-03 01:26:05 +00:00
|
|
|
Route::get('positions/edit/{vacancy}', 'VacancyController@edit')
|
2020-09-02 16:43:27 +00:00
|
|
|
->name('editPosition');
|
2020-07-11 19:34:26 +00:00
|
|
|
|
2020-09-03 01:26:05 +00:00
|
|
|
Route::patch('positions/update/{vacancy}', 'VacancyController@update')
|
2020-09-02 16:43:27 +00:00
|
|
|
->name('updatePosition');
|
2020-07-11 19:34:26 +00:00
|
|
|
|
2020-09-02 16:43:27 +00:00
|
|
|
Route::patch('positions/availability/{status}/{vacancy}', 'VacancyController@updatePositionAvailability')
|
|
|
|
->name('updatePositionAvailability');
|
2020-05-03 04:04:26 +00:00
|
|
|
|
2020-09-02 16:43:27 +00:00
|
|
|
Route::get('forms/builder', 'FormController@showFormBuilder')
|
|
|
|
->name('showFormBuilder');
|
2020-05-03 04:04:26 +00:00
|
|
|
|
2020-09-02 16:43:27 +00:00
|
|
|
Route::post('forms/save', 'FormController@saveForm')
|
|
|
|
->name('saveForm');
|
2020-05-06 23:36:33 +00:00
|
|
|
|
2020-09-02 16:43:27 +00:00
|
|
|
Route::delete('forms/destroy/{form}', 'FormController@destroy')
|
|
|
|
->name('destroyForm');
|
2020-05-06 22:16:34 +00:00
|
|
|
|
2020-09-02 16:43:27 +00:00
|
|
|
Route::get('forms', 'FormController@index')
|
|
|
|
->name('showForms');
|
2020-07-15 05:48:49 +00:00
|
|
|
|
2020-09-02 16:43:27 +00:00
|
|
|
Route::get('forms/preview/{form}', 'FormController@preview')
|
|
|
|
->name('previewForm');
|
2020-07-15 05:48:49 +00:00
|
|
|
|
2020-09-02 16:43:27 +00:00
|
|
|
Route::get('forms/edit/{form}', 'FormController@edit')
|
|
|
|
->name('editForm');
|
2020-07-15 05:48:49 +00:00
|
|
|
|
2020-09-02 16:43:27 +00:00
|
|
|
Route::patch('forms/update/{form}', 'FormController@update')
|
|
|
|
->name('updateForm');
|
2020-05-29 23:20:39 +00:00
|
|
|
|
2020-09-02 16:43:27 +00:00
|
|
|
Route::get('devtools', 'DevToolsController@index')
|
|
|
|
->name('devTools');
|
2020-05-29 23:20:39 +00:00
|
|
|
|
2020-09-02 16:43:27 +00:00
|
|
|
// we could use route model binding
|
|
|
|
Route::post('devtools/vote-evaluation/force', 'DevToolsController@forceVoteCount')
|
|
|
|
->name('devToolsForceVoteCount');
|
|
|
|
});
|
|
|
|
});
|
2020-04-29 02:20:00 +00:00
|
|
|
});
|