diff --git a/app/Console/Commands/Inspire.php b/app/Console/Commands/Inspire.php deleted file mode 100644 index abb255d..0000000 --- a/app/Console/Commands/Inspire.php +++ /dev/null @@ -1,34 +0,0 @@ -comment(PHP_EOL.Inspiring::quote().PHP_EOL); - } - -} diff --git a/app/Console/Kernel.php b/app/Console/Kernel.php deleted file mode 100644 index 0c088c8..0000000 --- a/app/Console/Kernel.php +++ /dev/null @@ -1,29 +0,0 @@ -command('inspire') - ->hourly(); - } - -} diff --git a/app/Events/Event.php b/app/Events/Event.php deleted file mode 100644 index d59f769..0000000 --- a/app/Events/Event.php +++ /dev/null @@ -1,7 +0,0 @@ -auth = $auth; - $this->registrar = $registrar; - - $this->middleware('guest', ['except' => 'getLogout']); - } - -} diff --git a/app/Http/Controllers/Auth/PasswordController.php b/app/Http/Controllers/Auth/PasswordController.php deleted file mode 100644 index 3106193..0000000 --- a/app/Http/Controllers/Auth/PasswordController.php +++ /dev/null @@ -1,38 +0,0 @@ -auth = $auth; - $this->passwords = $passwords; - - $this->middleware('guest'); - } - -} diff --git a/app/Http/Controllers/Controller.php b/app/Http/Controllers/Controller.php deleted file mode 100644 index 27b3f45..0000000 --- a/app/Http/Controllers/Controller.php +++ /dev/null @@ -1,11 +0,0 @@ -middleware('auth'); - } - - /** - * Show the application dashboard to the user. - * - * @return Response - */ - public function index() - { - return view('home'); - } - -} diff --git a/app/Http/Controllers/WelcomeController.php b/app/Http/Controllers/WelcomeController.php deleted file mode 100644 index 8a5ac6d..0000000 --- a/app/Http/Controllers/WelcomeController.php +++ /dev/null @@ -1,36 +0,0 @@ -middleware('guest'); - } - - /** - * Show the application welcome screen to the user. - * - * @return Response - */ - public function index() - { - return view('welcome'); - } - -} diff --git a/app/Http/Kernel.php b/app/Http/Kernel.php deleted file mode 100644 index 0a2addc..0000000 --- a/app/Http/Kernel.php +++ /dev/null @@ -1,32 +0,0 @@ - 'App\Http\Middleware\Authenticate', - 'auth.basic' => 'Illuminate\Auth\Middleware\AuthenticateWithBasicAuth', - 'guest' => 'App\Http\Middleware\RedirectIfAuthenticated', - ]; - -} diff --git a/app/Http/Middleware/Authenticate.php b/app/Http/Middleware/Authenticate.php deleted file mode 100644 index 72a7613..0000000 --- a/app/Http/Middleware/Authenticate.php +++ /dev/null @@ -1,50 +0,0 @@ -auth = $auth; - } - - /** - * Handle an incoming request. - * - * @param \Illuminate\Http\Request $request - * @param \Closure $next - * @return mixed - */ - public function handle($request, Closure $next) - { - if ($this->auth->guest()) - { - if ($request->ajax()) - { - return response('Unauthorized.', 401); - } - else - { - return redirect()->guest('auth/login'); - } - } - - return $next($request); - } - -} diff --git a/app/Http/Middleware/RedirectIfAuthenticated.php b/app/Http/Middleware/RedirectIfAuthenticated.php deleted file mode 100644 index dd5a867..0000000 --- a/app/Http/Middleware/RedirectIfAuthenticated.php +++ /dev/null @@ -1,44 +0,0 @@ -auth = $auth; - } - - /** - * Handle an incoming request. - * - * @param \Illuminate\Http\Request $request - * @param \Closure $next - * @return mixed - */ - public function handle($request, Closure $next) - { - if ($this->auth->check()) - { - return new RedirectResponse(url('/home')); - } - - return $next($request); - } - -} diff --git a/app/Http/Middleware/VerifyCsrfToken.php b/app/Http/Middleware/VerifyCsrfToken.php deleted file mode 100644 index 750a39b..0000000 --- a/app/Http/Middleware/VerifyCsrfToken.php +++ /dev/null @@ -1,20 +0,0 @@ - 'Auth\AuthController', - 'password' => 'Auth\PasswordController', -]); diff --git a/app/Providers/AppServiceProvider.php b/app/Providers/AppServiceProvider.php deleted file mode 100644 index ff9d6f6..0000000 --- a/app/Providers/AppServiceProvider.php +++ /dev/null @@ -1,34 +0,0 @@ -app->bind( - 'Illuminate\Contracts\Auth\Registrar', - 'App\Services\Registrar' - ); - } - -} diff --git a/app/Providers/BusServiceProvider.php b/app/Providers/BusServiceProvider.php deleted file mode 100644 index f0d9be6..0000000 --- a/app/Providers/BusServiceProvider.php +++ /dev/null @@ -1,34 +0,0 @@ -mapUsing(function($command) - { - return Dispatcher::simpleMapping( - $command, 'App\Commands', 'App\Handlers\Commands' - ); - }); - } - - /** - * Register any application services. - * - * @return void - */ - public function register() - { - // - } - -} diff --git a/app/Providers/ConfigServiceProvider.php b/app/Providers/ConfigServiceProvider.php deleted file mode 100644 index 06e5799..0000000 --- a/app/Providers/ConfigServiceProvider.php +++ /dev/null @@ -1,23 +0,0 @@ - [ - 'EventListener', - ], - ]; - - /** - * Register any other events for your application. - * - * @param \Illuminate\Contracts\Events\Dispatcher $events - * @return void - */ - public function boot(DispatcherContract $events) - { - parent::boot($events); - - // - } - -} diff --git a/app/Providers/RouteServiceProvider.php b/app/Providers/RouteServiceProvider.php deleted file mode 100644 index afa34c8..0000000 --- a/app/Providers/RouteServiceProvider.php +++ /dev/null @@ -1,44 +0,0 @@ -group(['namespace' => $this->namespace], function($router) - { - require app_path('Http/routes.php'); - }); - } - -} diff --git a/app/Services/Registrar.php b/app/Services/Registrar.php deleted file mode 100644 index 1035468..0000000 --- a/app/Services/Registrar.php +++ /dev/null @@ -1,39 +0,0 @@ - 'required|max:255', - 'email' => 'required|email|max:255|unique:users', - 'password' => 'required|confirmed|min:6', - ]); - } - - /** - * Create a new user instance after a valid registration. - * - * @param array $data - * @return User - */ - public function create(array $data) - { - return User::create([ - 'name' => $data['name'], - 'email' => $data['email'], - 'password' => bcrypt($data['password']), - ]); - } - -} diff --git a/app/User.php b/app/User.php deleted file mode 100644 index 2dae847..0000000 --- a/app/User.php +++ /dev/null @@ -1,34 +0,0 @@ - 'Illuminate\Support\Str', 'URL' => 'Illuminate\Support\Facades\URL', 'Validator' => 'Illuminate\Support\Facades\Validator', - 'View' => 'Illuminate\Support\Facades\View', - 'Image' => 'Intervention\Image\Facades\Image', + 'View' => 'Illuminate\Support\Facades\View', ), ); + diff --git a/app/config/database.php b/app/config/database.php index b5a34bc..4d18e36 100644 --- a/app/config/database.php +++ b/app/config/database.php @@ -54,9 +54,9 @@ 'mysql' => array( 'driver' => 'mysql', - 'host' => 'alonica.net', + 'host' => 'localhost', 'database' => 'modules', - 'username' => 'banana', + 'username' => 'root', 'password' => 'P455w0Rd!@£$%^&*', 'charset' => 'utf8', 'collation' => 'utf8_unicode_ci', diff --git a/app/controllers/.gitkeep b/app/controllers/.gitkeep deleted file mode 100755 index e69de29..0000000 diff --git a/app/controllers/AccountController.php b/app/controllers/AccountController.php index e87012e..ca319e8 100644 --- a/app/controllers/AccountController.php +++ b/app/controllers/AccountController.php @@ -319,6 +319,27 @@ public function removeLecturer(){ )); } + public function backupDB(){ + + if(Auth::user()->rank < 3){ + return "Unauthorized Access."; + } + + $DBUSER="root"; + $DBPASSWD="P455w0Rd!@£$%^&*"; + $DATABASE="modules"; + + $filename = "backup-" . date("d-m-Y") . ".sql.gz"; + $mime = "application/x-gzip"; + + header( "Content-Type: " . $mime ); + header( 'Content-Disposition: attachment; filename="' . $filename . '"' ); + + $cmd = "mysqldump -u $DBUSER --password=$DBPASSWD $DATABASE | gzip --best"; + + passthru( $cmd ); + } + /** * Function that receives a CSV file, and creates * users from it. @@ -422,4 +443,4 @@ public function uploadCSV(){ )); } } -} \ No newline at end of file +} diff --git a/app/controllers/DepartmentController.php b/app/controllers/DepartmentController.php index d082016..3e584d0 100644 --- a/app/controllers/DepartmentController.php +++ b/app/controllers/DepartmentController.php @@ -10,7 +10,7 @@ public function createDepartment() { 'shortname' => 'required', 'head' => 'required', 'description' => 'required', - 'facultyId' => 'required' + 'facultyId' => 'required|numeric' )); if($validator->fails()) { @@ -53,7 +53,7 @@ public function updateDepartment() { 'shortname' => 'required', 'head' => 'required', 'description' => 'required', - 'facultyId' => 'required' + 'facultyId' => 'required|numeric' )); if($validator->fails()) { @@ -87,4 +87,4 @@ public function updateDepartment() { } } -?> \ No newline at end of file +?> diff --git a/app/controllers/ElectiveController.php b/app/controllers/ElectiveController.php index ffd8197..ba71b09 100644 --- a/app/controllers/ElectiveController.php +++ b/app/controllers/ElectiveController.php @@ -357,18 +357,33 @@ public function loadClass() { } public function updateClass() { + $validator = Validator::make(Input::all(), + array( + 'classId' => 'required', + 'limit' => 'required|numeric' + )); - // Get the Class to update. - $class = Classes::where('classId', Input::get('classId'))->first(); + if($validator->fails()) { + + // If not inform user of errors. + return Response::json(array( + 'success' => false, + 'errors' => $validator->messages() + )); + } else { - // Update the class. - $class->classlimit = Input::get('limit'); - $class->save(); + // Get the Class to update. + $class = Classes::where('classId', Input::get('classId'))->first(); - return Response::json(array( - 'success' => true, - 'space' => ($class->classlimit - $class->classcurrent) - )); + // Update the class. + $class->classlimit = Input::get('limit'); + $class->save(); + + return Response::json(array( + 'success' => true, + 'space' => ($class->classlimit - $class->classcurrent) + )); + } } public function removeStudent() { @@ -438,42 +453,50 @@ public function removeStudent() { } - - // RIC -> ERRORS INBOUND :D - public function postElectiveNew(){ $inputData = Input::get('elecData'); parse_str($inputData, $formFields); - $elecData = array( - 'classlecturer' => $formFields['clect'], - 'classmodule' => $formFields['cmod'], - 'classlimit' => $formFields['climit'], - //'classtimes' => $formFields[''], + $moduleData = array( + 'classlecturer' => $formFields['classlecturer'], + 'classmodule' => $formFields['classmodule'], + 'classlimit' => $formFields['classlimit'], ); Validator::extend('ranked', function($attribute, $value, $parameters) { + // This is the correct way to do this. $coord = User::where('name', $value)->first(); - if($coord->rank <= 1){ + if($coord && $coord->rank < 1){ return false; } - return false; + return true; }); + Validator::extend('indep', function($attribute, $value, $parameters) + { + // This is the correct way to do this. + $mod = Modules::find($value); + if($mod && $mod->departmentid !== Auth::user()->department){ + return false; + } + + return true; + }); + $rules = array( - 'classlecturer' => 'required|max:50|exists:users,name|ranked', - 'classmodule' => 'required|exists:modules,mshorttitle', - 'classlimit' => 'required|min:10|max:30', - //'classtimes' => 'required|', + 'classmodule' => 'required|exists:modules,mid|indep', + 'classlecturer' => 'required|exists:users,name|ranked', + 'classlimit' => 'required|integer|between:5,30', ); - + $messages = [ 'ranked' => "This user can't coordinate this class.", + 'indep' => "This module is not in your department.", ]; - $validator = Validator::make($elecData,$rules,$messages); + $validator = Validator::make($moduleData,$rules,$messages); if($validator->fails()){ return Response::json(array( @@ -481,13 +504,13 @@ public function postElectiveNew(){ 'errors' => $validator->getMessageBag()->toArray() )); } else { - - if(Classes::create($elecData)){ - Session::flash('global', 'You have created the elective "'. $elecData['classmodule'].'".'); + $moduleData['classlecturer'] = User::where('name', $moduleData['classlecturer'])->first()->id; + if(Classes::create($moduleData)){ + Session::flash('global', 'You have created an elective.'); //return success message return Response::json(array( 'success' => true, - 'mName' => $elecData['classmodule'] + 'mName' => Modules::find($moduleData['classmodule'])->mshorttitle )); } } @@ -497,36 +520,45 @@ public function postElectiveChange(){ $inputData = Input::get('elecData'); parse_str($inputData, $formFields); - $elecData = array( - 'mfulltitle' => $formFields['mname'], - //add the rest - ); + $moduleData = array( + 'classlecturer' => $formFields['classlecturer'], + 'classmodule' => $formFields['classmodule'], + 'classlimit' => $formFields['classlimit'], + ); Validator::extend('ranked', function($attribute, $value, $parameters) { + // This is the correct way to do this. $coord = User::where('name', $value)->first(); - if($coord->rank <= 1){ - return true; - } + if($coord && $coord->rank < 1){ + return false; + } - return false; + return true; }); + Validator::extend('indep', function($attribute, $value, $parameters) + { + // This is the correct way to do this. + $mod = Modules::find($value); + if($mod && $mod->departmentid !== Auth::user()->department){ + return false; + } + + return true; + }); + + $rules = array( - 'mfulltitle' => 'required|max:50|unique:modules,mfulltitle,'.$formFields['mcode'].',mcode', - 'mshorttitle' => 'required|max:50|unique:modules,mshorttitle,'.$formFields['mcode'].',mcode', - 'mdescription' => 'required|min:30', - 'mcode' => 'required|min:7|max:8|alpha_num|unique:modules,mcode,'.$formFields['mcode'].',mcode', - 'mfieldofstudy' => 'required|max:100', - 'mcoordinator' => 'required|exists:users,name|ranked', - 'mlevel' => 'required|in:Fundamental,Intermediate,Advanced,Expert', - 'mcredits' => 'required|integer|between:5,25', - 'mid' => 'required|exists:modules,mid', - 'departmentid' => 'required', + 'classmodule' => 'required|exists:modules,mid|indep', + 'classlecturer' => 'required|exists:users,name|ranked', + 'classlimit' => 'required|integer|between:5,30', ); $messages = [ 'ranked' => "This user can't coordinate this class.", + 'indep' => "This module is not in your department.", + ]; $validator = Validator::make($moduleData,$rules,$messages); @@ -539,29 +571,25 @@ public function postElectiveChange(){ )); } else { - $mod = Modules::where('mid', $moduleData['mid'])->first(); - - $mod->mfulltitle = $moduleData['mfulltitle']; - $mod->mshorttitle = $moduleData['mshorttitle']; - $mod->mdescription = $moduleData['mdescription']; - $mod->mcode = $moduleData['mcode']; - $mod->mfieldofstudy = $moduleData['mfieldofstudy']; - $mod->mcoordinator = $moduleData['mcoordinator']; - $mod->mlevel = $moduleData['mlevel']; - $mod->mcredits = $moduleData['mcredits']; - $mod->departmentid = $moduleData['departmentid']; + $elec = Classes::where('classid', $formFields['classid'])->first(); + + $elec->classmodule = $moduleData['classmodule']; + $elec->classlecturer = User::where('name', $moduleData['classlecturer'])->first()->id; + $elec->classlimit = $moduleData['classlimit']; - if($mod->save()){ - Session::flash('global', 'You have edited the module "'. $moduleData['mfulltitle'].'".'); + if($elec->save()){ + Session::flash('global', 'You have edited a module.'); //return success message return Response::json(array( 'success' => true, - 'mName' => $moduleData['mfulltitle'] + 'mName' => Modules::find($moduleData['classmodule'])->mshorttitle )); } } } + + public function getElectives(){ if(Auth::check()){ if (Auth::user()->rank >= 2) @@ -603,7 +631,7 @@ function printClassList($classId) { fputcsv($f, $line, $delimiter); } } - } - + } + } -?> \ No newline at end of file +?> diff --git a/app/controllers/ModuleController.php b/app/controllers/ModuleController.php index 5d2981c..2ffeb9a 100644 --- a/app/controllers/ModuleController.php +++ b/app/controllers/ModuleController.php @@ -22,7 +22,7 @@ public function postModuleNew(){ { // This is the correct way to do this. $coord = User::where('name', $value)->first(); - if($coord->rank < 1){ + if(!$coord && $coord->rank < 1){ return false; } @@ -85,7 +85,7 @@ public function postModuleChange(){ Validator::extend('ranked', function($attribute, $value, $parameters) { $coord = User::where('name', $value)->first(); - if($coord->rank < 1){ + if($coord && $coord->rank < 1){ return false; } @@ -155,74 +155,6 @@ public function getModules(){ } } - public function getImage($modCode){ - - $cacheKey = md5($modCode); - - $image = Cache::remember($cacheKey, 3600, function() use ($modCode) { - // start making our image (this assumes your original image is within "app/storage/img") - $colors = array('#00c6ff', '#f39c12', '#ff0000', '#49E035'); - $color = $colors[array_rand($colors)]; - $img = Image::canvas(384, 384, $color); - $img->insert(public_path('images/layout.png'), 'top-left', 5, 0); - - $mod = Modules::where('mcode', $modCode); - - if($mod->count()){ - $mod = $mod->first(); - - $img->text($mod->department->name(), 192, 250, function($font) { - $font->file(public_path('fonts/segoeui.ttf')); - $font->size(30); - $font->color('#fff'); - $font->align('center'); - }); - - $img->text($mod->mshorttitle, 192, 320, function($font) { - $font->file(public_path('fonts/segoeui.ttf')); - $font->size(25); - $font->color('#fff'); - $font->align('center'); - }); - - } elseif ($modCode == 'newMod') { - $img->text('Create new Module!', 192, 300, function($font) { - $font->file(public_path('fonts/segoeui.ttf')); - $font->size(30); - $font->color('#fff'); - $font->align('center'); - }); - } elseif ($modCode == 'newElec') { - $img->text('Create new Elective!', 192, 300, function($font) { - $font->file(public_path('fonts/segoeui.ttf')); - $font->size(30); - $font->color('#fff'); - $font->align('center'); - }); - } else { - $img->text('Error: Module not Found!', 192, 300, function($font) { - $font->file(public_path('fonts/segoeui.ttf')); - $font->size(30); - $font->color('#fff'); - $font->align('center'); - }); - } - - // return the image as a JPG - return $img->encode('jpg'); - }); - - // return the image - $headers = [ - 'Content-Type' => 'image/jpeg', - 'Content-Disposition' => 'inline', - 'Cache-Control' => 'must-revalidate, post-check=0, pre-check=0', - 'Pragma' => 'public', - 'Etag' => md5($image), - ]; - - return Response::make($image, 200, $headers)->setTtl((60 * 30)); - } public function postElectiveNew(){ @@ -230,7 +162,7 @@ public function postElectiveNew(){ $inputData = Input::get('elecData'); parse_str($inputData, $formFields); $moduleData = array( - 'classlecturer' => User::where('name', $formFields['classlecturer'])->first()->id, + 'classlecturer' => $formFields['classlecturer'], 'classmodule' => $formFields['classmodule'], 'classlimit' => $formFields['classlimit'], ); @@ -238,22 +170,34 @@ public function postElectiveNew(){ Validator::extend('ranked', function($attribute, $value, $parameters) { // This is the correct way to do this. - $coord = User::find($value); - if($coord->rank < 1){ + $coord = User::where('name', $value)->first(); + if($coord && $coord->rank < 1){ return false; } return true; }); + Validator::extend('indep', function($attribute, $value, $parameters) + { + // This is the correct way to do this. + $mod = Modules::find($value); + if($mod && $mod->departmentid !== Auth::user()->department){ + return false; + } + + return true; + }); + $rules = array( - 'classmodule' => 'required|exists:modules,mid', - 'classlecturer' => 'required|exists:users,id|ranked', + 'classmodule' => 'required|exists:modules,mid|indep', + 'classlecturer' => 'required|exists:users,name|ranked', 'classlimit' => 'required|integer|between:5,30', ); $messages = [ 'ranked' => "This user can't coordinate this class.", + 'indep' => "This module is not in your department.", ]; $validator = Validator::make($moduleData,$rules,$messages); @@ -290,21 +234,35 @@ public function postElectiveChange(){ { // This is the correct way to do this. $coord = User::find($value); - if($coord->rank < 1){ + if($coord && $coord->rank < 1){ return false; } return true; }); + Validator::extend('indep', function($attribute, $value, $parameters) + { + // This is the correct way to do this. + $mod = Modules::find($value); + if($mod && $mod->departmentid !== Auth::user()->department){ + return false; + } + + return true; + }); + + $rules = array( - 'classmodule' => 'required|exists:modules,mid', + 'classmodule' => 'required|exists:modules,mid|indep', 'classlecturer' => 'required|exists:users,id|ranked', 'classlimit' => 'required|integer|between:5,30', ); $messages = [ 'ranked' => "This user can't coordinate this class.", + 'indep' => "This module is not in your department.", + ]; $validator = Validator::make($moduleData,$rules,$messages); @@ -335,4 +293,4 @@ public function postElectiveChange(){ } } -?> \ No newline at end of file +?> diff --git a/app/database/.gitignore b/app/database/.gitignore deleted file mode 100755 index 9b1dffd..0000000 --- a/app/database/.gitignore +++ /dev/null @@ -1 +0,0 @@ -*.sqlite diff --git a/app/lang/en/reminders.php b/app/lang/en/reminders.php index e2e24e5..e42148e 100755 --- a/app/lang/en/reminders.php +++ b/app/lang/en/reminders.php @@ -21,6 +21,4 @@ "sent" => "Password reminder sent!", - "reset" => "Password has been reset!", - ); diff --git a/app/lang/en/validation.php b/app/lang/en/validation.php index 648516e..b03b926 100755 --- a/app/lang/en/validation.php +++ b/app/lang/en/validation.php @@ -27,7 +27,6 @@ "string" => "The :attribute must be between :min and :max characters.", "array" => "The :attribute must have between :min and :max items.", ), - "boolean" => "The :attribute field must be true or false.", "confirmed" => "The :attribute confirmation does not match.", "date" => "The :attribute is not a valid date.", "date_format" => "The :attribute does not match the format :format.", @@ -71,7 +70,6 @@ ), "unique" => "The :attribute has already been taken.", "url" => "The :attribute format is invalid.", - "timezone" => "The :attribute must be a valid zone.", /* |-------------------------------------------------------------------------- diff --git a/app/routes.php b/app/routes.php index b37873f..c7ef38b 100755 --- a/app/routes.php +++ b/app/routes.php @@ -51,7 +51,7 @@ */ Route::post('/elective-new', array( 'as' => 'elective-new-post', - 'uses' => 'ModuleController@postElectiveNew' + 'uses' => 'ElectiveController@postElectiveNew' )); /* @@ -60,17 +60,15 @@ Route::post('/elective-change', array( 'as' => 'elective-change-post', - 'uses' => 'ModuleController@postElectiveChange' + 'uses' => 'ElectiveController@postElectiveChange' )); - - }); - + /* | Register to elective. */ - + Route::post('/account/register-elective', array( 'as' => 'register-elective', 'uses' => 'ElectiveController@postRegisterElective' @@ -79,12 +77,17 @@ /* | Unregister to elective. */ - + Route::post('/account/unregister-elective', array( 'as' => 'unregister-elective', 'uses' => 'ElectiveController@postUnregisterElective' )); + Route::any('/db/backup', array( + 'as' => 'database-backup', + 'uses' => 'AccountController@backupDB' + )); + /* | Save Timetable */ diff --git a/app/storage/img/layout.png b/app/storage/img/layout.png deleted file mode 100755 index bec5159..0000000 Binary files a/app/storage/img/layout.png and /dev/null differ diff --git a/app/tests/HODViewTest.php b/app/tests/HODViewTest.php index 8c8a642..3ad293e 100644 --- a/app/tests/HODViewTest.php +++ b/app/tests/HODViewTest.php @@ -4,7 +4,7 @@ class HODViewTest extends TestCase { // Define user login credentials. private $username = 'hod'; - private $password = 'abc123'; + private $password = 'password'; public function testController() { // Log in so we have an authenticated user. @@ -12,101 +12,176 @@ public function testController() { $this->assertRedirectedTo('/'); // Create a module to test with. - $module = $this->createModule(); + $d = array('mname' => 'name123', + 'mshorttitle' => 'short123', + 'mdescription' => str_random(60), + 'mcode' => 'abc1234', + 'mfieldofstudy' => 'abc123', + 'mcoordinator' => 'lecturer', + 'mlevel' => 'Fundamental', + 'mcredits' => 5, + 'melective' => true); + $module = $this->createModule($d, true); + + // Try to create a module with incorrect syntax. + $d = array('mname' => 'name123', + 'mshorttitle' => 'short123', + 'mdescription' => str_random(60), + 'mcode' => 'abc1234', + 'mfieldofstudy' => 'abc123', + 'mcoordinator' => 'lecturer', + 'mlevel' => 'Fundamental', + 'mcredits' => 'five', + 'melective' => true); + $this->createModule($d, false); + // Update the module. - $module = $this->updateModule($module->mid); + $d = array('mname' => 'name12345', + 'mshorttitle' => 'short123', + 'mdescription' => str_random(60), + 'mcode' => 'abc1234', + 'mfieldofstudy' => 'abc123', + 'mcoordinator' => 'lecturer', + 'mlevel' => 'Fundamental', + 'mcredits' => 5, + 'melective' => true, + 'mid' => $module->mid); + $module = $this->updateModule($module->mid, $d, true); + + // Try to update the module with incorrect syntax. + $d = array('mname' => 'name12345', + 'mshorttitle' => 'short123', + 'mdescription' => str_random(60), + 'mcode' => 'abc1234', + 'mfieldofstudy' => 'abc123', + 'mcoordinator' => 'lecturer', + 'mlevel' => 'Fundamental', + 'mcredits' => 'five', + 'melective' => true, + 'mid' => $module->mid); + $this->updateModule($module->mid, $d, false); // Now create an elective of that module. - //$elective = $this->createElective($module->mid); + $d = array('classlecturer' => 'lecturer', + 'classmodule' => $module->mid, + 'classlimit' => 10); + $elective = $this->createElective($module->mid, $d, true); + + // Now try creating an elective with incorrect syntax. + $d = array('classlecturer' => 'lecturer', + 'classmodule' => $module->mid, + 'classlimit' => 'ten'); + $this->createElective($module->mid, $d, false); + + // Add a request to the module. + $module->mrequests = '["20"]'; + $module->save(); + + // Check if hod can see request. + $crawler = $this->client->request('GET', '/'); + $this->assertTrue($this->client->getResponse()->isOk()); + $this->assertCount(1, $crawler->filter('p:contains("1 student has requested a new class.")')); // Now update an elective. - //$elective = $this->updateElective($elective->classid); + $d = array('classlecturer' => 'lecturer', + 'classmodule' => $module->mid, + 'classlimit' => 10, + 'classid' => $elective->classid); + $elective = $this->updateElective($elective->classid, $d, true); + + // Try to update elective with bad syntax. + $d = array('classlecturer' => 'lecturer', + 'classmodule' => $module->mid, + 'classlimit' => 'ten', + 'classid' => $elective->classid); + $this->updateElective($elective->classid, $d, false); // Create test lecturer. - $lecturer = $this->createLecturer(); + $lecturer = $this->createLecturer(true); + + // Try to create test lecturer with bad syntax. + $this->createLecturer(false); // Remove the lecturer. $this->removeLecturer($lecturer->id); // Delete dummy data. + $elective->delete(); $module->delete(); - //$elective->delete(); } /** * Function that creates a module */ - protected function createModule() { + protected function createModule($d, $expected) { $data = ''; - $d = array('mname' => 'name123', - 'mshorttitle' => 'short123', - 'mdescription' => str_random(60), - 'mcode' => 'abc1234', - 'mfieldofstudy' => 'abc123', - 'mcoordinator' => 'lecturer', - 'mlevel' => 'Fundamental', - 'mcredits' => 5, - 'melective' => true); foreach($d as $key => $value) { $data = $data.$key.'='.$value.'&'; } $response = $this->call('POST', '/module-new', ['modData' => $data]); $json = json_decode($response->getContent()); - $this->assertEquals(true, $json->success); + if($expected) { + $this->assertEquals(true, $json->success); - // Return the module we just created. - return Modules::where('mfulltitle', $json->mName)->first(); + // Return the module we just created. + return Modules::where('mfulltitle', $json->mName)->first(); + } else { + $this->assertEquals(true, $json->fail); + } } /** * Function that updates a module */ - protected function updateModule($mid) { + protected function updateModule($mid, $d, $expected) { $data = ''; - $d = array('mname' => 'name12345', - 'mshorttitle' => 'short123', - 'mdescription' => str_random(60), - 'mcode' => 'abc1234', - 'mfieldofstudy' => 'abc123', - 'mcoordinator' => 'lecturer', - 'mlevel' => 'Fundamental', - 'mcredits' => 5, - 'melective' => true, - 'mid' => $mid); foreach($d as $key => $value) { $data = $data.$key.'='.$value.'&'; } $response = $this->call('POST', '/module-change', ['modData' => $data]); $json = json_decode($response->getContent()); - $this->assertEquals(true, $json->success); + if($expected) { + $this->assertEquals(true, $json->success); - // Get the module we just updated. - $m = Modules::where('mid', $mid)->first(); + // Get the module we just updated. + $m = Modules::where('mid', $mid)->first(); - // Verify that the change was made. - $this->assertEquals('name12345', $m->mfulltitle); + // Verify that the change was made. + $this->assertEquals('name12345', $m->mfulltitle); - // Now return the module. - return $m; + // Now return the module. + return $m; + } else { + $this->assertEquals(true, $json->fail); + } } /** * Function that creates a lecturer. */ - protected function createLecturer() { - $response = $this->call('POST', '/account/create-lecturer', ['name' => 'phpunitLecturer', + protected function createLecturer($expected) { + if ($expected) { + $response = $this->call('POST', '/account/create-lecturer', ['name' => 'phpunitLecturer', + 'username' => 'phpunit123', + 'email' => 'phpunit@email.com']); + + $json = json_decode($response->getContent()); + $this->assertEquals($expected, $json->success); + + // Return the lecturer we just created. + return User::find($json->id); + } else { + $response = $this->call('POST', '/account/create-lecturer', ['name' => 'phpunitLecturer', 'username' => 'phpunit123', - 'email' => 'phpunit@email.com']); + 'email' => 'phpunitemail.com']); - $json = json_decode($response->getContent()); - $this->assertEquals(true, $json->success); - - // Return the lecturer we just created. - return User::find($json->id); + $json = json_decode($response->getContent()); + $this->assertEquals($expected, $json->success); + } } /** @@ -122,21 +197,47 @@ protected function removeLecturer($id) { /** * Function that creates an elective for a specified module. */ - protected function createElective($mid) { + protected function createElective($mid, $d, $expected) { $data = ''; - $d = array('classlecturer' => 'lecturer', - 'classmodule' => $mid, - 'classlimit' => 10); foreach($d as $key => $value) { $data = $data.$key.'='.$value.'&'; } // TODO: Once elective creation is resolved change path below. - $response = $this->call('POST', '/module-new', ['elecData' => $data]); + $response = $this->call('POST', '/elective-new', ['elecData' => $data]); $json = json_decode($response->getContent()); - $this->assertEquals(true, $json->success); + if($expected) { + $this->assertEquals(true, $json->success); - // Return the Class we just created. - return Classes::where('classmodule', $mid)->first(); + // Return the Class we just created. + return Classes::where('classmodule', $mid)->first(); + } else { + $this->assertEquals(true, $json->fail); + } + } + + /** + * Function that updates a module + */ + protected function updateElective($id, $d, $expected) { + $data = ''; + foreach($d as $key => $value) { + $data = $data.$key.'='.$value.'&'; + } + $response = $this->call('POST', '/elective-change', ['elecData' => $data]); + + $json = json_decode($response->getContent()); + if($expected) { + $this->assertEquals(true, $json->success); + + // Get the module we just updated. + $c = Classes::where('classid', $id)->first(); + + // Now return the class. + return $c; + } else { + $this->assertEquals(true, $json->fail); + } } } + diff --git a/app/tests/LecturerViewTest.php b/app/tests/LecturerViewTest.php index 75b48d6..c9810e3 100644 --- a/app/tests/LecturerViewTest.php +++ b/app/tests/LecturerViewTest.php @@ -4,7 +4,7 @@ class LecturerViewTest extends TestCase { // Define user login credentials. private $username = 'lecturer'; - private $password = 'abc123'; + private $password = 'password'; public function testController() { // Log in so we have an authenticated user. @@ -37,7 +37,10 @@ public function testController() { $this->loadClass($class->classid); // Update class. - $this->updateClass($class->classid); + $this->updateClass($class->classid, true, 5); + + // Update class with incorrect values. + $this->updateClass($class->classid, false, 'five'); // Remove student from class. $this->removeStudent($class->classid, $student->id); @@ -61,11 +64,13 @@ protected function loadClass($id, $expected = 1) { /** * Function that updates a class. */ - protected function updateClass($id) { - $response = $this->call('POST', '/account/update-class', ['classId' => $id, 'limit' => 5]); + protected function updateClass($id, $expected, $updateVal) { + $response = $this->call('POST', '/account/update-class', ['classId' => $id, 'limit' => $updateVal]); $json = json_decode($response->getContent()); - $this->assertEquals(true, $json->success); - $this->assertEquals(4, $json->space); + $this->assertEquals($expected, $json->success); + if($expected) { + $this->assertEquals(4, $json->space); + } } diff --git a/app/tests/SignInTest.php b/app/tests/SignInTest.php index cf25dbb..bf99fab 100644 --- a/app/tests/SignInTest.php +++ b/app/tests/SignInTest.php @@ -3,16 +3,12 @@ class SignInTest extends TestCase { // Define user login credentials. - private $username = 'R00103567'; - private $password = 'fr1ck0ff'; - - // Define crawler. - private $crawler; + private $username = 'student'; + private $password = 'password'; /** * Test if the signIn page works correctly. */ - public function testSignInPage() - { + public function testSignInPage() { // Load the page and check it loads correctly. $this->client->request('GET', '/account/signin'); $this->assertTrue($this->client->getResponse()->isOk()); @@ -21,11 +17,17 @@ public function testSignInPage() /** * Test if the signIn form works correctly. */ - public function testSignInForm() - { + public function testSignInForm() { $response = $this->action('POST', 'AccountController@postSignIn', ['username' => $this->username, 'password' => $this->password]); $this->assertRedirectedTo('/'); } + /** + * Test if the sign in form fails with incorrect credentials. + */ + public function testFailSignInForm() { + $response = $this->action('POST', 'AccountController@postSignIn', ['username' => $this->username, 'password' => 'badpassword']); + $this->assertRedirectedTo('/account/signin'); + } } diff --git a/app/tests/StudentViewTest.php b/app/tests/StudentViewTest.php index b81d816..053ae44 100644 --- a/app/tests/StudentViewTest.php +++ b/app/tests/StudentViewTest.php @@ -1,10 +1,10 @@ createDummyClass($elective->mid); // Try registering to elective. - $this->register($elective->mid); + $this->register($elective->mid, true); + + // Now try registering to the same elective again. + $this->register($elective->mid, false); + + // Check if registered class shows in users profile. + $crawler = $this->client->request('GET', '/'); + $this->assertTrue($this->client->getResponse()->isOk()); + $this->assertCount(1, $crawler->filter('h3:contains("'. $elective->mshorttitle .'")')); + + // Load timetable for class. + $crawler = $this->client->request('GET', '/timetables/'.$class->classid); + $this->assertTrue($this->client->getResponse()->isOk()); // Now unregister from elective. - $this->unregister($elective->mid); + $this->unregister($elective->mid, true); + + // Try to unregister from the same elective. + $this->unregister($elective->mid, false); // Now request a new class. - $this->request($elective->mid); + $this->request($elective->mid, true); + + // Request again. + $this->request($elective->mid, false); // Delete dummy data. $class->delete(); @@ -34,28 +52,28 @@ public function testController() { /** * Function that registers user to elective. */ - protected function register($id) { + protected function register($id, $expected) { $response = $this->call('POST', '/account/register-elective', ['electiveId' => $id]); $json = json_decode($response->getContent()); - $this->assertEquals(true, $json->success); + $this->assertEquals($expected, $json->success); } /** * Function that unregisters user to elective. */ - protected function unregister($id) { + protected function unregister($id, $expected) { $response = $this->call('POST', '/account/unregister-elective', ['electiveId' => $id]); $json = json_decode($response->getContent()); - $this->assertEquals(true, $json->success); + $this->assertEquals($expected, $json->success); } /** * Function that requests a new class for elective. */ - protected function request($id) { + protected function request($id, $expected) { $response = $this->call('POST', '/account/request-elective', ['electiveId' => $id]); $json = json_decode($response->getContent()); - $this->assertEquals(true, $json->success); + $this->assertEquals($expected, $json->success); } /** @@ -81,7 +99,8 @@ protected function createDummyElective() { protected function createDummyClass($id) { return Classes::create(array( 'classlecturer' => 1, - 'classmodule' => $id, - 'classlimit' => 25)); + 'classmodule' => $id, + 'classlimit' => 25)); } } + diff --git a/app/tests/TechnicianViewTest.php b/app/tests/TechnicianViewTest.php index b366193..9e7e96d 100644 --- a/app/tests/TechnicianViewTest.php +++ b/app/tests/TechnicianViewTest.php @@ -4,7 +4,7 @@ class TechnicianViewTest extends TestCase { // Define user login credentials. private $username = 'technician'; - private $password = 'abc123'; + private $password = 'password'; public function testController() { // Log in so we have an authenticated user. @@ -12,32 +12,106 @@ public function testController() { $this->assertRedirectedTo('/'); // Create a module to test with. - $module = $this->createModule(); + $d = array('mname' => 'name123', + 'mshorttitle' => 'short123', + 'mdescription' => str_random(60), + 'mcode' => 'abc1234', + 'mfieldofstudy' => 'abc123', + 'mcoordinator' => 'lecturer', + 'mlevel' => 'Fundamental', + 'mcredits' => 5, + 'melective' => true); + $module = $this->createModule($d, true); + + // Try to create a module with incorrect syntax. + $d = array('mname' => 'name123', + 'mshorttitle' => 'short123', + 'mdescription' => str_random(60), + 'mcode' => 'abc1234', + 'mfieldofstudy' => 'abc123', + 'mcoordinator' => 'lecturer', + 'mlevel' => 'Fundamental', + 'mcredits' => 'five', + 'melective' => true); + $this->createModule($d, false); + // Update the module. - $module = $this->updateModule($module->mid); + $d = array('mname' => 'name12345', + 'mshorttitle' => 'short123', + 'mdescription' => str_random(60), + 'mcode' => 'abc1234', + 'mfieldofstudy' => 'abc123', + 'mcoordinator' => 'lecturer', + 'mlevel' => 'Fundamental', + 'mcredits' => 5, + 'melective' => true, + 'mid' => $module->mid); + $module = $this->updateModule($module->mid, $d, true); + + // Try to update the module with incorrect syntax. + $d = array('mname' => 'name12345', + 'mshorttitle' => 'short123', + 'mdescription' => str_random(60), + 'mcode' => 'abc1234', + 'mfieldofstudy' => 'abc123', + 'mcoordinator' => 'lecturer', + 'mlevel' => 'Fundamental', + 'mcredits' => 'five', + 'melective' => true, + 'mid' => $module->mid); + $this->updateModule($module->mid, $d, false); // Now create an elective of that module. - //$elective = $this->createElective($module->mid); + $d = array('classlecturer' => 'lecturer', + 'classmodule' => $module->mid, + 'classlimit' => 10); + $elective = $this->createElective($module->mid, $d, true); + + // Now try creating an elective with incorrect syntax. + $d = array('classlecturer' => 'lecturer', + 'classmodule' => $module->mid, + 'classlimit' => 'ten'); + $this->createElective($module->mid, $d, false); // Now update an elective. - //$elective = $this->updateElective($elective->classid); + $d = array('classlecturer' => 'lecturer', + 'classmodule' => $module->mid, + 'classlimit' => 10, + 'classid' => $elective->classid); + $elective = $this->updateElective($elective->classid, $d, true); + + // Try to update elective with bad syntax. + $d = array('classlecturer' => 'lecturer', + 'classmodule' => $module->mid, + 'classlimit' => 'ten', + 'classid' => $elective->classid); + $this->updateElective($elective->classid, $d, false); // Create test faculty. - $faculty = $this->createFaculty(); + $faculty = $this->createFaculty(true); + + // Create faculty with bad syntax. + $this->createFaculty(false); // Update the faculty. $faculty = $this->updateFaculty($faculty->facultyid); // Create test department. - $department = $this->createDepartment(); + $department = $this->createDepartment(true); + + // Try creating test department with incorrect syntax. + $this->createDepartment(false); // Update the department. - $department = $this->updateDepartment($department->departmentid); + $department = $this->updateDepartment($department->departmentid, true); + + // Try updating department with incorrect syntax. + $this->updateDepartment($department->departmentid, false); // Delete dummy data. + $elective->delete(); $module->delete(); - //$elective->delete(); $faculty->delete(); $department->delete(); @@ -46,60 +120,49 @@ public function testController() { /** * Function that creates a module */ - protected function createModule() { + protected function createModule($d, $expected) { $data = ''; - $d = array('mname' => 'name123', - 'mshorttitle' => 'short123', - 'mdescription' => str_random(60), - 'mcode' => 'abc1234', - 'mfieldofstudy' => 'abc123', - 'mcoordinator' => 'lecturer', - 'mlevel' => 'Fundamental', - 'mcredits' => 5, - 'melective' => true); foreach($d as $key => $value) { $data = $data.$key.'='.$value.'&'; } $response = $this->call('POST', '/module-new', ['modData' => $data]); $json = json_decode($response->getContent()); - $this->assertEquals(true, $json->success); + if($expected) { + $this->assertEquals(true, $json->success); - // Return the module we just created. - return Modules::where('mfulltitle', $json->mName)->first(); + // Return the module we just created. + return Modules::where('mfulltitle', $json->mName)->first(); + } else { + $this->assertEquals(true, $json->fail); + } } /** * Function that updates a module */ - protected function updateModule($mid) { + protected function updateModule($mid, $d, $expected) { $data = ''; - $d = array('mname' => 'name12345', - 'mshorttitle' => 'short123', - 'mdescription' => str_random(60), - 'mcode' => 'abc1234', - 'mfieldofstudy' => 'abc123', - 'mcoordinator' => 'lecturer', - 'mlevel' => 'Fundamental', - 'mcredits' => 5, - 'melective' => true, - 'mid' => $mid); foreach($d as $key => $value) { $data = $data.$key.'='.$value.'&'; } $response = $this->call('POST', '/module-change', ['modData' => $data]); $json = json_decode($response->getContent()); - $this->assertEquals(true, $json->success); + if($expected) { + $this->assertEquals(true, $json->success); - // Get the module we just updated. - $m = Modules::where('mid', $mid)->first(); + // Get the module we just updated. + $m = Modules::where('mid', $mid)->first(); - // Verify that the change was made. - $this->assertEquals('name12345', $m->mfulltitle); + // Verify that the change was made. + $this->assertEquals('name12345', $m->mfulltitle); - // Now return the module. - return $m; + // Now return the module. + return $m; + } else { + $this->assertEquals(true, $json->fail); + } } /** @@ -139,59 +202,108 @@ protected function updateFaculty($id) { /** * Function that creates a Department. */ - protected function createDepartment() { - $response = $this->call('POST', '/account/create-department', ['name' => 'phpunitDepartment', - 'shortname' => 'phpunitDepartment', - 'head' => 'headofdepartment', - 'description' => str_random(60), - 'facultyId' => 1]); + protected function createDepartment($expected) { + if($expected) { + $response = $this->call('POST', '/account/create-department', ['name' => 'phpunitDepartment', + 'shortname' => 'phpunitDepartment', + 'head' => 'headofdepartment', + 'description' => str_random(60), + 'facultyId' => 1]); - $json = json_decode($response->getContent()); - $this->assertEquals(true, $json->success); + $json = json_decode($response->getContent()); + $this->assertEquals($expected, $json->success); + + // Return the we just created. + return Departments::find($json->departmentId); + } else { + $response = $this->call('POST', '/account/create-department', ['name' => 'phpunitDepartment', + 'shortname' => 'phpunitDepartment', + 'head' => 'headofdepartment', + 'description' => str_random(30), + 'facultyId' => 'one']); - // Return the we just created. - return Departments::find($json->departmentId); + $json = json_decode($response->getContent()); + $this->assertEquals($expected, $json->success); + } } /** * Function that updates specified department. */ - protected function updateDepartment($id) { - $response = $this->call('POST', '/account/update-department', ['name' => 'phpunitDepartment123', - 'shortname' => 'phpunitDepartment', - 'head' => 'headofdepartment', - 'description' => str_random(60), - 'facultyId' => 1, - 'id' => $id]); + protected function updateDepartment($id, $expected) { + if($expected) { + $response = $this->call('POST', '/account/update-department', ['name' => 'phpunitDepartment123', + 'shortname' => 'phpunitDepartment', + 'head' => 'headofdepartment', + 'description' => str_random(60), + 'facultyId' => 1, + 'id' => $id]); + + $json = json_decode($response->getContent()); + $this->assertEquals(true, $json->success); + + // Verify that the change was made. + $d = Departments::find($id); + $this->assertEquals('phpunitDepartment123', $d->departmentname); + + return $d; + } else { + $response = $this->call('POST', '/account/update-department', ['name' => 'phpunitDepartment123', + 'shortname' => 'phpunitDepartment', + 'head' => 'headofdepartment', + 'description' => str_random(60), + 'facultyId' => 'one', + 'id' => $id]); + + $json = json_decode($response->getContent()); + $this->assertEquals(false, $json->success); + } + } - $json = json_decode($response->getContent()); - $this->assertEquals(true, $json->success); + /** + * Function that creates an elective for a specified module. + */ + protected function createElective($mid, $d, $expected) { + $data = ''; + foreach($d as $key => $value) { + $data = $data.$key.'='.$value.'&'; + } + // TODO: Once elective creation is resolved change path below. + $response = $this->call('POST', '/elective-new', ['elecData' => $data]); - // Verify that the change was made. - $d = Departments::find($id); - $this->assertEquals('phpunitDepartment123', $d->departmentname); + $json = json_decode($response->getContent()); + if($expected) { + $this->assertEquals(true, $json->success); - return $d; + // Return the Class we just created. + return Classes::where('classmodule', $mid)->first(); + } else { + $this->assertEquals(true, $json->fail); + } } /** - * Function that creates an elective for a specified module. + * Function that updates a module */ - protected function createElective($mid) { + protected function updateElective($id, $d, $expected) { $data = ''; - $d = array('classlecturer' => 'lecturer', - 'classmodule' => $mid, - 'classlimit' => 10); foreach($d as $key => $value) { $data = $data.$key.'='.$value.'&'; } - // TODO: Once elective creation is resolved change path below. - $response = $this->call('POST', '/module-new', ['elecData' => $data]); + $response = $this->call('POST', '/elective-change', ['elecData' => $data]); $json = json_decode($response->getContent()); - $this->assertEquals(true, $json->success); + if($expected) { + $this->assertEquals(true, $json->success); - // Return the Class we just created. - return Classes::where('classmodule', $mid)->first(); + // Get the module we just updated. + $c = Classes::where('classid', $id)->first(); + + // Now return the class. + return $c; + } else { + $this->assertEquals(true, $json->fail); + } } } + diff --git a/app/views/account/password.blade.php b/app/views/account/password.blade.php index fdba4ed..fd66b59 100755 --- a/app/views/account/password.blade.php +++ b/app/views/account/password.blade.php @@ -28,7 +28,7 @@
- Change Password + {{Form::token()}}
@@ -36,4 +36,4 @@
- \ No newline at end of file + diff --git a/app/views/account/signin.blade.php b/app/views/account/signin.blade.php index e879251..194bfe6 100755 --- a/app/views/account/signin.blade.php +++ b/app/views/account/signin.blade.php @@ -2,7 +2,7 @@ @section('content')

-{{ (Input::old('username')) ? e(Input::old('username')) : '[Student ID]' }} +{{ (Input::old('username')) ? e(Input::old('username')) : '[User ID]' }} (not you?)

CIT Module System

@@ -20,4 +20,4 @@ Remember me -@stop \ No newline at end of file +@stop diff --git a/app/views/layout/classes.blade.php b/app/views/layout/classes.blade.php index c43376d..1a6fd8d 100644 --- a/app/views/layout/classes.blade.php +++ b/app/views/layout/classes.blade.php @@ -33,9 +33,9 @@
- - - + + +
@@ -69,4 +69,4 @@ @endforeach - \ No newline at end of file + diff --git a/app/views/layout/electivepreview.blade.php b/app/views/layout/electivepreview.blade.php index c4fc050..393fe49 100755 --- a/app/views/layout/electivepreview.blade.php +++ b/app/views/layout/electivepreview.blade.php @@ -2,7 +2,7 @@ // Get the module. $mod = Modules::where('mid', $elec->classmodule)->first(); ?> -
+
diff --git a/app/views/layout/hod.blade.php b/app/views/layout/hod.blade.php index 5fbffd3..18f9c27 100755 --- a/app/views/layout/hod.blade.php +++ b/app/views/layout/hod.blade.php @@ -277,15 +277,9 @@ @@ -383,7 +388,9 @@

-
+
+
+
+
    Load Timetable @@ -323,7 +326,7 @@ $("#loadTimes").click(function() { var opt = $('option[value="'+$('#elective').val()+'"]'); if(!opt.length){ - alert('Error: No Elective Selected.') + failMessage('Error: No Elective Selected.') return; } @@ -359,4 +362,4 @@ function loadTime($id){ {{ HTML::script('js/main.js') }} - \ No newline at end of file + diff --git a/app/views/layout/moduleedit.blade.php b/app/views/layout/moduleedit.blade.php index b05d5ac..15103b7 100644 --- a/app/views/layout/moduleedit.blade.php +++ b/app/views/layout/moduleedit.blade.php @@ -1,15 +1,15 @@ -
    +
    - {{ $type=='edit' ? $mod->mshorttitle : 'Create new Module'}} + {{ $type=='edit' ? $mod->mshorttitle : 'Create New Module'}}
    -
\ No newline at end of file +
diff --git a/app/views/layout/student.blade.php b/app/views/layout/student.blade.php index 61e30e2..75bce2e 100755 --- a/app/views/layout/student.blade.php +++ b/app/views/layout/student.blade.php @@ -120,16 +120,16 @@

Electives

-
+
@foreach (Faculty::all() as $fac) - @foreach ($fac->departments as $dep) @endforeach @@ -196,7 +196,7 @@ -
+

Profile

@@ -228,7 +228,7 @@

Settings

Change Password

- Change Password Now + Change Password
@if(Session::has('pass'))
{{ Session::get('pass') }}
@@ -265,6 +265,8 @@

+
+ +
    @@ -305,7 +308,7 @@ $("#loadTimes").click(function() { var opt = $('option[value="'+$('#elective').val()+'"]'); if(!opt.length){ - alert('Error: No Elective Selected.') + failMessage('Error: No Elective Selected.') return; } diff --git a/app/views/layout/tech.blade.php b/app/views/layout/tech.blade.php index 645b3e3..5755a02 100755 --- a/app/views/layout/tech.blade.php +++ b/app/views/layout/tech.blade.php @@ -386,7 +386,7 @@ -
    +

    Users

    @@ -402,7 +402,7 @@ -
    +

    My Profile

    @@ -421,9 +421,12 @@ -
    -

    Change Password

    - Change Password Now +
    +
    + +
    + @if(Session::has('pass'))
    {{ Session::get('global') }}
    @@ -462,7 +465,7 @@
    -
    +

    Faculties

    @@ -520,7 +523,7 @@
    -
    +

    Departments

    @@ -608,4 +611,4 @@ {{ HTML::script('js/main.js') }} - \ No newline at end of file + diff --git a/bootstrap/app.php b/bootstrap/app.php deleted file mode 100644 index f50a3f7..0000000 --- a/bootstrap/app.php +++ /dev/null @@ -1,55 +0,0 @@ -singleton( - 'Illuminate\Contracts\Http\Kernel', - 'App\Http\Kernel' -); - -$app->singleton( - 'Illuminate\Contracts\Console\Kernel', - 'App\Console\Kernel' -); - -$app->singleton( - 'Illuminate\Contracts\Debug\ExceptionHandler', - 'App\Exceptions\Handler' -); - -/* -|-------------------------------------------------------------------------- -| Return The Application -|-------------------------------------------------------------------------- -| -| This script returns the application instance. The instance is given to -| the calling script so we can separate the building of the instances -| from the actual running of the application and sending responses. -| -*/ - -return $app; diff --git a/config/app.php b/config/app.php deleted file mode 100644 index ab912a9..0000000 --- a/config/app.php +++ /dev/null @@ -1,205 +0,0 @@ - env('APP_DEBUG'), - - /* - |-------------------------------------------------------------------------- - | Application URL - |-------------------------------------------------------------------------- - | - | This URL is used by the console to properly generate URLs when using - | the Artisan command line tool. You should set this to the root of - | your application so that it is used when running Artisan tasks. - | - */ - - 'url' => 'http://localhost', - - /* - |-------------------------------------------------------------------------- - | Application Timezone - |-------------------------------------------------------------------------- - | - | Here you may specify the default timezone for your application, which - | will be used by the PHP date and date-time functions. We have gone - | ahead and set this to a sensible default for you out of the box. - | - */ - - 'timezone' => 'UTC', - - /* - |-------------------------------------------------------------------------- - | Application Locale Configuration - |-------------------------------------------------------------------------- - | - | The application locale determines the default locale that will be used - | by the translation service provider. You are free to set this value - | to any of the locales which will be supported by the application. - | - */ - - 'locale' => 'en', - - /* - |-------------------------------------------------------------------------- - | Application Fallback Locale - |-------------------------------------------------------------------------- - | - | The fallback locale determines the locale to use when the current one - | is not available. You may change the value to correspond to any of - | the language folders that are provided through your application. - | - */ - - 'fallback_locale' => 'en', - - /* - |-------------------------------------------------------------------------- - | Encryption Key - |-------------------------------------------------------------------------- - | - | This key is used by the Illuminate encrypter service and should be set - | to a random, 32 character string, otherwise these encrypted strings - | will not be safe. Please do this before deploying an application! - | - */ - - 'key' => env('APP_KEY', 'SomeRandomString'), - - 'cipher' => MCRYPT_RIJNDAEL_128, - - /* - |-------------------------------------------------------------------------- - | Logging Configuration - |-------------------------------------------------------------------------- - | - | Here you may configure the log settings for your application. Out of - | the box, Laravel uses the Monolog PHP logging library. This gives - | you a variety of powerful log handlers / formatters to utilize. - | - | Available Settings: "single", "daily", "syslog", "errorlog" - | - */ - - 'log' => 'daily', - - /* - |-------------------------------------------------------------------------- - | Autoloaded Service Providers - |-------------------------------------------------------------------------- - | - | The service providers listed here will be automatically loaded on the - | request to your application. Feel free to add your own services to - | this array to grant expanded functionality to your applications. - | - */ - - 'providers' => [ - - /* - * Laravel Framework Service Providers... - */ - 'Illuminate\Foundation\Providers\ArtisanServiceProvider', - 'Illuminate\Auth\AuthServiceProvider', - 'Illuminate\Bus\BusServiceProvider', - 'Illuminate\Cache\CacheServiceProvider', - 'Illuminate\Foundation\Providers\ConsoleSupportServiceProvider', - 'Illuminate\Routing\ControllerServiceProvider', - 'Illuminate\Cookie\CookieServiceProvider', - 'Illuminate\Database\DatabaseServiceProvider', - 'Illuminate\Encryption\EncryptionServiceProvider', - 'Illuminate\Filesystem\FilesystemServiceProvider', - 'Illuminate\Foundation\Providers\FoundationServiceProvider', - 'Illuminate\Hashing\HashServiceProvider', - 'Illuminate\Mail\MailServiceProvider', - 'Illuminate\Pagination\PaginationServiceProvider', - 'Illuminate\Pipeline\PipelineServiceProvider', - 'Illuminate\Queue\QueueServiceProvider', - 'Illuminate\Redis\RedisServiceProvider', - 'Illuminate\Auth\Passwords\PasswordResetServiceProvider', - 'Illuminate\Session\SessionServiceProvider', - 'Illuminate\Translation\TranslationServiceProvider', - 'Illuminate\Validation\ValidationServiceProvider', - 'Illuminate\View\ViewServiceProvider', - - /* - * Application Service Providers... - */ - 'App\Providers\AppServiceProvider', - 'App\Providers\BusServiceProvider', - 'App\Providers\ConfigServiceProvider', - 'App\Providers\EventServiceProvider', - 'App\Providers\RouteServiceProvider', - - /* - * Custom image creation/manipulation library, - * see: image.intervention.io for more info... - */ - 'Intervention\Image\ImageServiceProvider', - - ], - - /* - |-------------------------------------------------------------------------- - | Class Aliases - |-------------------------------------------------------------------------- - | - | This array of class aliases will be registered when this application - | is started. However, feel free to register as many as you wish as - | the aliases are "lazy" loaded so they don't hinder performance. - | - */ - - 'aliases' => [ - - 'App' => 'Illuminate\Support\Facades\App', - 'Artisan' => 'Illuminate\Support\Facades\Artisan', - 'Auth' => 'Illuminate\Support\Facades\Auth', - 'Blade' => 'Illuminate\Support\Facades\Blade', - 'Bus' => 'Illuminate\Support\Facades\Bus', - 'Cache' => 'Illuminate\Support\Facades\Cache', - 'Config' => 'Illuminate\Support\Facades\Config', - 'Cookie' => 'Illuminate\Support\Facades\Cookie', - 'Crypt' => 'Illuminate\Support\Facades\Crypt', - 'DB' => 'Illuminate\Support\Facades\DB', - 'Eloquent' => 'Illuminate\Database\Eloquent\Model', - 'Event' => 'Illuminate\Support\Facades\Event', - 'File' => 'Illuminate\Support\Facades\File', - 'Hash' => 'Illuminate\Support\Facades\Hash', - 'Input' => 'Illuminate\Support\Facades\Input', - 'Inspiring' => 'Illuminate\Foundation\Inspiring', - 'Lang' => 'Illuminate\Support\Facades\Lang', - 'Log' => 'Illuminate\Support\Facades\Log', - 'Mail' => 'Illuminate\Support\Facades\Mail', - 'Password' => 'Illuminate\Support\Facades\Password', - 'Queue' => 'Illuminate\Support\Facades\Queue', - 'Redirect' => 'Illuminate\Support\Facades\Redirect', - 'Redis' => 'Illuminate\Support\Facades\Redis', - 'Request' => 'Illuminate\Support\Facades\Request', - 'Response' => 'Illuminate\Support\Facades\Response', - 'Route' => 'Illuminate\Support\Facades\Route', - 'Schema' => 'Illuminate\Support\Facades\Schema', - 'Session' => 'Illuminate\Support\Facades\Session', - 'Storage' => 'Illuminate\Support\Facades\Storage', - 'URL' => 'Illuminate\Support\Facades\URL', - 'Validator' => 'Illuminate\Support\Facades\Validator', - 'View' => 'Illuminate\Support\Facades\View', - 'Image' => 'Intervention\Image\Facades\Image', - - ], - -]; diff --git a/config/auth.php b/config/auth.php deleted file mode 100644 index 5b436aa..0000000 --- a/config/auth.php +++ /dev/null @@ -1,67 +0,0 @@ - 'eloquent', - - /* - |-------------------------------------------------------------------------- - | Authentication Model - |-------------------------------------------------------------------------- - | - | When using the "Eloquent" authentication driver, we need to know which - | Eloquent model should be used to retrieve your users. Of course, it - | is often just the "User" model but you may use whatever you like. - | - */ - - 'model' => 'App\User', - - /* - |-------------------------------------------------------------------------- - | Authentication Table - |-------------------------------------------------------------------------- - | - | When using the "Database" authentication driver, we need to know which - | table should be used to retrieve your users. We have chosen a basic - | default value but you may easily change it to any table you like. - | - */ - - 'table' => 'users', - - /* - |-------------------------------------------------------------------------- - | Password Reset Settings - |-------------------------------------------------------------------------- - | - | Here you may set the options for resetting passwords including the view - | that is your password reset e-mail. You can also set the name of the - | table that maintains all of the reset tokens for your application. - | - | The expire time is the number of minutes that the reset token should be - | considered valid. This security feature keeps tokens short-lived so - | they have less time to be guessed. You may change this as needed. - | - */ - - 'password' => [ - 'email' => 'emails.password', - 'table' => 'password_resets', - 'expire' => 60, - ], - -]; diff --git a/config/cache.php b/config/cache.php deleted file mode 100644 index 9ddd5f3..0000000 --- a/config/cache.php +++ /dev/null @@ -1,79 +0,0 @@ - env('CACHE_DRIVER', 'file'), - - /* - |-------------------------------------------------------------------------- - | Cache Stores - |-------------------------------------------------------------------------- - | - | Here you may define all of the cache "stores" for your application as - | well as their drivers. You may even define multiple stores for the - | same cache driver to group types of items stored in your caches. - | - */ - - 'stores' => [ - - 'apc' => [ - 'driver' => 'apc' - ], - - 'array' => [ - 'driver' => 'array' - ], - - 'database' => [ - 'driver' => 'database', - 'table' => 'cache', - 'connection' => null, - ], - - 'file' => [ - 'driver' => 'file', - 'path' => storage_path().'/framework/cache', - ], - - 'memcached' => [ - 'driver' => 'memcached', - 'servers' => [ - [ - 'host' => '127.0.0.1', 'port' => 11211, 'weight' => 100 - ], - ], - ], - - 'redis' => [ - 'driver' => 'redis', - 'connection' => 'default', - ], - - ], - - /* - |-------------------------------------------------------------------------- - | Cache Key Prefix - |-------------------------------------------------------------------------- - | - | When utilizing a RAM based store such as APC or Memcached, there might - | be other applications utilizing the same cache. So, we'll specify a - | value to get prefixed to all our keys so we can avoid collisions. - | - */ - - 'prefix' => 'laravel', - -]; diff --git a/config/compile.php b/config/compile.php deleted file mode 100644 index 3a002fc..0000000 --- a/config/compile.php +++ /dev/null @@ -1,41 +0,0 @@ - [ - - realpath(__DIR__.'/../app/Providers/AppServiceProvider.php'), - realpath(__DIR__.'/../app/Providers/BusServiceProvider.php'), - realpath(__DIR__.'/../app/Providers/ConfigServiceProvider.php'), - realpath(__DIR__.'/../app/Providers/EventServiceProvider.php'), - realpath(__DIR__.'/../app/Providers/RouteServiceProvider.php'), - - ], - - /* - |-------------------------------------------------------------------------- - | Compiled File Providers - |-------------------------------------------------------------------------- - | - | Here you may list service providers which define a "compiles" function - | that returns additional files that should be compiled, providing an - | easy way to get common files from any packages you are utilizing. - | - */ - - 'providers' => [ - // - ], - -]; diff --git a/config/database.php b/config/database.php deleted file mode 100644 index 54c6db0..0000000 --- a/config/database.php +++ /dev/null @@ -1,125 +0,0 @@ - PDO::FETCH_CLASS, - - /* - |-------------------------------------------------------------------------- - | Default Database Connection Name - |-------------------------------------------------------------------------- - | - | Here you may specify which of the database connections below you wish - | to use as your default connection for all database work. Of course - | you may use many connections at once using the Database library. - | - */ - - 'default' => 'mysql', - - /* - |-------------------------------------------------------------------------- - | Database Connections - |-------------------------------------------------------------------------- - | - | Here are each of the database connections setup for your application. - | Of course, examples of configuring each database platform that is - | supported by Laravel is shown below to make development simple. - | - | - | All database work in Laravel is done through the PHP PDO facilities - | so make sure you have the driver for your particular database of - | choice installed on your machine before you begin development. - | - */ - - 'connections' => [ - - 'sqlite' => [ - 'driver' => 'sqlite', - 'database' => storage_path().'/database.sqlite', - 'prefix' => '', - ], - - 'mysql' => [ - 'driver' => 'mysql', - 'host' => env('DB_HOST', 'localhost'), - 'database' => env('DB_DATABASE', 'forge'), - 'username' => env('DB_USERNAME', 'forge'), - 'password' => env('DB_PASSWORD', ''), - 'charset' => 'utf8', - 'collation' => 'utf8_unicode_ci', - 'prefix' => '', - 'strict' => false, - ], - - 'pgsql' => [ - 'driver' => 'pgsql', - 'host' => env('DB_HOST', 'localhost'), - 'database' => env('DB_DATABASE', 'forge'), - 'username' => env('DB_USERNAME', 'forge'), - 'password' => env('DB_PASSWORD', ''), - 'charset' => 'utf8', - 'prefix' => '', - 'schema' => 'public', - ], - - 'sqlsrv' => [ - 'driver' => 'sqlsrv', - 'host' => env('DB_HOST', 'localhost'), - 'database' => env('DB_DATABASE', 'forge'), - 'username' => env('DB_USERNAME', 'forge'), - 'password' => env('DB_PASSWORD', ''), - 'prefix' => '', - ], - - ], - - /* - |-------------------------------------------------------------------------- - | Migration Repository Table - |-------------------------------------------------------------------------- - | - | This table keeps track of all the migrations that have already run for - | your application. Using this information, we can determine which of - | the migrations on disk haven't actually been run in the database. - | - */ - - 'migrations' => 'migrations', - - /* - |-------------------------------------------------------------------------- - | Redis Databases - |-------------------------------------------------------------------------- - | - | Redis is an open source, fast, and advanced key-value store that also - | provides a richer set of commands than a typical key-value systems - | such as APC or Memcached. Laravel makes it easy to dig right in. - | - */ - - 'redis' => [ - - 'cluster' => false, - - 'default' => [ - 'host' => '127.0.0.1', - 'port' => 6379, - 'database' => 0, - ], - - ], - -]; diff --git a/config/filesystems.php b/config/filesystems.php deleted file mode 100644 index ad8228f..0000000 --- a/config/filesystems.php +++ /dev/null @@ -1,70 +0,0 @@ - 'local', - - /* - |-------------------------------------------------------------------------- - | Default Cloud Filesystem Disk - |-------------------------------------------------------------------------- - | - | Many applications store files both locally and in the cloud. For this - | reason, you may specify a default "cloud" driver here. This driver - | will be bound as the Cloud disk implementation in the container. - | - */ - - 'cloud' => 's3', - - /* - |-------------------------------------------------------------------------- - | Filesystem Disks - |-------------------------------------------------------------------------- - | - | Here you may configure as many filesystem "disks" as you wish, and you - | may even configure multiple disks of the same driver. Defaults have - | been setup for each driver as an example of the required options. - | - */ - - 'disks' => [ - - 'local' => [ - 'driver' => 'local', - 'root' => storage_path().'/app', - ], - - 's3' => [ - 'driver' => 's3', - 'key' => 'your-key', - 'secret' => 'your-secret', - 'region' => 'your-region', - 'bucket' => 'your-bucket', - ], - - 'rackspace' => [ - 'driver' => 'rackspace', - 'username' => 'your-username', - 'key' => 'your-key', - 'container' => 'your-container', - 'endpoint' => 'https://identity.api.rackspacecloud.com/v2.0/', - 'region' => 'IAD', - ], - - ], - -]; diff --git a/config/mail.php b/config/mail.php deleted file mode 100644 index 6f9c954..0000000 --- a/config/mail.php +++ /dev/null @@ -1,124 +0,0 @@ - 'smtp', - - /* - |-------------------------------------------------------------------------- - | SMTP Host Address - |-------------------------------------------------------------------------- - | - | Here you may provide the host address of the SMTP server used by your - | applications. A default option is provided that is compatible with - | the Mailgun mail service which will provide reliable deliveries. - | - */ - - 'host' => 'smtp.mailgun.org', - - /* - |-------------------------------------------------------------------------- - | SMTP Host Port - |-------------------------------------------------------------------------- - | - | This is the SMTP port used by your application to deliver e-mails to - | users of the application. Like the host we have set this value to - | stay compatible with the Mailgun e-mail application by default. - | - */ - - 'port' => 587, - - /* - |-------------------------------------------------------------------------- - | Global "From" Address - |-------------------------------------------------------------------------- - | - | You may wish for all e-mails sent by your application to be sent from - | the same address. Here, you may specify a name and address that is - | used globally for all e-mails that are sent by your application. - | - */ - - 'from' => ['address' => null, 'name' => null], - - /* - |-------------------------------------------------------------------------- - | E-Mail Encryption Protocol - |-------------------------------------------------------------------------- - | - | Here you may specify the encryption protocol that should be used when - | the application send e-mail messages. A sensible default using the - | transport layer security protocol should provide great security. - | - */ - - 'encryption' => 'tls', - - /* - |-------------------------------------------------------------------------- - | SMTP Server Username - |-------------------------------------------------------------------------- - | - | If your SMTP server requires a username for authentication, you should - | set it here. This will get used to authenticate with your server on - | connection. You may also set the "password" value below this one. - | - */ - - 'username' => null, - - /* - |-------------------------------------------------------------------------- - | SMTP Server Password - |-------------------------------------------------------------------------- - | - | Here you may set the password required by your SMTP server to send out - | messages from your application. This will be given to the server on - | connection so that the application will be able to send messages. - | - */ - - 'password' => null, - - /* - |-------------------------------------------------------------------------- - | Sendmail System Path - |-------------------------------------------------------------------------- - | - | When using the "sendmail" driver to send e-mails, we will need to know - | the path to where Sendmail lives on this server. A default path has - | been provided here, which will work well on most of your systems. - | - */ - - 'sendmail' => '/usr/sbin/sendmail -bs', - - /* - |-------------------------------------------------------------------------- - | Mail "Pretend" - |-------------------------------------------------------------------------- - | - | When this option is enabled, e-mail will not actually be sent over the - | web and will instead be written to your application's logs files so - | you may inspect the message. This is great for local development. - | - */ - - 'pretend' => false, - -]; diff --git a/config/queue.php b/config/queue.php deleted file mode 100644 index 9c39a13..0000000 --- a/config/queue.php +++ /dev/null @@ -1,92 +0,0 @@ - env('QUEUE_DRIVER', 'sync'), - - /* - |-------------------------------------------------------------------------- - | Queue Connections - |-------------------------------------------------------------------------- - | - | Here you may configure the connection information for each server that - | is used by your application. A default configuration has been added - | for each back-end shipped with Laravel. You are free to add more. - | - */ - - 'connections' => [ - - 'sync' => [ - 'driver' => 'sync', - ], - - 'database' => [ - 'driver' => 'database', - 'table' => 'jobs', - 'queue' => 'default', - 'expire' => 60, - ], - - 'beanstalkd' => [ - 'driver' => 'beanstalkd', - 'host' => 'localhost', - 'queue' => 'default', - 'ttr' => 60, - ], - - 'sqs' => [ - 'driver' => 'sqs', - 'key' => 'your-public-key', - 'secret' => 'your-secret-key', - 'queue' => 'your-queue-url', - 'region' => 'us-east-1', - ], - - 'iron' => [ - 'driver' => 'iron', - 'host' => 'mq-aws-us-east-1.iron.io', - 'token' => 'your-token', - 'project' => 'your-project-id', - 'queue' => 'your-queue-name', - 'encrypt' => true, - ], - - 'redis' => [ - 'driver' => 'redis', - 'queue' => 'default', - 'expire' => 60, - ], - - ], - - /* - |-------------------------------------------------------------------------- - | Failed Queue Jobs - |-------------------------------------------------------------------------- - | - | These options configure the behavior of failed queue job logging so you - | can control which database and table are used to store the jobs that - | have failed. You may change them to any database / table you wish. - | - */ - - 'failed' => [ - 'database' => 'mysql', 'table' => 'failed_jobs', - ], - -]; diff --git a/config/services.php b/config/services.php deleted file mode 100644 index dddc986..0000000 --- a/config/services.php +++ /dev/null @@ -1,37 +0,0 @@ - [ - 'domain' => '', - 'secret' => '', - ], - - 'mandrill' => [ - 'secret' => '', - ], - - 'ses' => [ - 'key' => '', - 'secret' => '', - 'region' => 'us-east-1', - ], - - 'stripe' => [ - 'model' => 'User', - 'secret' => '', - ], - -]; diff --git a/config/session.php b/config/session.php deleted file mode 100644 index 47470fa..0000000 --- a/config/session.php +++ /dev/null @@ -1,153 +0,0 @@ - env('SESSION_DRIVER', 'file'), - - /* - |-------------------------------------------------------------------------- - | Session Lifetime - |-------------------------------------------------------------------------- - | - | Here you may specify the number of minutes that you wish the session - | to be allowed to remain idle before it expires. If you want them - | to immediately expire on the browser closing, set that option. - | - */ - - 'lifetime' => 120, - - 'expire_on_close' => false, - - /* - |-------------------------------------------------------------------------- - | Session Encryption - |-------------------------------------------------------------------------- - | - | This option allows you to easily specify that all of your session data - | should be encrypted before it is stored. All encryption will be run - | automatically by Laravel and you can use the Session like normal. - | - */ - - 'encrypt' => false, - - /* - |-------------------------------------------------------------------------- - | Session File Location - |-------------------------------------------------------------------------- - | - | When using the native session driver, we need a location where session - | files may be stored. A default has been set for you but a different - | location may be specified. This is only needed for file sessions. - | - */ - - 'files' => storage_path().'/framework/sessions', - - /* - |-------------------------------------------------------------------------- - | Session Database Connection - |-------------------------------------------------------------------------- - | - | When using the "database" or "redis" session drivers, you may specify a - | connection that should be used to manage these sessions. This should - | correspond to a connection in your database configuration options. - | - */ - - 'connection' => null, - - /* - |-------------------------------------------------------------------------- - | Session Database Table - |-------------------------------------------------------------------------- - | - | When using the "database" session driver, you may specify the table we - | should use to manage the sessions. Of course, a sensible default is - | provided for you; however, you are free to change this as needed. - | - */ - - 'table' => 'sessions', - - /* - |-------------------------------------------------------------------------- - | Session Sweeping Lottery - |-------------------------------------------------------------------------- - | - | Some session drivers must manually sweep their storage location to get - | rid of old sessions from storage. Here are the chances that it will - | happen on a given request. By default, the odds are 2 out of 100. - | - */ - - 'lottery' => [2, 100], - - /* - |-------------------------------------------------------------------------- - | Session Cookie Name - |-------------------------------------------------------------------------- - | - | Here you may change the name of the cookie used to identify a session - | instance by ID. The name specified here will get used every time a - | new session cookie is created by the framework for every driver. - | - */ - - 'cookie' => 'laravel_session', - - /* - |-------------------------------------------------------------------------- - | Session Cookie Path - |-------------------------------------------------------------------------- - | - | The session cookie path determines the path for which the cookie will - | be regarded as available. Typically, this will be the root path of - | your application but you are free to change this when necessary. - | - */ - - 'path' => '/', - - /* - |-------------------------------------------------------------------------- - | Session Cookie Domain - |-------------------------------------------------------------------------- - | - | Here you may change the domain of the cookie used to identify a session - | in your application. This will determine which domains the cookie is - | available to in your application. A sensible default has been set. - | - */ - - 'domain' => null, - - /* - |-------------------------------------------------------------------------- - | HTTPS Only Cookies - |-------------------------------------------------------------------------- - | - | By setting this option to true, session cookies will only be sent back - | to the server if the browser has a HTTPS connection. This will keep - | the cookie from being sent to you if it can not be done securely. - | - */ - - 'secure' => false, - -]; diff --git a/config/view.php b/config/view.php deleted file mode 100644 index 88fc534..0000000 --- a/config/view.php +++ /dev/null @@ -1,33 +0,0 @@ - [ - realpath(base_path('resources/views')) - ], - - /* - |-------------------------------------------------------------------------- - | Compiled View Path - |-------------------------------------------------------------------------- - | - | This option determines where all the compiled Blade templates will be - | stored for your application. Typically, this is within the storage - | directory. However, as usual, you are free to change this value. - | - */ - - 'compiled' => realpath(storage_path().'/framework/views'), - -]; diff --git a/database/.gitignore b/database/.gitignore deleted file mode 100644 index 9b1dffd..0000000 --- a/database/.gitignore +++ /dev/null @@ -1 +0,0 @@ -*.sqlite diff --git a/database/migrations/.gitkeep b/database/migrations/.gitkeep deleted file mode 100644 index e69de29..0000000 diff --git a/database/migrations/2014_10_12_000000_create_users_table.php b/database/migrations/2014_10_12_000000_create_users_table.php deleted file mode 100644 index 36a1db9..0000000 --- a/database/migrations/2014_10_12_000000_create_users_table.php +++ /dev/null @@ -1,36 +0,0 @@ -increments('id'); - $table->string('name'); - $table->string('email')->unique(); - $table->string('password', 60); - $table->rememberToken(); - $table->timestamps(); - }); - } - - /** - * Reverse the migrations. - * - * @return void - */ - public function down() - { - Schema::drop('users'); - } - -} diff --git a/database/migrations/2014_10_12_100000_create_password_resets_table.php b/database/migrations/2014_10_12_100000_create_password_resets_table.php deleted file mode 100644 index 679df38..0000000 --- a/database/migrations/2014_10_12_100000_create_password_resets_table.php +++ /dev/null @@ -1,33 +0,0 @@ -string('email')->index(); - $table->string('token')->index(); - $table->timestamp('created_at'); - }); - } - - /** - * Reverse the migrations. - * - * @return void - */ - public function down() - { - Schema::drop('password_resets'); - } - -} diff --git a/database/seeds/.gitkeep b/database/seeds/.gitkeep deleted file mode 100644 index e69de29..0000000 diff --git a/database/seeds/DatabaseSeeder.php b/database/seeds/DatabaseSeeder.php deleted file mode 100644 index b3c69b5..0000000 --- a/database/seeds/DatabaseSeeder.php +++ /dev/null @@ -1,20 +0,0 @@ -call('UserTableSeeder'); - } - -} diff --git a/public/.htaccess b/public/.htaccess index f0b497b..77827ae 100755 --- a/public/.htaccess +++ b/public/.htaccess @@ -4,7 +4,6 @@ RewriteEngine On - RewriteBase /Module-System/public/ # Redirect Trailing Slashes... RewriteRule ^(.*)/$ /$1 [L,R=301] diff --git a/public/css/style.css b/public/css/style.css index 41312f8..b3361da 100644 --- a/public/css/style.css +++ b/public/css/style.css @@ -266,12 +266,12 @@ body.modal-open, .modal-open .navbar-fixed-top, .modal-open .navbar-fixed-bottom display: inline-block; } .grid-controls li { - max-width: 30%; min-width: 30%; + min-height: 85px; height: 40px; float: left; margin: 5px; - background-color: #33CCFF; + background-color: #24A8D4; } #csvDownload { visibility: hidden; @@ -544,6 +544,7 @@ body.modal-open, .modal-open .navbar-fixed-top, .modal-open .navbar-fixed-bottom .feature-box { padding: 15px; max-width: 293px; + min-width: 136px; min-height: 140px; margin-top: 20px; background: #00CCFF; diff --git a/public/js/main.js b/public/js/main.js index 0b6978b..46db345 100644 --- a/public/js/main.js +++ b/public/js/main.js @@ -92,9 +92,9 @@ $( document ).on('submit', '.electiveRegister', function() { '

    '+ response.lecturer +'


    '+ ''+ ''+ - '
    '+ + ''+ '
    '; - var timeStuff = ""; + var timeStuff = ""; // Insert classBlock to myelectives. $('#myelectives').append(classBlock); @@ -148,7 +148,7 @@ $( document ).on('submit', '.electiveUnregister', function() { if(response.success) { // Remove from myelectives. var myclass = $('.myclass'+electiveId).remove(); - + var tdelete = $('.myclass'+response.classnum).remove(); // Inform user. successMessage("Successfully unregistered from module!"); @@ -279,7 +279,9 @@ $( document ).on('submit', '#classForm', function() { if(response.success) { $('#classleft').val(response.space); successMessage('Class updated successfully!'); - } + } else { + failMessage(response.errors); + } }); @@ -836,7 +838,7 @@ var saveTimes = '
    '+ ''+ 'Save Class Times'; + 'id="saveTime">Save Timetable'; function getTimes(){ times.length = 0; @@ -871,7 +873,7 @@ $("#loadTT").click( function(){ var opt = $('option[value="'+$('#elective').val()+'"]'); if(!opt.length){ - alert('Error: No Elective Selected.') + failMessage('Error: No Elective Selected.') return; } diff --git a/resources/assets/less/app.less b/resources/assets/less/app.less deleted file mode 100644 index 99be076..0000000 --- a/resources/assets/less/app.less +++ /dev/null @@ -1,8 +0,0 @@ -@import "bootstrap/bootstrap"; - -@btn-font-weight: 300; -@font-family-sans-serif: "Roboto", Helvetica, Arial, sans-serif; - -body, label, .checkbox label { - font-weight: 300; -} diff --git a/resources/assets/less/bootstrap/alerts.less b/resources/assets/less/bootstrap/alerts.less deleted file mode 100644 index df070b8..0000000 --- a/resources/assets/less/bootstrap/alerts.less +++ /dev/null @@ -1,68 +0,0 @@ -// -// Alerts -// -------------------------------------------------- - - -// Base styles -// ------------------------- - -.alert { - padding: @alert-padding; - margin-bottom: @line-height-computed; - border: 1px solid transparent; - border-radius: @alert-border-radius; - - // Headings for larger alerts - h4 { - margin-top: 0; - // Specified for the h4 to prevent conflicts of changing @headings-color - color: inherit; - } - // Provide class for links that match alerts - .alert-link { - font-weight: @alert-link-font-weight; - } - - // Improve alignment and spacing of inner content - > p, - > ul { - margin-bottom: 0; - } - > p + p { - margin-top: 5px; - } -} - -// Dismissible alerts -// -// Expand the right padding and account for the close button's positioning. - -.alert-dismissable, // The misspelled .alert-dismissable was deprecated in 3.2.0. -.alert-dismissible { - padding-right: (@alert-padding + 20); - - // Adjust close link position - .close { - position: relative; - top: -2px; - right: -21px; - color: inherit; - } -} - -// Alternate styles -// -// Generate contextual modifier classes for colorizing the alert. - -.alert-success { - .alert-variant(@alert-success-bg; @alert-success-border; @alert-success-text); -} -.alert-info { - .alert-variant(@alert-info-bg; @alert-info-border; @alert-info-text); -} -.alert-warning { - .alert-variant(@alert-warning-bg; @alert-warning-border; @alert-warning-text); -} -.alert-danger { - .alert-variant(@alert-danger-bg; @alert-danger-border; @alert-danger-text); -} diff --git a/resources/assets/less/bootstrap/badges.less b/resources/assets/less/bootstrap/badges.less deleted file mode 100644 index b27c405..0000000 --- a/resources/assets/less/bootstrap/badges.less +++ /dev/null @@ -1,61 +0,0 @@ -// -// Badges -// -------------------------------------------------- - - -// Base class -.badge { - display: inline-block; - min-width: 10px; - padding: 3px 7px; - font-size: @font-size-small; - font-weight: @badge-font-weight; - color: @badge-color; - line-height: @badge-line-height; - vertical-align: baseline; - white-space: nowrap; - text-align: center; - background-color: @badge-bg; - border-radius: @badge-border-radius; - - // Empty badges collapse automatically (not available in IE8) - &:empty { - display: none; - } - - // Quick fix for badges in buttons - .btn & { - position: relative; - top: -1px; - } - .btn-xs & { - top: 0; - padding: 1px 5px; - } - - // Hover state, but only for links - a& { - &:hover, - &:focus { - color: @badge-link-hover-color; - text-decoration: none; - cursor: pointer; - } - } - - // Account for badges in navs - .list-group-item.active > &, - .nav-pills > .active > a > & { - color: @badge-active-color; - background-color: @badge-active-bg; - } - .list-group-item > & { - float: right; - } - .list-group-item > & + & { - margin-right: 5px; - } - .nav-pills > li > a > & { - margin-left: 3px; - } -} diff --git a/resources/assets/less/bootstrap/bootstrap.less b/resources/assets/less/bootstrap/bootstrap.less deleted file mode 100644 index 61b7747..0000000 --- a/resources/assets/less/bootstrap/bootstrap.less +++ /dev/null @@ -1,50 +0,0 @@ -// Core variables and mixins -@import "variables.less"; -@import "mixins.less"; - -// Reset and dependencies -@import "normalize.less"; -@import "print.less"; -@import "glyphicons.less"; - -// Core CSS -@import "scaffolding.less"; -@import "type.less"; -@import "code.less"; -@import "grid.less"; -@import "tables.less"; -@import "forms.less"; -@import "buttons.less"; - -// Components -@import "component-animations.less"; -@import "dropdowns.less"; -@import "button-groups.less"; -@import "input-groups.less"; -@import "navs.less"; -@import "navbar.less"; -@import "breadcrumbs.less"; -@import "pagination.less"; -@import "pager.less"; -@import "labels.less"; -@import "badges.less"; -@import "jumbotron.less"; -@import "thumbnails.less"; -@import "alerts.less"; -@import "progress-bars.less"; -@import "media.less"; -@import "list-group.less"; -@import "panels.less"; -@import "responsive-embed.less"; -@import "wells.less"; -@import "close.less"; - -// Components w/ JavaScript -@import "modals.less"; -@import "tooltip.less"; -@import "popovers.less"; -@import "carousel.less"; - -// Utility classes -@import "utilities.less"; -@import "responsive-utilities.less"; diff --git a/resources/assets/less/bootstrap/breadcrumbs.less b/resources/assets/less/bootstrap/breadcrumbs.less deleted file mode 100644 index cb01d50..0000000 --- a/resources/assets/less/bootstrap/breadcrumbs.less +++ /dev/null @@ -1,26 +0,0 @@ -// -// Breadcrumbs -// -------------------------------------------------- - - -.breadcrumb { - padding: @breadcrumb-padding-vertical @breadcrumb-padding-horizontal; - margin-bottom: @line-height-computed; - list-style: none; - background-color: @breadcrumb-bg; - border-radius: @border-radius-base; - - > li { - display: inline-block; - - + li:before { - content: "@{breadcrumb-separator}\00a0"; // Unicode space added since inline-block means non-collapsing white-space - padding: 0 5px; - color: @breadcrumb-color; - } - } - - > .active { - color: @breadcrumb-active-color; - } -} diff --git a/resources/assets/less/bootstrap/button-groups.less b/resources/assets/less/bootstrap/button-groups.less deleted file mode 100644 index f84febb..0000000 --- a/resources/assets/less/bootstrap/button-groups.less +++ /dev/null @@ -1,243 +0,0 @@ -// -// Button groups -// -------------------------------------------------- - -// Make the div behave like a button -.btn-group, -.btn-group-vertical { - position: relative; - display: inline-block; - vertical-align: middle; // match .btn alignment given font-size hack above - > .btn { - position: relative; - float: left; - // Bring the "active" button to the front - &:hover, - &:focus, - &:active, - &.active { - z-index: 2; - } - } -} - -// Prevent double borders when buttons are next to each other -.btn-group { - .btn + .btn, - .btn + .btn-group, - .btn-group + .btn, - .btn-group + .btn-group { - margin-left: -1px; - } -} - -// Optional: Group multiple button groups together for a toolbar -.btn-toolbar { - margin-left: -5px; // Offset the first child's margin - &:extend(.clearfix all); - - .btn-group, - .input-group { - float: left; - } - > .btn, - > .btn-group, - > .input-group { - margin-left: 5px; - } -} - -.btn-group > .btn:not(:first-child):not(:last-child):not(.dropdown-toggle) { - border-radius: 0; -} - -// Set corners individual because sometimes a single button can be in a .btn-group and we need :first-child and :last-child to both match -.btn-group > .btn:first-child { - margin-left: 0; - &:not(:last-child):not(.dropdown-toggle) { - .border-right-radius(0); - } -} -// Need .dropdown-toggle since :last-child doesn't apply given a .dropdown-menu immediately after it -.btn-group > .btn:last-child:not(:first-child), -.btn-group > .dropdown-toggle:not(:first-child) { - .border-left-radius(0); -} - -// Custom edits for including btn-groups within btn-groups (useful for including dropdown buttons within a btn-group) -.btn-group > .btn-group { - float: left; -} -.btn-group > .btn-group:not(:first-child):not(:last-child) > .btn { - border-radius: 0; -} -.btn-group > .btn-group:first-child { - > .btn:last-child, - > .dropdown-toggle { - .border-right-radius(0); - } -} -.btn-group > .btn-group:last-child > .btn:first-child { - .border-left-radius(0); -} - -// On active and open, don't show outline -.btn-group .dropdown-toggle:active, -.btn-group.open .dropdown-toggle { - outline: 0; -} - - -// Sizing -// -// Remix the default button sizing classes into new ones for easier manipulation. - -.btn-group-xs > .btn { &:extend(.btn-xs); } -.btn-group-sm > .btn { &:extend(.btn-sm); } -.btn-group-lg > .btn { &:extend(.btn-lg); } - - -// Split button dropdowns -// ---------------------- - -// Give the line between buttons some depth -.btn-group > .btn + .dropdown-toggle { - padding-left: 8px; - padding-right: 8px; -} -.btn-group > .btn-lg + .dropdown-toggle { - padding-left: 12px; - padding-right: 12px; -} - -// The clickable button for toggling the menu -// Remove the gradient and set the same inset shadow as the :active state -.btn-group.open .dropdown-toggle { - .box-shadow(inset 0 3px 5px rgba(0,0,0,.125)); - - // Show no shadow for `.btn-link` since it has no other button styles. - &.btn-link { - .box-shadow(none); - } -} - - -// Reposition the caret -.btn .caret { - margin-left: 0; -} -// Carets in other button sizes -.btn-lg .caret { - border-width: @caret-width-large @caret-width-large 0; - border-bottom-width: 0; -} -// Upside down carets for .dropup -.dropup .btn-lg .caret { - border-width: 0 @caret-width-large @caret-width-large; -} - - -// Vertical button groups -// ---------------------- - -.btn-group-vertical { - > .btn, - > .btn-group, - > .btn-group > .btn { - display: block; - float: none; - width: 100%; - max-width: 100%; - } - - // Clear floats so dropdown menus can be properly placed - > .btn-group { - &:extend(.clearfix all); - > .btn { - float: none; - } - } - - > .btn + .btn, - > .btn + .btn-group, - > .btn-group + .btn, - > .btn-group + .btn-group { - margin-top: -1px; - margin-left: 0; - } -} - -.btn-group-vertical > .btn { - &:not(:first-child):not(:last-child) { - border-radius: 0; - } - &:first-child:not(:last-child) { - border-top-right-radius: @border-radius-base; - .border-bottom-radius(0); - } - &:last-child:not(:first-child) { - border-bottom-left-radius: @border-radius-base; - .border-top-radius(0); - } -} -.btn-group-vertical > .btn-group:not(:first-child):not(:last-child) > .btn { - border-radius: 0; -} -.btn-group-vertical > .btn-group:first-child:not(:last-child) { - > .btn:last-child, - > .dropdown-toggle { - .border-bottom-radius(0); - } -} -.btn-group-vertical > .btn-group:last-child:not(:first-child) > .btn:first-child { - .border-top-radius(0); -} - - -// Justified button groups -// ---------------------- - -.btn-group-justified { - display: table; - width: 100%; - table-layout: fixed; - border-collapse: separate; - > .btn, - > .btn-group { - float: none; - display: table-cell; - width: 1%; - } - > .btn-group .btn { - width: 100%; - } - - > .btn-group .dropdown-menu { - left: auto; - } -} - - -// Checkbox and radio options -// -// In order to support the browser's form validation feedback, powered by the -// `required` attribute, we have to "hide" the inputs via `clip`. We cannot use -// `display: none;` or `visibility: hidden;` as that also hides the popover. -// Simply visually hiding the inputs via `opacity` would leave them clickable in -// certain cases which is prevented by using `clip` and `pointer-events`. -// This way, we ensure a DOM element is visible to position the popover from. -// -// See https://github.com/twbs/bootstrap/pull/12794 and -// https://github.com/twbs/bootstrap/pull/14559 for more information. - -[data-toggle="buttons"] { - > .btn, - > .btn-group > .btn { - input[type="radio"], - input[type="checkbox"] { - position: absolute; - clip: rect(0,0,0,0); - pointer-events: none; - } - } -} diff --git a/resources/assets/less/bootstrap/buttons.less b/resources/assets/less/bootstrap/buttons.less deleted file mode 100644 index 40553c6..0000000 --- a/resources/assets/less/bootstrap/buttons.less +++ /dev/null @@ -1,160 +0,0 @@ -// -// Buttons -// -------------------------------------------------- - - -// Base styles -// -------------------------------------------------- - -.btn { - display: inline-block; - margin-bottom: 0; // For input.btn - font-weight: @btn-font-weight; - text-align: center; - vertical-align: middle; - touch-action: manipulation; - cursor: pointer; - background-image: none; // Reset unusual Firefox-on-Android default style; see https://github.com/necolas/normalize.css/issues/214 - border: 1px solid transparent; - white-space: nowrap; - .button-size(@padding-base-vertical; @padding-base-horizontal; @font-size-base; @line-height-base; @border-radius-base); - .user-select(none); - - &, - &:active, - &.active { - &:focus, - &.focus { - .tab-focus(); - } - } - - &:hover, - &:focus, - &.focus { - color: @btn-default-color; - text-decoration: none; - } - - &:active, - &.active { - outline: 0; - background-image: none; - .box-shadow(inset 0 3px 5px rgba(0,0,0,.125)); - } - - &.disabled, - &[disabled], - fieldset[disabled] & { - cursor: @cursor-disabled; - pointer-events: none; // Future-proof disabling of clicks - .opacity(.65); - .box-shadow(none); - } -} - - -// Alternate buttons -// -------------------------------------------------- - -.btn-default { - .button-variant(@btn-default-color; @btn-default-bg; @btn-default-border); -} -.btn-primary { - .button-variant(@btn-primary-color; @btn-primary-bg; @btn-primary-border); -} -// Success appears as green -.btn-success { - .button-variant(@btn-success-color; @btn-success-bg; @btn-success-border); -} -// Info appears as blue-green -.btn-info { - .button-variant(@btn-info-color; @btn-info-bg; @btn-info-border); -} -// Warning appears as orange -.btn-warning { - .button-variant(@btn-warning-color; @btn-warning-bg; @btn-warning-border); -} -// Danger and error appear as red -.btn-danger { - .button-variant(@btn-danger-color; @btn-danger-bg; @btn-danger-border); -} - - -// Link buttons -// ------------------------- - -// Make a button look and behave like a link -.btn-link { - color: @link-color; - font-weight: normal; - border-radius: 0; - - &, - &:active, - &.active, - &[disabled], - fieldset[disabled] & { - background-color: transparent; - .box-shadow(none); - } - &, - &:hover, - &:focus, - &:active { - border-color: transparent; - } - &:hover, - &:focus { - color: @link-hover-color; - text-decoration: underline; - background-color: transparent; - } - &[disabled], - fieldset[disabled] & { - &:hover, - &:focus { - color: @btn-link-disabled-color; - text-decoration: none; - } - } -} - - -// Button Sizes -// -------------------------------------------------- - -.btn-lg { - // line-height: ensure even-numbered height of button next to large input - .button-size(@padding-large-vertical; @padding-large-horizontal; @font-size-large; @line-height-large; @border-radius-large); -} -.btn-sm { - // line-height: ensure proper height of button next to small input - .button-size(@padding-small-vertical; @padding-small-horizontal; @font-size-small; @line-height-small; @border-radius-small); -} -.btn-xs { - .button-size(@padding-xs-vertical; @padding-xs-horizontal; @font-size-small; @line-height-small; @border-radius-small); -} - - -// Block button -// -------------------------------------------------- - -.btn-block { - display: block; - width: 100%; -} - -// Vertically space out multiple block buttons -.btn-block + .btn-block { - margin-top: 5px; -} - -// Specificity overrides -input[type="submit"], -input[type="reset"], -input[type="button"] { - &.btn-block { - width: 100%; - } -} diff --git a/resources/assets/less/bootstrap/carousel.less b/resources/assets/less/bootstrap/carousel.less deleted file mode 100644 index 5724d8a..0000000 --- a/resources/assets/less/bootstrap/carousel.less +++ /dev/null @@ -1,267 +0,0 @@ -// -// Carousel -// -------------------------------------------------- - - -// Wrapper for the slide container and indicators -.carousel { - position: relative; -} - -.carousel-inner { - position: relative; - overflow: hidden; - width: 100%; - - > .item { - display: none; - position: relative; - .transition(.6s ease-in-out left); - - // Account for jankitude on images - > img, - > a > img { - &:extend(.img-responsive); - line-height: 1; - } - - // WebKit CSS3 transforms for supported devices - @media all and (transform-3d), (-webkit-transform-3d) { - transition: transform .6s ease-in-out; - backface-visibility: hidden; - perspective: 1000; - - &.next, - &.active.right { - transform: translate3d(100%, 0, 0); - left: 0; - } - &.prev, - &.active.left { - transform: translate3d(-100%, 0, 0); - left: 0; - } - &.next.left, - &.prev.right, - &.active { - transform: translate3d(0, 0, 0); - left: 0; - } - } - } - - > .active, - > .next, - > .prev { - display: block; - } - - > .active { - left: 0; - } - - > .next, - > .prev { - position: absolute; - top: 0; - width: 100%; - } - - > .next { - left: 100%; - } - > .prev { - left: -100%; - } - > .next.left, - > .prev.right { - left: 0; - } - - > .active.left { - left: -100%; - } - > .active.right { - left: 100%; - } - -} - -// Left/right controls for nav -// --------------------------- - -.carousel-control { - position: absolute; - top: 0; - left: 0; - bottom: 0; - width: @carousel-control-width; - .opacity(@carousel-control-opacity); - font-size: @carousel-control-font-size; - color: @carousel-control-color; - text-align: center; - text-shadow: @carousel-text-shadow; - // We can't have this transition here because WebKit cancels the carousel - // animation if you trip this while in the middle of another animation. - - // Set gradients for backgrounds - &.left { - #gradient > .horizontal(@start-color: rgba(0,0,0,.5); @end-color: rgba(0,0,0,.0001)); - } - &.right { - left: auto; - right: 0; - #gradient > .horizontal(@start-color: rgba(0,0,0,.0001); @end-color: rgba(0,0,0,.5)); - } - - // Hover/focus state - &:hover, - &:focus { - outline: 0; - color: @carousel-control-color; - text-decoration: none; - .opacity(.9); - } - - // Toggles - .icon-prev, - .icon-next, - .glyphicon-chevron-left, - .glyphicon-chevron-right { - position: absolute; - top: 50%; - z-index: 5; - display: inline-block; - } - .icon-prev, - .glyphicon-chevron-left { - left: 50%; - margin-left: -10px; - } - .icon-next, - .glyphicon-chevron-right { - right: 50%; - margin-right: -10px; - } - .icon-prev, - .icon-next { - width: 20px; - height: 20px; - margin-top: -10px; - font-family: serif; - } - - - .icon-prev { - &:before { - content: '\2039';// SINGLE LEFT-POINTING ANGLE QUOTATION MARK (U+2039) - } - } - .icon-next { - &:before { - content: '\203a';// SINGLE RIGHT-POINTING ANGLE QUOTATION MARK (U+203A) - } - } -} - -// Optional indicator pips -// -// Add an unordered list with the following class and add a list item for each -// slide your carousel holds. - -.carousel-indicators { - position: absolute; - bottom: 10px; - left: 50%; - z-index: 15; - width: 60%; - margin-left: -30%; - padding-left: 0; - list-style: none; - text-align: center; - - li { - display: inline-block; - width: 10px; - height: 10px; - margin: 1px; - text-indent: -999px; - border: 1px solid @carousel-indicator-border-color; - border-radius: 10px; - cursor: pointer; - - // IE8-9 hack for event handling - // - // Internet Explorer 8-9 does not support clicks on elements without a set - // `background-color`. We cannot use `filter` since that's not viewed as a - // background color by the browser. Thus, a hack is needed. - // - // For IE8, we set solid black as it doesn't support `rgba()`. For IE9, we - // set alpha transparency for the best results possible. - background-color: #000 \9; // IE8 - background-color: rgba(0,0,0,0); // IE9 - } - .active { - margin: 0; - width: 12px; - height: 12px; - background-color: @carousel-indicator-active-bg; - } -} - -// Optional captions -// ----------------------------- -// Hidden by default for smaller viewports -.carousel-caption { - position: absolute; - left: 15%; - right: 15%; - bottom: 20px; - z-index: 10; - padding-top: 20px; - padding-bottom: 20px; - color: @carousel-caption-color; - text-align: center; - text-shadow: @carousel-text-shadow; - & .btn { - text-shadow: none; // No shadow for button elements in carousel-caption - } -} - - -// Scale up controls for tablets and up -@media screen and (min-width: @screen-sm-min) { - - // Scale up the controls a smidge - .carousel-control { - .glyphicon-chevron-left, - .glyphicon-chevron-right, - .icon-prev, - .icon-next { - width: 30px; - height: 30px; - margin-top: -15px; - font-size: 30px; - } - .glyphicon-chevron-left, - .icon-prev { - margin-left: -15px; - } - .glyphicon-chevron-right, - .icon-next { - margin-right: -15px; - } - } - - // Show and left align the captions - .carousel-caption { - left: 20%; - right: 20%; - padding-bottom: 30px; - } - - // Move up the indicators - .carousel-indicators { - bottom: 20px; - } -} diff --git a/resources/assets/less/bootstrap/close.less b/resources/assets/less/bootstrap/close.less deleted file mode 100644 index 9b4e74f..0000000 --- a/resources/assets/less/bootstrap/close.less +++ /dev/null @@ -1,33 +0,0 @@ -// -// Close icons -// -------------------------------------------------- - - -.close { - float: right; - font-size: (@font-size-base * 1.5); - font-weight: @close-font-weight; - line-height: 1; - color: @close-color; - text-shadow: @close-text-shadow; - .opacity(.2); - - &:hover, - &:focus { - color: @close-color; - text-decoration: none; - cursor: pointer; - .opacity(.5); - } - - // Additional properties for button version - // iOS requires the button element instead of an anchor tag. - // If you want the anchor version, it requires `href="#"`. - button& { - padding: 0; - cursor: pointer; - background: transparent; - border: 0; - -webkit-appearance: none; - } -} diff --git a/resources/assets/less/bootstrap/code.less b/resources/assets/less/bootstrap/code.less deleted file mode 100644 index a08b4d4..0000000 --- a/resources/assets/less/bootstrap/code.less +++ /dev/null @@ -1,69 +0,0 @@ -// -// Code (inline and block) -// -------------------------------------------------- - - -// Inline and block code styles -code, -kbd, -pre, -samp { - font-family: @font-family-monospace; -} - -// Inline code -code { - padding: 2px 4px; - font-size: 90%; - color: @code-color; - background-color: @code-bg; - border-radius: @border-radius-base; -} - -// User input typically entered via keyboard -kbd { - padding: 2px 4px; - font-size: 90%; - color: @kbd-color; - background-color: @kbd-bg; - border-radius: @border-radius-small; - box-shadow: inset 0 -1px 0 rgba(0,0,0,.25); - - kbd { - padding: 0; - font-size: 100%; - font-weight: bold; - box-shadow: none; - } -} - -// Blocks of code -pre { - display: block; - padding: ((@line-height-computed - 1) / 2); - margin: 0 0 (@line-height-computed / 2); - font-size: (@font-size-base - 1); // 14px to 13px - line-height: @line-height-base; - word-break: break-all; - word-wrap: break-word; - color: @pre-color; - background-color: @pre-bg; - border: 1px solid @pre-border-color; - border-radius: @border-radius-base; - - // Account for some code outputs that place code tags in pre tags - code { - padding: 0; - font-size: inherit; - color: inherit; - white-space: pre-wrap; - background-color: transparent; - border-radius: 0; - } -} - -// Enable scrollable blocks of code -.pre-scrollable { - max-height: @pre-scrollable-max-height; - overflow-y: scroll; -} diff --git a/resources/assets/less/bootstrap/component-animations.less b/resources/assets/less/bootstrap/component-animations.less deleted file mode 100644 index 967715d..0000000 --- a/resources/assets/less/bootstrap/component-animations.less +++ /dev/null @@ -1,34 +0,0 @@ -// -// Component animations -// -------------------------------------------------- - -// Heads up! -// -// We don't use the `.opacity()` mixin here since it causes a bug with text -// fields in IE7-8. Source: https://github.com/twbs/bootstrap/pull/3552. - -.fade { - opacity: 0; - .transition(opacity .15s linear); - &.in { - opacity: 1; - } -} - -.collapse { - display: none; - visibility: hidden; - - &.in { display: block; visibility: visible; } - tr&.in { display: table-row; } - tbody&.in { display: table-row-group; } -} - -.collapsing { - position: relative; - height: 0; - overflow: hidden; - .transition-property(~"height, visibility"); - .transition-duration(.35s); - .transition-timing-function(ease); -} diff --git a/resources/assets/less/bootstrap/dropdowns.less b/resources/assets/less/bootstrap/dropdowns.less deleted file mode 100644 index 84a48c1..0000000 --- a/resources/assets/less/bootstrap/dropdowns.less +++ /dev/null @@ -1,213 +0,0 @@ -// -// Dropdown menus -// -------------------------------------------------- - - -// Dropdown arrow/caret -.caret { - display: inline-block; - width: 0; - height: 0; - margin-left: 2px; - vertical-align: middle; - border-top: @caret-width-base solid; - border-right: @caret-width-base solid transparent; - border-left: @caret-width-base solid transparent; -} - -// The dropdown wrapper (div) -.dropdown { - position: relative; -} - -// Prevent the focus on the dropdown toggle when closing dropdowns -.dropdown-toggle:focus { - outline: 0; -} - -// The dropdown menu (ul) -.dropdown-menu { - position: absolute; - top: 100%; - left: 0; - z-index: @zindex-dropdown; - display: none; // none by default, but block on "open" of the menu - float: left; - min-width: 160px; - padding: 5px 0; - margin: 2px 0 0; // override default ul - list-style: none; - font-size: @font-size-base; - text-align: left; // Ensures proper alignment if parent has it changed (e.g., modal footer) - background-color: @dropdown-bg; - border: 1px solid @dropdown-fallback-border; // IE8 fallback - border: 1px solid @dropdown-border; - border-radius: @border-radius-base; - .box-shadow(0 6px 12px rgba(0,0,0,.175)); - background-clip: padding-box; - - // Aligns the dropdown menu to right - // - // Deprecated as of 3.1.0 in favor of `.dropdown-menu-[dir]` - &.pull-right { - right: 0; - left: auto; - } - - // Dividers (basically an hr) within the dropdown - .divider { - .nav-divider(@dropdown-divider-bg); - } - - // Links within the dropdown menu - > li > a { - display: block; - padding: 3px 20px; - clear: both; - font-weight: normal; - line-height: @line-height-base; - color: @dropdown-link-color; - white-space: nowrap; // prevent links from randomly breaking onto new lines - } -} - -// Hover/Focus state -.dropdown-menu > li > a { - &:hover, - &:focus { - text-decoration: none; - color: @dropdown-link-hover-color; - background-color: @dropdown-link-hover-bg; - } -} - -// Active state -.dropdown-menu > .active > a { - &, - &:hover, - &:focus { - color: @dropdown-link-active-color; - text-decoration: none; - outline: 0; - background-color: @dropdown-link-active-bg; - } -} - -// Disabled state -// -// Gray out text and ensure the hover/focus state remains gray - -.dropdown-menu > .disabled > a { - &, - &:hover, - &:focus { - color: @dropdown-link-disabled-color; - } - - // Nuke hover/focus effects - &:hover, - &:focus { - text-decoration: none; - background-color: transparent; - background-image: none; // Remove CSS gradient - .reset-filter(); - cursor: @cursor-disabled; - } -} - -// Open state for the dropdown -.open { - // Show the menu - > .dropdown-menu { - display: block; - } - - // Remove the outline when :focus is triggered - > a { - outline: 0; - } -} - -// Menu positioning -// -// Add extra class to `.dropdown-menu` to flip the alignment of the dropdown -// menu with the parent. -.dropdown-menu-right { - left: auto; // Reset the default from `.dropdown-menu` - right: 0; -} -// With v3, we enabled auto-flipping if you have a dropdown within a right -// aligned nav component. To enable the undoing of that, we provide an override -// to restore the default dropdown menu alignment. -// -// This is only for left-aligning a dropdown menu within a `.navbar-right` or -// `.pull-right` nav component. -.dropdown-menu-left { - left: 0; - right: auto; -} - -// Dropdown section headers -.dropdown-header { - display: block; - padding: 3px 20px; - font-size: @font-size-small; - line-height: @line-height-base; - color: @dropdown-header-color; - white-space: nowrap; // as with > li > a -} - -// Backdrop to catch body clicks on mobile, etc. -.dropdown-backdrop { - position: fixed; - left: 0; - right: 0; - bottom: 0; - top: 0; - z-index: (@zindex-dropdown - 10); -} - -// Right aligned dropdowns -.pull-right > .dropdown-menu { - right: 0; - left: auto; -} - -// Allow for dropdowns to go bottom up (aka, dropup-menu) -// -// Just add .dropup after the standard .dropdown class and you're set, bro. -// TODO: abstract this so that the navbar fixed styles are not placed here? - -.dropup, -.navbar-fixed-bottom .dropdown { - // Reverse the caret - .caret { - border-top: 0; - border-bottom: @caret-width-base solid; - content: ""; - } - // Different positioning for bottom up menu - .dropdown-menu { - top: auto; - bottom: 100%; - margin-bottom: 1px; - } -} - - -// Component alignment -// -// Reiterate per navbar.less and the modified component alignment there. - -@media (min-width: @grid-float-breakpoint) { - .navbar-right { - .dropdown-menu { - .dropdown-menu-right(); - } - // Necessary for overrides of the default right aligned menu. - // Will remove come v4 in all likelihood. - .dropdown-menu-left { - .dropdown-menu-left(); - } - } -} diff --git a/resources/assets/less/bootstrap/forms.less b/resources/assets/less/bootstrap/forms.less deleted file mode 100644 index 1bcc2b6..0000000 --- a/resources/assets/less/bootstrap/forms.less +++ /dev/null @@ -1,546 +0,0 @@ -// -// Forms -// -------------------------------------------------- - - -// Normalize non-controls -// -// Restyle and baseline non-control form elements. - -fieldset { - padding: 0; - margin: 0; - border: 0; - // Chrome and Firefox set a `min-width: min-content;` on fieldsets, - // so we reset that to ensure it behaves more like a standard block element. - // See https://github.com/twbs/bootstrap/issues/12359. - min-width: 0; -} - -legend { - display: block; - width: 100%; - padding: 0; - margin-bottom: @line-height-computed; - font-size: (@font-size-base * 1.5); - line-height: inherit; - color: @legend-color; - border: 0; - border-bottom: 1px solid @legend-border-color; -} - -label { - display: inline-block; - max-width: 100%; // Force IE8 to wrap long content (see https://github.com/twbs/bootstrap/issues/13141) - margin-bottom: 5px; - font-weight: bold; -} - - -// Normalize form controls -// -// While most of our form styles require extra classes, some basic normalization -// is required to ensure optimum display with or without those classes to better -// address browser inconsistencies. - -// Override content-box in Normalize (* isn't specific enough) -input[type="search"] { - .box-sizing(border-box); -} - -// Position radios and checkboxes better -input[type="radio"], -input[type="checkbox"] { - margin: 4px 0 0; - margin-top: 1px \9; // IE8-9 - line-height: normal; -} - -// Set the height of file controls to match text inputs -input[type="file"] { - display: block; -} - -// Make range inputs behave like textual form controls -input[type="range"] { - display: block; - width: 100%; -} - -// Make multiple select elements height not fixed -select[multiple], -select[size] { - height: auto; -} - -// Focus for file, radio, and checkbox -input[type="file"]:focus, -input[type="radio"]:focus, -input[type="checkbox"]:focus { - .tab-focus(); -} - -// Adjust output element -output { - display: block; - padding-top: (@padding-base-vertical + 1); - font-size: @font-size-base; - line-height: @line-height-base; - color: @input-color; -} - - -// Common form controls -// -// Shared size and type resets for form controls. Apply `.form-control` to any -// of the following form controls: -// -// select -// textarea -// input[type="text"] -// input[type="password"] -// input[type="datetime"] -// input[type="datetime-local"] -// input[type="date"] -// input[type="month"] -// input[type="time"] -// input[type="week"] -// input[type="number"] -// input[type="email"] -// input[type="url"] -// input[type="search"] -// input[type="tel"] -// input[type="color"] - -.form-control { - display: block; - width: 100%; - height: @input-height-base; // Make inputs at least the height of their button counterpart (base line-height + padding + border) - padding: @padding-base-vertical @padding-base-horizontal; - font-size: @font-size-base; - line-height: @line-height-base; - color: @input-color; - background-color: @input-bg; - background-image: none; // Reset unusual Firefox-on-Android default style; see https://github.com/necolas/normalize.css/issues/214 - border: 1px solid @input-border; - border-radius: @input-border-radius; - .box-shadow(inset 0 1px 1px rgba(0,0,0,.075)); - .transition(~"border-color ease-in-out .15s, box-shadow ease-in-out .15s"); - - // Customize the `:focus` state to imitate native WebKit styles. - .form-control-focus(); - - // Placeholder - .placeholder(); - - // Disabled and read-only inputs - // - // HTML5 says that controls under a fieldset > legend:first-child won't be - // disabled if the fieldset is disabled. Due to implementation difficulty, we - // don't honor that edge case; we style them as disabled anyway. - &[disabled], - &[readonly], - fieldset[disabled] & { - cursor: @cursor-disabled; - background-color: @input-bg-disabled; - opacity: 1; // iOS fix for unreadable disabled content - } - - // Reset height for `textarea`s - textarea& { - height: auto; - } -} - - -// Search inputs in iOS -// -// This overrides the extra rounded corners on search inputs in iOS so that our -// `.form-control` class can properly style them. Note that this cannot simply -// be added to `.form-control` as it's not specific enough. For details, see -// https://github.com/twbs/bootstrap/issues/11586. - -input[type="search"] { - -webkit-appearance: none; -} - - -// Special styles for iOS temporal inputs -// -// In Mobile Safari, setting `display: block` on temporal inputs causes the -// text within the input to become vertically misaligned. As a workaround, we -// set a pixel line-height that matches the given height of the input, but only -// for Safari. - -@media screen and (-webkit-min-device-pixel-ratio: 0) { - input[type="date"], - input[type="time"], - input[type="datetime-local"], - input[type="month"] { - line-height: @input-height-base; - } - input[type="date"].input-sm, - input[type="time"].input-sm, - input[type="datetime-local"].input-sm, - input[type="month"].input-sm { - line-height: @input-height-small; - } - input[type="date"].input-lg, - input[type="time"].input-lg, - input[type="datetime-local"].input-lg, - input[type="month"].input-lg { - line-height: @input-height-large; - } -} - - -// Form groups -// -// Designed to help with the organization and spacing of vertical forms. For -// horizontal forms, use the predefined grid classes. - -.form-group { - margin-bottom: 15px; -} - - -// Checkboxes and radios -// -// Indent the labels to position radios/checkboxes as hanging controls. - -.radio, -.checkbox { - position: relative; - display: block; - margin-top: 10px; - margin-bottom: 10px; - - label { - min-height: @line-height-computed; // Ensure the input doesn't jump when there is no text - padding-left: 20px; - margin-bottom: 0; - font-weight: normal; - cursor: pointer; - } -} -.radio input[type="radio"], -.radio-inline input[type="radio"], -.checkbox input[type="checkbox"], -.checkbox-inline input[type="checkbox"] { - position: absolute; - margin-left: -20px; - margin-top: 4px \9; -} - -.radio + .radio, -.checkbox + .checkbox { - margin-top: -5px; // Move up sibling radios or checkboxes for tighter spacing -} - -// Radios and checkboxes on same line -.radio-inline, -.checkbox-inline { - display: inline-block; - padding-left: 20px; - margin-bottom: 0; - vertical-align: middle; - font-weight: normal; - cursor: pointer; -} -.radio-inline + .radio-inline, -.checkbox-inline + .checkbox-inline { - margin-top: 0; - margin-left: 10px; // space out consecutive inline controls -} - -// Apply same disabled cursor tweak as for inputs -// Some special care is needed because