From 5310d48e1dc13553cad53ad4c325d17f836a6f12 Mon Sep 17 00:00:00 2001 From: Titus Kirch Date: Tue, 24 Oct 2023 15:35:44 +0200 Subject: [PATCH] Implement portals import (#77) * Implement portals import * Update img field (add dependencie to change cols) * Save image by portals * Use S3 image * Add portal env vars * Fix test to new feature * Fix casee of import * feat: add devcontainer (#75) * Implement portals import * Update composer file * fix(app/PortalsController): remove merge conflict marks --------- Co-authored-by: Simon Ostendorf --- .env.example | 6 +- app/Http/Controllers/PortalsController.php | 128 +++++ app/Http/Middleware/Vpn.php | 7 +- app/Http/Middleware/VpnOrPerson.php | 9 +- app/Models/Person.php | 4 +- app/Utils/Telegram.php | 2 +- composer.json | 1 + composer.lock | 455 ++++++++++++++++-- ...2021_10_23_133727_create_persons_table.php | 2 +- ..._20_163214_update_img_in_persons_table.php | 34 ++ public/js/app.js | 67 ++- resources/js/Pages/App/Index.vue | 3 + resources/js/app.js | 2 + resources/js/components/PersonCard.vue | 3 + routes/web.php | 3 + tests/Feature/ExampleTest.php | 2 +- 16 files changed, 653 insertions(+), 75 deletions(-) create mode 100644 app/Http/Controllers/PortalsController.php create mode 100644 database/migrations/2023_10_20_163214_update_img_in_persons_table.php diff --git a/.env.example b/.env.example index 8235490..e2ec3a2 100644 --- a/.env.example +++ b/.env.example @@ -3,7 +3,11 @@ APP_ENV=local APP_KEY= APP_DEBUG=true APP_URL=http://localhost -APP_VPN_IP=127.0.0.1 +APP_IS_VPN=false + +APP_PORTALS_URL=http://127.0.0.1:8000 +APP_PORTALS_API_SECRET=secret +APP_PORTALS_IMPORT_PW=123 TELEGRAM_BOT_TOKEN= TELEGRAM_BOT_INFO_CHANNEL_ID= diff --git a/app/Http/Controllers/PortalsController.php b/app/Http/Controllers/PortalsController.php new file mode 100644 index 0000000..cf8af7f --- /dev/null +++ b/app/Http/Controllers/PortalsController.php @@ -0,0 +1,128 @@ +validateRequest($request->password)) { + return response()->json([ + 'message' => 'Unauthorized' + ], 401); + } + + + // call APP_PORTALS_URL + $client = new Client(); + $response = $client->request('GET', env('APP_PORTALS_URL') . '/api/v1/users', [ + 'headers' => [ + 'Authorization' => env('APP_PORTALS_API_SECRET') + ] + ]); + + // get status code + $statusCode = $response->getStatusCode(); + + if($statusCode != 200) { + return response()->json([ + 'message' => 'Unauthorized', + 'status' => $statusCode + ], 401); + } + + // get body + $body = $response->getBody()->getContents(); + + // get users + $users = json_decode($body, true)['users']; + + // loop through users + foreach($users as $user) { + // check if Person with id exists if not create new Person + $person = Person::firstOrNew(['id' => $user['id']]); + + // set attributes + if($person->id == null) { + $person->id = $user['id']; + } + $person->firstname = $user['firstname']; + $person->lastname = $user['lastname']; + $person->email = $user['email']; + + // check if course is set + if(isset($user['course'])) { + $abbreviation = strtoupper($user['course']['abbreviation']); + + // add fallbacks for other courses if abbreviation is not INF, ET, WI, DIB or MCD + if(!in_array($abbreviation, ['INF', 'ET', 'WI', 'DIB', 'MCD'])) { + if($abbreviation == 'SBE') { + $abbreviation = 'ET'; + } else if($abbreviation == 'ET-MASTER') { + $abbreviation = 'ET'; + } else if($abbreviation == 'ISE-MASTER') { + $abbreviation = 'INF'; + } else { + $abbreviation = 'INF'; + } + } + + $person->course = $abbreviation; + } + + // import image + $person->img = (!empty($user['avatarUrl']) ? $user['avatarUrl'] : ''); + + // cheeck roles + $roles = $user['roles']; + + // loop through roles + foreach($roles as $role) { + // check if role is tutor + if($role['name'] == 'tutor') { + $person->is_tutor = true; + } + // check if role is special + if($role['name'] == 'special') { + $person->is_special = true; + } + } + + // set is_disabled + $person->is_disabled = $user['is_disabled']; + + // save Person + $person->save(); + + } + + // return response + return response()->json([ + 'message' => 'User imported', + 'status' => $statusCode + ], 200); + } +} \ No newline at end of file diff --git a/app/Http/Middleware/Vpn.php b/app/Http/Middleware/Vpn.php index f371093..0b09cf3 100644 --- a/app/Http/Middleware/Vpn.php +++ b/app/Http/Middleware/Vpn.php @@ -18,12 +18,7 @@ class Vpn public function handle(Request $request, Closure $next) { // skip if not in production - if (app()->environment() !== 'production') { - return $next($request); - } - - - if (!$_SERVER['HTTP_X_REAL_IP'] || $_SERVER['HTTP_X_REAL_IP'] != env('APP_VPN_IP')) { + if (!env('APP_IS_VPN')) { return Redirect::route('error'); } diff --git a/app/Http/Middleware/VpnOrPerson.php b/app/Http/Middleware/VpnOrPerson.php index a001030..81abdb7 100644 --- a/app/Http/Middleware/VpnOrPerson.php +++ b/app/Http/Middleware/VpnOrPerson.php @@ -19,13 +19,8 @@ class VpnOrPerson public function handle(Request $request, Closure $next) { // skip if not in production - if (app()->environment() !== 'production') { - return $next($request); - } - - if (!$_SERVER['HTTP_X_REAL_IP'] || ($_SERVER['HTTP_X_REAL_IP'] != env('APP_VPN_IP') && - ($request->session()->missing('authToken') || - !Person::where('auth_token', $request->session()->get('authToken'))->count())) + if (!env('APP_IS_VPN') && ($request->session()->missing('authToken') || + !Person::where('auth_token', $request->session()->get('authToken'))->count()) ) { return Redirect::route('error'); } diff --git a/app/Models/Person.php b/app/Models/Person.php index 0935b8f..8988e54 100644 --- a/app/Models/Person.php +++ b/app/Models/Person.php @@ -47,8 +47,8 @@ class Person extends Model */ public function getImageAttribute() { - if (!empty($this->img) && file_exists(public_path() . '/images/' . $this->img)) { - return '/images/' . $this->img; + if (!empty($this->img)) { + return $this->img; } else { return '/images/default.jpg'; } diff --git a/app/Utils/Telegram.php b/app/Utils/Telegram.php index 5cfad26..eb74f70 100644 --- a/app/Utils/Telegram.php +++ b/app/Utils/Telegram.php @@ -64,7 +64,7 @@ public static function sendMessage(string $channelID, string $message = null, Re // parse output $output = ''; if ($request->ip()) { - $output .= '*IP:* `' . ($request->ip() == env('APP_VPN_IP') ? 'VPN' : $request->ip()) . '`' . PHP_EOL; + $output .= '*IP:* `' . (env('APP_IS_VPN') ? 'VPN' : $request->ip()) . '`' . PHP_EOL; } if ($person) { $output .= '*Person:* ' . $person->fullname . ' (ID: `' . $person->id . '`)' . PHP_EOL; diff --git a/composer.json b/composer.json index 7faa178..f5fe70e 100644 --- a/composer.json +++ b/composer.json @@ -6,6 +6,7 @@ "license": "MIT", "require": { "php": "^7.3|^8.0", + "doctrine/dbal": "^3.7", "fruitcake/laravel-cors": "^2.0", "guzzlehttp/guzzle": "^7.0.1", "inertiajs/inertia-laravel": "^0.4.4", diff --git a/composer.lock b/composer.lock index e972003..c53dada 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "c20fdf55a1fe02d3b2c3af84421c5b7f", + "content-hash": "766bcb4f650d940d4f58b316777511fd", "packages": [ { "name": "asm89/stack-cors", @@ -273,6 +273,350 @@ }, "time": "2022-10-27T11:44:00+00:00" }, + { + "name": "doctrine/cache", + "version": "2.2.0", + "source": { + "type": "git", + "url": "https://github.com/doctrine/cache.git", + "reference": "1ca8f21980e770095a31456042471a57bc4c68fb" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/doctrine/cache/zipball/1ca8f21980e770095a31456042471a57bc4c68fb", + "reference": "1ca8f21980e770095a31456042471a57bc4c68fb", + "shasum": "" + }, + "require": { + "php": "~7.1 || ^8.0" + }, + "conflict": { + "doctrine/common": ">2.2,<2.4" + }, + "require-dev": { + "cache/integration-tests": "dev-master", + "doctrine/coding-standard": "^9", + "phpunit/phpunit": "^7.5 || ^8.5 || ^9.5", + "psr/cache": "^1.0 || ^2.0 || ^3.0", + "symfony/cache": "^4.4 || ^5.4 || ^6", + "symfony/var-exporter": "^4.4 || ^5.4 || ^6" + }, + "type": "library", + "autoload": { + "psr-4": { + "Doctrine\\Common\\Cache\\": "lib/Doctrine/Common/Cache" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Guilherme Blanco", + "email": "guilhermeblanco@gmail.com" + }, + { + "name": "Roman Borschel", + "email": "roman@code-factory.org" + }, + { + "name": "Benjamin Eberlei", + "email": "kontakt@beberlei.de" + }, + { + "name": "Jonathan Wage", + "email": "jonwage@gmail.com" + }, + { + "name": "Johannes Schmitt", + "email": "schmittjoh@gmail.com" + } + ], + "description": "PHP Doctrine Cache library is a popular cache implementation that supports many different drivers such as redis, memcache, apc, mongodb and others.", + "homepage": "https://www.doctrine-project.org/projects/cache.html", + "keywords": [ + "abstraction", + "apcu", + "cache", + "caching", + "couchdb", + "memcached", + "php", + "redis", + "xcache" + ], + "support": { + "issues": "https://github.com/doctrine/cache/issues", + "source": "https://github.com/doctrine/cache/tree/2.2.0" + }, + "funding": [ + { + "url": "https://www.doctrine-project.org/sponsorship.html", + "type": "custom" + }, + { + "url": "https://www.patreon.com/phpdoctrine", + "type": "patreon" + }, + { + "url": "https://tidelift.com/funding/github/packagist/doctrine%2Fcache", + "type": "tidelift" + } + ], + "time": "2022-05-20T20:07:39+00:00" + }, + { + "name": "doctrine/dbal", + "version": "3.7.1", + "source": { + "type": "git", + "url": "https://github.com/doctrine/dbal.git", + "reference": "5b7bd66c9ff58c04c5474ab85edce442f8081cb2" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/doctrine/dbal/zipball/5b7bd66c9ff58c04c5474ab85edce442f8081cb2", + "reference": "5b7bd66c9ff58c04c5474ab85edce442f8081cb2", + "shasum": "" + }, + "require": { + "composer-runtime-api": "^2", + "doctrine/cache": "^1.11|^2.0", + "doctrine/deprecations": "^0.5.3|^1", + "doctrine/event-manager": "^1|^2", + "php": "^7.4 || ^8.0", + "psr/cache": "^1|^2|^3", + "psr/log": "^1|^2|^3" + }, + "require-dev": { + "doctrine/coding-standard": "12.0.0", + "fig/log-test": "^1", + "jetbrains/phpstorm-stubs": "2023.1", + "phpstan/phpstan": "1.10.35", + "phpstan/phpstan-strict-rules": "^1.5", + "phpunit/phpunit": "9.6.13", + "psalm/plugin-phpunit": "0.18.4", + "slevomat/coding-standard": "8.13.1", + "squizlabs/php_codesniffer": "3.7.2", + "symfony/cache": "^5.4|^6.0", + "symfony/console": "^4.4|^5.4|^6.0", + "vimeo/psalm": "4.30.0" + }, + "suggest": { + "symfony/console": "For helpful console commands such as SQL execution and import of files." + }, + "bin": [ + "bin/doctrine-dbal" + ], + "type": "library", + "autoload": { + "psr-4": { + "Doctrine\\DBAL\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Guilherme Blanco", + "email": "guilhermeblanco@gmail.com" + }, + { + "name": "Roman Borschel", + "email": "roman@code-factory.org" + }, + { + "name": "Benjamin Eberlei", + "email": "kontakt@beberlei.de" + }, + { + "name": "Jonathan Wage", + "email": "jonwage@gmail.com" + } + ], + "description": "Powerful PHP database abstraction layer (DBAL) with many features for database schema introspection and management.", + "homepage": "https://www.doctrine-project.org/projects/dbal.html", + "keywords": [ + "abstraction", + "database", + "db2", + "dbal", + "mariadb", + "mssql", + "mysql", + "oci8", + "oracle", + "pdo", + "pgsql", + "postgresql", + "queryobject", + "sasql", + "sql", + "sqlite", + "sqlserver", + "sqlsrv" + ], + "support": { + "issues": "https://github.com/doctrine/dbal/issues", + "source": "https://github.com/doctrine/dbal/tree/3.7.1" + }, + "funding": [ + { + "url": "https://www.doctrine-project.org/sponsorship.html", + "type": "custom" + }, + { + "url": "https://www.patreon.com/phpdoctrine", + "type": "patreon" + }, + { + "url": "https://tidelift.com/funding/github/packagist/doctrine%2Fdbal", + "type": "tidelift" + } + ], + "time": "2023-10-06T05:06:20+00:00" + }, + { + "name": "doctrine/deprecations", + "version": "1.1.2", + "source": { + "type": "git", + "url": "https://github.com/doctrine/deprecations.git", + "reference": "4f2d4f2836e7ec4e7a8625e75c6aa916004db931" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/doctrine/deprecations/zipball/4f2d4f2836e7ec4e7a8625e75c6aa916004db931", + "reference": "4f2d4f2836e7ec4e7a8625e75c6aa916004db931", + "shasum": "" + }, + "require": { + "php": "^7.1 || ^8.0" + }, + "require-dev": { + "doctrine/coding-standard": "^9", + "phpstan/phpstan": "1.4.10 || 1.10.15", + "phpstan/phpstan-phpunit": "^1.0", + "phpunit/phpunit": "^7.5 || ^8.5 || ^9.5", + "psalm/plugin-phpunit": "0.18.4", + "psr/log": "^1 || ^2 || ^3", + "vimeo/psalm": "4.30.0 || 5.12.0" + }, + "suggest": { + "psr/log": "Allows logging deprecations via PSR-3 logger implementation" + }, + "type": "library", + "autoload": { + "psr-4": { + "Doctrine\\Deprecations\\": "lib/Doctrine/Deprecations" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "description": "A small layer on top of trigger_error(E_USER_DEPRECATED) or PSR-3 logging with options to disable all deprecations or selectively for packages.", + "homepage": "https://www.doctrine-project.org/", + "support": { + "issues": "https://github.com/doctrine/deprecations/issues", + "source": "https://github.com/doctrine/deprecations/tree/1.1.2" + }, + "time": "2023-09-27T20:04:15+00:00" + }, + { + "name": "doctrine/event-manager", + "version": "2.0.0", + "source": { + "type": "git", + "url": "https://github.com/doctrine/event-manager.git", + "reference": "750671534e0241a7c50ea5b43f67e23eb5c96f32" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/doctrine/event-manager/zipball/750671534e0241a7c50ea5b43f67e23eb5c96f32", + "reference": "750671534e0241a7c50ea5b43f67e23eb5c96f32", + "shasum": "" + }, + "require": { + "php": "^8.1" + }, + "conflict": { + "doctrine/common": "<2.9" + }, + "require-dev": { + "doctrine/coding-standard": "^10", + "phpstan/phpstan": "^1.8.8", + "phpunit/phpunit": "^9.5", + "vimeo/psalm": "^4.28" + }, + "type": "library", + "autoload": { + "psr-4": { + "Doctrine\\Common\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Guilherme Blanco", + "email": "guilhermeblanco@gmail.com" + }, + { + "name": "Roman Borschel", + "email": "roman@code-factory.org" + }, + { + "name": "Benjamin Eberlei", + "email": "kontakt@beberlei.de" + }, + { + "name": "Jonathan Wage", + "email": "jonwage@gmail.com" + }, + { + "name": "Johannes Schmitt", + "email": "schmittjoh@gmail.com" + }, + { + "name": "Marco Pivetta", + "email": "ocramius@gmail.com" + } + ], + "description": "The Doctrine Event Manager is a simple PHP event system that was built to be used with the various Doctrine projects.", + "homepage": "https://www.doctrine-project.org/projects/event-manager.html", + "keywords": [ + "event", + "event dispatcher", + "event manager", + "event system", + "events" + ], + "support": { + "issues": "https://github.com/doctrine/event-manager/issues", + "source": "https://github.com/doctrine/event-manager/tree/2.0.0" + }, + "funding": [ + { + "url": "https://www.doctrine-project.org/sponsorship.html", + "type": "custom" + }, + { + "url": "https://www.patreon.com/phpdoctrine", + "type": "patreon" + }, + { + "url": "https://tidelift.com/funding/github/packagist/doctrine%2Fevent-manager", + "type": "tidelift" + } + ], + "time": "2022-10-12T20:59:15+00:00" + }, { "name": "doctrine/inflector", "version": "2.0.8", @@ -1933,16 +2277,16 @@ }, { "name": "league/mime-type-detection", - "version": "1.13.0", + "version": "1.14.0", "source": { "type": "git", "url": "https://github.com/thephpleague/mime-type-detection.git", - "reference": "a6dfb1194a2946fcdc1f38219445234f65b35c96" + "reference": "b6a5854368533df0295c5761a0253656a2e52d9e" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/thephpleague/mime-type-detection/zipball/a6dfb1194a2946fcdc1f38219445234f65b35c96", - "reference": "a6dfb1194a2946fcdc1f38219445234f65b35c96", + "url": "https://api.github.com/repos/thephpleague/mime-type-detection/zipball/b6a5854368533df0295c5761a0253656a2e52d9e", + "reference": "b6a5854368533df0295c5761a0253656a2e52d9e", "shasum": "" }, "require": { @@ -1973,7 +2317,7 @@ "description": "Mime-type detection for Flysystem", "support": { "issues": "https://github.com/thephpleague/mime-type-detection/issues", - "source": "https://github.com/thephpleague/mime-type-detection/tree/1.13.0" + "source": "https://github.com/thephpleague/mime-type-detection/tree/1.14.0" }, "funding": [ { @@ -1985,7 +2329,7 @@ "type": "tidelift" } ], - "time": "2023-08-05T12:09:49+00:00" + "time": "2023-10-17T14:13:20+00:00" }, { "name": "monolog/monolog", @@ -2539,6 +2883,55 @@ ], "time": "2023-02-25T19:38:58+00:00" }, + { + "name": "psr/cache", + "version": "3.0.0", + "source": { + "type": "git", + "url": "https://github.com/php-fig/cache.git", + "reference": "aa5030cfa5405eccfdcb1083ce040c2cb8d253bf" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-fig/cache/zipball/aa5030cfa5405eccfdcb1083ce040c2cb8d253bf", + "reference": "aa5030cfa5405eccfdcb1083ce040c2cb8d253bf", + "shasum": "" + }, + "require": { + "php": ">=8.0.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0.x-dev" + } + }, + "autoload": { + "psr-4": { + "Psr\\Cache\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "PHP-FIG", + "homepage": "https://www.php-fig.org/" + } + ], + "description": "Common interface for caching libraries", + "keywords": [ + "cache", + "psr", + "psr-6" + ], + "support": { + "source": "https://github.com/php-fig/cache/tree/3.0.0" + }, + "time": "2021-02-03T23:26:27+00:00" + }, { "name": "psr/clock", "version": "1.0.0", @@ -2948,16 +3341,16 @@ }, { "name": "psy/psysh", - "version": "v0.11.21", + "version": "v0.11.22", "source": { "type": "git", "url": "https://github.com/bobthecow/psysh.git", - "reference": "bcb22101107f3bf770523b65630c9d547f60c540" + "reference": "128fa1b608be651999ed9789c95e6e2a31b5802b" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/bobthecow/psysh/zipball/bcb22101107f3bf770523b65630c9d547f60c540", - "reference": "bcb22101107f3bf770523b65630c9d547f60c540", + "url": "https://api.github.com/repos/bobthecow/psysh/zipball/128fa1b608be651999ed9789c95e6e2a31b5802b", + "reference": "128fa1b608be651999ed9789c95e6e2a31b5802b", "shasum": "" }, "require": { @@ -2986,7 +3379,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-main": "0.11.x-dev" + "dev-0.11": "0.11.x-dev" }, "bamarni-bin": { "bin-links": false, @@ -3022,9 +3415,9 @@ ], "support": { "issues": "https://github.com/bobthecow/psysh/issues", - "source": "https://github.com/bobthecow/psysh/tree/v0.11.21" + "source": "https://github.com/bobthecow/psysh/tree/v0.11.22" }, - "time": "2023-09-17T21:15:54+00:00" + "time": "2023-10-14T21:56:36+00:00" }, { "name": "ralouphie/getallheaders", @@ -3253,7 +3646,7 @@ }, { "name": "spiral/core", - "version": "3.8.4", + "version": "3.9.0", "source": { "type": "git", "url": "https://github.com/spiral/core.git", @@ -3388,22 +3781,22 @@ }, { "name": "spiral/logger", - "version": "3.8.4", + "version": "3.9.0", "source": { "type": "git", "url": "https://github.com/spiral/logger.git", - "reference": "2825e5774ea9851e54127eadd4b7f8efb18355aa" + "reference": "6b3fce559c4d143b8c65653fe01bab9720af5be0" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/spiral/logger/zipball/2825e5774ea9851e54127eadd4b7f8efb18355aa", - "reference": "2825e5774ea9851e54127eadd4b7f8efb18355aa", + "url": "https://api.github.com/repos/spiral/logger/zipball/6b3fce559c4d143b8c65653fe01bab9720af5be0", + "reference": "6b3fce559c4d143b8c65653fe01bab9720af5be0", "shasum": "" }, "require": { "php": ">=8.1", "psr/log": "1 - 3", - "spiral/core": "^3.8.4" + "spiral/core": "^3.9" }, "require-dev": { "mockery/mockery": "^1.5", @@ -3449,7 +3842,7 @@ "issues": "https://github.com/spiral/framework/issues", "source": "https://github.com/spiral/logger" }, - "time": "2023-09-08T10:08:47+00:00" + "time": "2023-09-08T10:10:54+00:00" }, { "name": "spiral/roadrunner", @@ -3700,30 +4093,30 @@ }, { "name": "spiral/tokenizer", - "version": "3.8.4", + "version": "3.9.0", "source": { "type": "git", "url": "https://github.com/spiral/tokenizer.git", - "reference": "085145b5f7843a8482262eaad8cce34e3ab12be8" + "reference": "1da2c055e507fd2bc76b1ea3adc27ed4c222af5e" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/spiral/tokenizer/zipball/085145b5f7843a8482262eaad8cce34e3ab12be8", - "reference": "085145b5f7843a8482262eaad8cce34e3ab12be8", + "url": "https://api.github.com/repos/spiral/tokenizer/zipball/1da2c055e507fd2bc76b1ea3adc27ed4c222af5e", + "reference": "1da2c055e507fd2bc76b1ea3adc27ed4c222af5e", "shasum": "" }, "require": { "ext-tokenizer": "*", "php": ">=8.1", - "spiral/core": "^3.8.4", - "spiral/logger": "^3.8.4", + "spiral/core": "^3.9", + "spiral/logger": "^3.9", "symfony/finder": "^5.3.7|^6.0" }, "require-dev": { "phpunit/phpunit": "^10.1", "spiral/attributes": "^2.8|^3.0", - "spiral/boot": "^3.8.4", - "spiral/files": "^3.8.4", + "spiral/boot": "^3.9", + "spiral/files": "^3.9", "vimeo/psalm": "^5.9" }, "type": "library", @@ -3765,7 +4158,7 @@ "issues": "https://github.com/spiral/framework/issues", "source": "https://github.com/spiral/tokenizer" }, - "time": "2023-09-08T10:09:10+00:00" + "time": "2023-09-08T10:11:27+00:00" }, { "name": "swiftmailer/swiftmailer", @@ -8865,5 +9258,5 @@ "php": "^7.3|^8.0" }, "platform-dev": [], - "plugin-api-version": "2.6.0" + "plugin-api-version": "2.3.0" } diff --git a/database/migrations/2021_10_23_133727_create_persons_table.php b/database/migrations/2021_10_23_133727_create_persons_table.php index acb28b1..68be991 100644 --- a/database/migrations/2021_10_23_133727_create_persons_table.php +++ b/database/migrations/2021_10_23_133727_create_persons_table.php @@ -19,7 +19,7 @@ public function up() $table->string('firstname', 30)->nullable(False); $table->string('lastname', 30)->nullable(False); $table->string('email', 100)->nullable(False)->unique(); - $table->enum('course', ['ET', 'INF', 'MCD', 'WI'])->nullable(True)->default(null); + $table->enum('course', ['ET', 'INF', 'DIB', 'MCD', 'WI'])->nullable(True)->default(null); $table->string('img', 100); $table->boolean('is_tutor')->nullable(False)->default(False); $table->boolean('is_special')->nullable(False)->default(False); diff --git a/database/migrations/2023_10_20_163214_update_img_in_persons_table.php b/database/migrations/2023_10_20_163214_update_img_in_persons_table.php new file mode 100644 index 0000000..6baffc0 --- /dev/null +++ b/database/migrations/2023_10_20_163214_update_img_in_persons_table.php @@ -0,0 +1,34 @@ +string('img', 100); change to text + $table->text('img')->nullable(False)->change(); + + }); + } + + /** + * Reverse the migrations. + * + * @return void + */ + public function down() + { + Schema::table('persons', function (Blueprint $table) { + $table->string('img', 100)->nullable(False)->change(); + }); + } +} diff --git a/public/js/app.js b/public/js/app.js index 8a6fe8b..3b292dd 100644 --- a/public/js/app.js +++ b/public/js/app.js @@ -20413,6 +20413,8 @@ __webpack_require__.r(__webpack_exports__); return person.course === "ET"; } else if (filter.value === "wi") { return person.course === "WI"; + } else if (filter.value === "dib") { + return person.course === "DIB"; } else if (filter.value === "mcd") { return person.course === "MCD"; } else if (filter.value === "tutor") { @@ -20721,6 +20723,8 @@ __webpack_require__.r(__webpack_exports__); return 'hover:border-yellow-700'; } else if (props.person.course == 'WI') { return 'hover:border-green-700'; + } else if (props.person.course == 'DIB') { + return 'hover:border-fuchsia-700'; } else if (props.person.course == 'MCD') { return 'hover:border-purple-700'; } else { @@ -20826,13 +20830,22 @@ function render(_ctx, _cache, $props, $setup, $data, $options) { onClick: _cache[3] || (_cache[3] = function ($event) { return _ctx.filter = 'wi'; }) + }, null, 8 /* PROPS */, ["active"]), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)(_component_AppButton, { + title: "DIB", + bgColor: "bg-fuchsia-500 hover:bg-fuchsia-700", + bgColorActive: "bg-fuchsia-700", + icon: ['fas', 'briefcase'], + active: _ctx.filter == 'dib', + onClick: _cache[4] || (_cache[4] = function ($event) { + return _ctx.filter = 'dib'; + }) }, null, 8 /* PROPS */, ["active"]), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)(_component_AppButton, { title: "MCD", bgColor: "bg-purple-500 hover:bg-purple-700", bgColorActive: "bg-purple-700", icon: ['fas', 'paint-brush'], active: _ctx.filter == 'mcd', - onClick: _cache[4] || (_cache[4] = function ($event) { + onClick: _cache[5] || (_cache[5] = function ($event) { return _ctx.filter = 'mcd'; }) }, null, 8 /* PROPS */, ["active"]), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)(_component_AppButton, { @@ -20841,7 +20854,7 @@ function render(_ctx, _cache, $props, $setup, $data, $options) { bgColorActive: "bg-indigo-700", icon: ['fas', 'robot'], active: _ctx.filter == 'tutor', - onClick: _cache[5] || (_cache[5] = function ($event) { + onClick: _cache[6] || (_cache[6] = function ($event) { return _ctx.filter = 'tutor'; }) }, null, 8 /* PROPS */, ["active"]), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)(_component_AppButton, { @@ -20850,7 +20863,7 @@ function render(_ctx, _cache, $props, $setup, $data, $options) { bgColorActive: "bg-pink-700", icon: ['fas', 'star'], active: _ctx.filter == 'special', - onClick: _cache[6] || (_cache[6] = function ($event) { + onClick: _cache[7] || (_cache[7] = function ($event) { return _ctx.filter = 'special'; }) }, null, 8 /* PROPS */, ["active"])]), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("div", _hoisted_2, [((0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(true), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementBlock)(vue__WEBPACK_IMPORTED_MODULE_0__.Fragment, null, (0,vue__WEBPACK_IMPORTED_MODULE_0__.renderList)(_ctx.filteredPersons, function (person) { @@ -21208,16 +21221,20 @@ function render(_ctx, _cache, $props, $setup, $data, $options) { key: 2, bgColor: "bg-green-500", icon: ['fas', 'chart-line'] - })) : (0,vue__WEBPACK_IMPORTED_MODULE_0__.createCommentVNode)("v-if", true), _ctx.person.course == 'MCD' ? ((0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createBlock)(_component_PersonBadge, { + })) : (0,vue__WEBPACK_IMPORTED_MODULE_0__.createCommentVNode)("v-if", true), _ctx.person.course == 'DIB' ? ((0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createBlock)(_component_PersonBadge, { key: 3, + bgColor: "bg-fuchsia-500", + icon: ['fas', 'briefcase'] + })) : (0,vue__WEBPACK_IMPORTED_MODULE_0__.createCommentVNode)("v-if", true), _ctx.person.course == 'MCD' ? ((0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createBlock)(_component_PersonBadge, { + key: 4, bgColor: "bg-purple-500", icon: ['fas', 'paint-brush'] })) : (0,vue__WEBPACK_IMPORTED_MODULE_0__.createCommentVNode)("v-if", true), _ctx.person.is_tutor ? ((0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createBlock)(_component_PersonBadge, { - key: 4, + key: 5, bgColor: "bg-indigo-500", icon: ['fas', 'robot'] })) : (0,vue__WEBPACK_IMPORTED_MODULE_0__.createCommentVNode)("v-if", true), _ctx.person.is_special ? ((0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createBlock)(_component_PersonBadge, { - key: 5, + key: 6, bgColor: "bg-pink-500", icon: ['fas', 'star'] })) : (0,vue__WEBPACK_IMPORTED_MODULE_0__.createCommentVNode)("v-if", true)])], 2 /* CLASS */); @@ -21257,7 +21274,7 @@ __webpack_require__.r(__webpack_exports__); // fontawesome -_fortawesome_fontawesome_svg_core__WEBPACK_IMPORTED_MODULE_2__.library.add(_fortawesome_free_solid_svg_icons__WEBPACK_IMPORTED_MODULE_9__.faArrowLeft, _fortawesome_free_solid_svg_icons__WEBPACK_IMPORTED_MODULE_9__.faBeer, _fortawesome_free_solid_svg_icons__WEBPACK_IMPORTED_MODULE_9__.faBolt, _fortawesome_free_solid_svg_icons__WEBPACK_IMPORTED_MODULE_9__.faChartLine, _fortawesome_free_solid_svg_icons__WEBPACK_IMPORTED_MODULE_9__.faCode, _fortawesome_free_solid_svg_icons__WEBPACK_IMPORTED_MODULE_9__.faFaucet, _fortawesome_free_solid_svg_icons__WEBPACK_IMPORTED_MODULE_9__.faLemon, _fortawesome_free_solid_svg_icons__WEBPACK_IMPORTED_MODULE_9__.faPaintBrush, _fortawesome_free_solid_svg_icons__WEBPACK_IMPORTED_MODULE_9__.faQrcode, _fortawesome_free_solid_svg_icons__WEBPACK_IMPORTED_MODULE_9__.faRobot, _fortawesome_free_solid_svg_icons__WEBPACK_IMPORTED_MODULE_9__.faSignOutAlt, _fortawesome_free_solid_svg_icons__WEBPACK_IMPORTED_MODULE_9__.faStar, _fortawesome_free_solid_svg_icons__WEBPACK_IMPORTED_MODULE_9__.faUsers, _fortawesome_free_solid_svg_icons__WEBPACK_IMPORTED_MODULE_9__.faWineBottle); +_fortawesome_fontawesome_svg_core__WEBPACK_IMPORTED_MODULE_2__.library.add(_fortawesome_free_solid_svg_icons__WEBPACK_IMPORTED_MODULE_9__.faArrowLeft, _fortawesome_free_solid_svg_icons__WEBPACK_IMPORTED_MODULE_9__.faBeer, _fortawesome_free_solid_svg_icons__WEBPACK_IMPORTED_MODULE_9__.faBolt, _fortawesome_free_solid_svg_icons__WEBPACK_IMPORTED_MODULE_9__.faChartLine, _fortawesome_free_solid_svg_icons__WEBPACK_IMPORTED_MODULE_9__.faCode, _fortawesome_free_solid_svg_icons__WEBPACK_IMPORTED_MODULE_9__.faFaucet, _fortawesome_free_solid_svg_icons__WEBPACK_IMPORTED_MODULE_9__.faLemon, _fortawesome_free_solid_svg_icons__WEBPACK_IMPORTED_MODULE_9__.faPaintBrush, _fortawesome_free_solid_svg_icons__WEBPACK_IMPORTED_MODULE_9__.faQrcode, _fortawesome_free_solid_svg_icons__WEBPACK_IMPORTED_MODULE_9__.faRobot, _fortawesome_free_solid_svg_icons__WEBPACK_IMPORTED_MODULE_9__.faSignOutAlt, _fortawesome_free_solid_svg_icons__WEBPACK_IMPORTED_MODULE_9__.faStar, _fortawesome_free_solid_svg_icons__WEBPACK_IMPORTED_MODULE_9__.faUsers, _fortawesome_free_solid_svg_icons__WEBPACK_IMPORTED_MODULE_9__.faWineBottle, _fortawesome_free_solid_svg_icons__WEBPACK_IMPORTED_MODULE_9__.faBriefcase); _inertiajs_inertia__WEBPACK_IMPORTED_MODULE_7__.Inertia.on('start', function () { return nprogress__WEBPACK_IMPORTED_MODULE_8___default().start(); }); @@ -33186,13 +33203,13 @@ __webpack_require__.r(__webpack_exports__); /* harmony export */ }); /* harmony import */ var _Error_vue_vue_type_template_id_79269821__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./Error.vue?vue&type=template&id=79269821 */ "./resources/js/Pages/App/Error.vue?vue&type=template&id=79269821"); /* harmony import */ var _Error_vue_vue_type_script_lang_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./Error.vue?vue&type=script&lang=js */ "./resources/js/Pages/App/Error.vue?vue&type=script&lang=js"); -/* harmony import */ var _home_titus_projects_com_github_fsr5_fhaachen_strichlistensystem_node_modules_vue_loader_dist_exportHelper_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./node_modules/vue-loader/dist/exportHelper.js */ "./node_modules/vue-loader/dist/exportHelper.js"); +/* harmony import */ var _root_projects_comGithub_fsr5_fhaachen_strichlistensystem_node_modules_vue_loader_dist_exportHelper_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./node_modules/vue-loader/dist/exportHelper.js */ "./node_modules/vue-loader/dist/exportHelper.js"); ; -const __exports__ = /*#__PURE__*/(0,_home_titus_projects_com_github_fsr5_fhaachen_strichlistensystem_node_modules_vue_loader_dist_exportHelper_js__WEBPACK_IMPORTED_MODULE_2__["default"])(_Error_vue_vue_type_script_lang_js__WEBPACK_IMPORTED_MODULE_1__["default"], [['render',_Error_vue_vue_type_template_id_79269821__WEBPACK_IMPORTED_MODULE_0__.render],['__file',"resources/js/Pages/App/Error.vue"]]) +const __exports__ = /*#__PURE__*/(0,_root_projects_comGithub_fsr5_fhaachen_strichlistensystem_node_modules_vue_loader_dist_exportHelper_js__WEBPACK_IMPORTED_MODULE_2__["default"])(_Error_vue_vue_type_script_lang_js__WEBPACK_IMPORTED_MODULE_1__["default"], [['render',_Error_vue_vue_type_template_id_79269821__WEBPACK_IMPORTED_MODULE_0__.render],['__file',"resources/js/Pages/App/Error.vue"]]) /* hot reload */ if (false) {} @@ -33214,13 +33231,13 @@ __webpack_require__.r(__webpack_exports__); /* harmony export */ }); /* harmony import */ var _Index_vue_vue_type_template_id_356079eb__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./Index.vue?vue&type=template&id=356079eb */ "./resources/js/Pages/App/Index.vue?vue&type=template&id=356079eb"); /* harmony import */ var _Index_vue_vue_type_script_lang_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./Index.vue?vue&type=script&lang=js */ "./resources/js/Pages/App/Index.vue?vue&type=script&lang=js"); -/* harmony import */ var _home_titus_projects_com_github_fsr5_fhaachen_strichlistensystem_node_modules_vue_loader_dist_exportHelper_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./node_modules/vue-loader/dist/exportHelper.js */ "./node_modules/vue-loader/dist/exportHelper.js"); +/* harmony import */ var _root_projects_comGithub_fsr5_fhaachen_strichlistensystem_node_modules_vue_loader_dist_exportHelper_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./node_modules/vue-loader/dist/exportHelper.js */ "./node_modules/vue-loader/dist/exportHelper.js"); ; -const __exports__ = /*#__PURE__*/(0,_home_titus_projects_com_github_fsr5_fhaachen_strichlistensystem_node_modules_vue_loader_dist_exportHelper_js__WEBPACK_IMPORTED_MODULE_2__["default"])(_Index_vue_vue_type_script_lang_js__WEBPACK_IMPORTED_MODULE_1__["default"], [['render',_Index_vue_vue_type_template_id_356079eb__WEBPACK_IMPORTED_MODULE_0__.render],['__file',"resources/js/Pages/App/Index.vue"]]) +const __exports__ = /*#__PURE__*/(0,_root_projects_comGithub_fsr5_fhaachen_strichlistensystem_node_modules_vue_loader_dist_exportHelper_js__WEBPACK_IMPORTED_MODULE_2__["default"])(_Index_vue_vue_type_script_lang_js__WEBPACK_IMPORTED_MODULE_1__["default"], [['render',_Index_vue_vue_type_template_id_356079eb__WEBPACK_IMPORTED_MODULE_0__.render],['__file',"resources/js/Pages/App/Index.vue"]]) /* hot reload */ if (false) {} @@ -33242,13 +33259,13 @@ __webpack_require__.r(__webpack_exports__); /* harmony export */ }); /* harmony import */ var _Logout_vue_vue_type_template_id_2f0c8bc1__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./Logout.vue?vue&type=template&id=2f0c8bc1 */ "./resources/js/Pages/App/Logout.vue?vue&type=template&id=2f0c8bc1"); /* harmony import */ var _Logout_vue_vue_type_script_lang_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./Logout.vue?vue&type=script&lang=js */ "./resources/js/Pages/App/Logout.vue?vue&type=script&lang=js"); -/* harmony import */ var _home_titus_projects_com_github_fsr5_fhaachen_strichlistensystem_node_modules_vue_loader_dist_exportHelper_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./node_modules/vue-loader/dist/exportHelper.js */ "./node_modules/vue-loader/dist/exportHelper.js"); +/* harmony import */ var _root_projects_comGithub_fsr5_fhaachen_strichlistensystem_node_modules_vue_loader_dist_exportHelper_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./node_modules/vue-loader/dist/exportHelper.js */ "./node_modules/vue-loader/dist/exportHelper.js"); ; -const __exports__ = /*#__PURE__*/(0,_home_titus_projects_com_github_fsr5_fhaachen_strichlistensystem_node_modules_vue_loader_dist_exportHelper_js__WEBPACK_IMPORTED_MODULE_2__["default"])(_Logout_vue_vue_type_script_lang_js__WEBPACK_IMPORTED_MODULE_1__["default"], [['render',_Logout_vue_vue_type_template_id_2f0c8bc1__WEBPACK_IMPORTED_MODULE_0__.render],['__file',"resources/js/Pages/App/Logout.vue"]]) +const __exports__ = /*#__PURE__*/(0,_root_projects_comGithub_fsr5_fhaachen_strichlistensystem_node_modules_vue_loader_dist_exportHelper_js__WEBPACK_IMPORTED_MODULE_2__["default"])(_Logout_vue_vue_type_script_lang_js__WEBPACK_IMPORTED_MODULE_1__["default"], [['render',_Logout_vue_vue_type_template_id_2f0c8bc1__WEBPACK_IMPORTED_MODULE_0__.render],['__file',"resources/js/Pages/App/Logout.vue"]]) /* hot reload */ if (false) {} @@ -33270,13 +33287,13 @@ __webpack_require__.r(__webpack_exports__); /* harmony export */ }); /* harmony import */ var _Show_vue_vue_type_template_id_111b06fe__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./Show.vue?vue&type=template&id=111b06fe */ "./resources/js/Pages/Person/Show.vue?vue&type=template&id=111b06fe"); /* harmony import */ var _Show_vue_vue_type_script_lang_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./Show.vue?vue&type=script&lang=js */ "./resources/js/Pages/Person/Show.vue?vue&type=script&lang=js"); -/* harmony import */ var _home_titus_projects_com_github_fsr5_fhaachen_strichlistensystem_node_modules_vue_loader_dist_exportHelper_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./node_modules/vue-loader/dist/exportHelper.js */ "./node_modules/vue-loader/dist/exportHelper.js"); +/* harmony import */ var _root_projects_comGithub_fsr5_fhaachen_strichlistensystem_node_modules_vue_loader_dist_exportHelper_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./node_modules/vue-loader/dist/exportHelper.js */ "./node_modules/vue-loader/dist/exportHelper.js"); ; -const __exports__ = /*#__PURE__*/(0,_home_titus_projects_com_github_fsr5_fhaachen_strichlistensystem_node_modules_vue_loader_dist_exportHelper_js__WEBPACK_IMPORTED_MODULE_2__["default"])(_Show_vue_vue_type_script_lang_js__WEBPACK_IMPORTED_MODULE_1__["default"], [['render',_Show_vue_vue_type_template_id_111b06fe__WEBPACK_IMPORTED_MODULE_0__.render],['__file',"resources/js/Pages/Person/Show.vue"]]) +const __exports__ = /*#__PURE__*/(0,_root_projects_comGithub_fsr5_fhaachen_strichlistensystem_node_modules_vue_loader_dist_exportHelper_js__WEBPACK_IMPORTED_MODULE_2__["default"])(_Show_vue_vue_type_script_lang_js__WEBPACK_IMPORTED_MODULE_1__["default"], [['render',_Show_vue_vue_type_template_id_111b06fe__WEBPACK_IMPORTED_MODULE_0__.render],['__file',"resources/js/Pages/Person/Show.vue"]]) /* hot reload */ if (false) {} @@ -33298,13 +33315,13 @@ __webpack_require__.r(__webpack_exports__); /* harmony export */ }); /* harmony import */ var _AppButton_vue_vue_type_template_id_c9506d50__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./AppButton.vue?vue&type=template&id=c9506d50 */ "./resources/js/components/AppButton.vue?vue&type=template&id=c9506d50"); /* harmony import */ var _AppButton_vue_vue_type_script_lang_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./AppButton.vue?vue&type=script&lang=js */ "./resources/js/components/AppButton.vue?vue&type=script&lang=js"); -/* harmony import */ var _home_titus_projects_com_github_fsr5_fhaachen_strichlistensystem_node_modules_vue_loader_dist_exportHelper_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./node_modules/vue-loader/dist/exportHelper.js */ "./node_modules/vue-loader/dist/exportHelper.js"); +/* harmony import */ var _root_projects_comGithub_fsr5_fhaachen_strichlistensystem_node_modules_vue_loader_dist_exportHelper_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./node_modules/vue-loader/dist/exportHelper.js */ "./node_modules/vue-loader/dist/exportHelper.js"); ; -const __exports__ = /*#__PURE__*/(0,_home_titus_projects_com_github_fsr5_fhaachen_strichlistensystem_node_modules_vue_loader_dist_exportHelper_js__WEBPACK_IMPORTED_MODULE_2__["default"])(_AppButton_vue_vue_type_script_lang_js__WEBPACK_IMPORTED_MODULE_1__["default"], [['render',_AppButton_vue_vue_type_template_id_c9506d50__WEBPACK_IMPORTED_MODULE_0__.render],['__file',"resources/js/components/AppButton.vue"]]) +const __exports__ = /*#__PURE__*/(0,_root_projects_comGithub_fsr5_fhaachen_strichlistensystem_node_modules_vue_loader_dist_exportHelper_js__WEBPACK_IMPORTED_MODULE_2__["default"])(_AppButton_vue_vue_type_script_lang_js__WEBPACK_IMPORTED_MODULE_1__["default"], [['render',_AppButton_vue_vue_type_template_id_c9506d50__WEBPACK_IMPORTED_MODULE_0__.render],['__file',"resources/js/components/AppButton.vue"]]) /* hot reload */ if (false) {} @@ -33326,13 +33343,13 @@ __webpack_require__.r(__webpack_exports__); /* harmony export */ }); /* harmony import */ var _ArticleCard_vue_vue_type_template_id_26f16dea__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./ArticleCard.vue?vue&type=template&id=26f16dea */ "./resources/js/components/ArticleCard.vue?vue&type=template&id=26f16dea"); /* harmony import */ var _ArticleCard_vue_vue_type_script_lang_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./ArticleCard.vue?vue&type=script&lang=js */ "./resources/js/components/ArticleCard.vue?vue&type=script&lang=js"); -/* harmony import */ var _home_titus_projects_com_github_fsr5_fhaachen_strichlistensystem_node_modules_vue_loader_dist_exportHelper_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./node_modules/vue-loader/dist/exportHelper.js */ "./node_modules/vue-loader/dist/exportHelper.js"); +/* harmony import */ var _root_projects_comGithub_fsr5_fhaachen_strichlistensystem_node_modules_vue_loader_dist_exportHelper_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./node_modules/vue-loader/dist/exportHelper.js */ "./node_modules/vue-loader/dist/exportHelper.js"); ; -const __exports__ = /*#__PURE__*/(0,_home_titus_projects_com_github_fsr5_fhaachen_strichlistensystem_node_modules_vue_loader_dist_exportHelper_js__WEBPACK_IMPORTED_MODULE_2__["default"])(_ArticleCard_vue_vue_type_script_lang_js__WEBPACK_IMPORTED_MODULE_1__["default"], [['render',_ArticleCard_vue_vue_type_template_id_26f16dea__WEBPACK_IMPORTED_MODULE_0__.render],['__file',"resources/js/components/ArticleCard.vue"]]) +const __exports__ = /*#__PURE__*/(0,_root_projects_comGithub_fsr5_fhaachen_strichlistensystem_node_modules_vue_loader_dist_exportHelper_js__WEBPACK_IMPORTED_MODULE_2__["default"])(_ArticleCard_vue_vue_type_script_lang_js__WEBPACK_IMPORTED_MODULE_1__["default"], [['render',_ArticleCard_vue_vue_type_template_id_26f16dea__WEBPACK_IMPORTED_MODULE_0__.render],['__file',"resources/js/components/ArticleCard.vue"]]) /* hot reload */ if (false) {} @@ -33354,13 +33371,13 @@ __webpack_require__.r(__webpack_exports__); /* harmony export */ }); /* harmony import */ var _LayoutContainer_vue_vue_type_template_id_286f4d48__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./LayoutContainer.vue?vue&type=template&id=286f4d48 */ "./resources/js/components/LayoutContainer.vue?vue&type=template&id=286f4d48"); /* harmony import */ var _LayoutContainer_vue_vue_type_script_lang_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./LayoutContainer.vue?vue&type=script&lang=js */ "./resources/js/components/LayoutContainer.vue?vue&type=script&lang=js"); -/* harmony import */ var _home_titus_projects_com_github_fsr5_fhaachen_strichlistensystem_node_modules_vue_loader_dist_exportHelper_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./node_modules/vue-loader/dist/exportHelper.js */ "./node_modules/vue-loader/dist/exportHelper.js"); +/* harmony import */ var _root_projects_comGithub_fsr5_fhaachen_strichlistensystem_node_modules_vue_loader_dist_exportHelper_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./node_modules/vue-loader/dist/exportHelper.js */ "./node_modules/vue-loader/dist/exportHelper.js"); ; -const __exports__ = /*#__PURE__*/(0,_home_titus_projects_com_github_fsr5_fhaachen_strichlistensystem_node_modules_vue_loader_dist_exportHelper_js__WEBPACK_IMPORTED_MODULE_2__["default"])(_LayoutContainer_vue_vue_type_script_lang_js__WEBPACK_IMPORTED_MODULE_1__["default"], [['render',_LayoutContainer_vue_vue_type_template_id_286f4d48__WEBPACK_IMPORTED_MODULE_0__.render],['__file',"resources/js/components/LayoutContainer.vue"]]) +const __exports__ = /*#__PURE__*/(0,_root_projects_comGithub_fsr5_fhaachen_strichlistensystem_node_modules_vue_loader_dist_exportHelper_js__WEBPACK_IMPORTED_MODULE_2__["default"])(_LayoutContainer_vue_vue_type_script_lang_js__WEBPACK_IMPORTED_MODULE_1__["default"], [['render',_LayoutContainer_vue_vue_type_template_id_286f4d48__WEBPACK_IMPORTED_MODULE_0__.render],['__file',"resources/js/components/LayoutContainer.vue"]]) /* hot reload */ if (false) {} @@ -33382,13 +33399,13 @@ __webpack_require__.r(__webpack_exports__); /* harmony export */ }); /* harmony import */ var _PersonBadge_vue_vue_type_template_id_7e588133__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./PersonBadge.vue?vue&type=template&id=7e588133 */ "./resources/js/components/PersonBadge.vue?vue&type=template&id=7e588133"); /* harmony import */ var _PersonBadge_vue_vue_type_script_lang_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./PersonBadge.vue?vue&type=script&lang=js */ "./resources/js/components/PersonBadge.vue?vue&type=script&lang=js"); -/* harmony import */ var _home_titus_projects_com_github_fsr5_fhaachen_strichlistensystem_node_modules_vue_loader_dist_exportHelper_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./node_modules/vue-loader/dist/exportHelper.js */ "./node_modules/vue-loader/dist/exportHelper.js"); +/* harmony import */ var _root_projects_comGithub_fsr5_fhaachen_strichlistensystem_node_modules_vue_loader_dist_exportHelper_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./node_modules/vue-loader/dist/exportHelper.js */ "./node_modules/vue-loader/dist/exportHelper.js"); ; -const __exports__ = /*#__PURE__*/(0,_home_titus_projects_com_github_fsr5_fhaachen_strichlistensystem_node_modules_vue_loader_dist_exportHelper_js__WEBPACK_IMPORTED_MODULE_2__["default"])(_PersonBadge_vue_vue_type_script_lang_js__WEBPACK_IMPORTED_MODULE_1__["default"], [['render',_PersonBadge_vue_vue_type_template_id_7e588133__WEBPACK_IMPORTED_MODULE_0__.render],['__file',"resources/js/components/PersonBadge.vue"]]) +const __exports__ = /*#__PURE__*/(0,_root_projects_comGithub_fsr5_fhaachen_strichlistensystem_node_modules_vue_loader_dist_exportHelper_js__WEBPACK_IMPORTED_MODULE_2__["default"])(_PersonBadge_vue_vue_type_script_lang_js__WEBPACK_IMPORTED_MODULE_1__["default"], [['render',_PersonBadge_vue_vue_type_template_id_7e588133__WEBPACK_IMPORTED_MODULE_0__.render],['__file',"resources/js/components/PersonBadge.vue"]]) /* hot reload */ if (false) {} @@ -33410,13 +33427,13 @@ __webpack_require__.r(__webpack_exports__); /* harmony export */ }); /* harmony import */ var _PersonCard_vue_vue_type_template_id_6acffa30__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./PersonCard.vue?vue&type=template&id=6acffa30 */ "./resources/js/components/PersonCard.vue?vue&type=template&id=6acffa30"); /* harmony import */ var _PersonCard_vue_vue_type_script_lang_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./PersonCard.vue?vue&type=script&lang=js */ "./resources/js/components/PersonCard.vue?vue&type=script&lang=js"); -/* harmony import */ var _home_titus_projects_com_github_fsr5_fhaachen_strichlistensystem_node_modules_vue_loader_dist_exportHelper_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./node_modules/vue-loader/dist/exportHelper.js */ "./node_modules/vue-loader/dist/exportHelper.js"); +/* harmony import */ var _root_projects_comGithub_fsr5_fhaachen_strichlistensystem_node_modules_vue_loader_dist_exportHelper_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./node_modules/vue-loader/dist/exportHelper.js */ "./node_modules/vue-loader/dist/exportHelper.js"); ; -const __exports__ = /*#__PURE__*/(0,_home_titus_projects_com_github_fsr5_fhaachen_strichlistensystem_node_modules_vue_loader_dist_exportHelper_js__WEBPACK_IMPORTED_MODULE_2__["default"])(_PersonCard_vue_vue_type_script_lang_js__WEBPACK_IMPORTED_MODULE_1__["default"], [['render',_PersonCard_vue_vue_type_template_id_6acffa30__WEBPACK_IMPORTED_MODULE_0__.render],['__file',"resources/js/components/PersonCard.vue"]]) +const __exports__ = /*#__PURE__*/(0,_root_projects_comGithub_fsr5_fhaachen_strichlistensystem_node_modules_vue_loader_dist_exportHelper_js__WEBPACK_IMPORTED_MODULE_2__["default"])(_PersonCard_vue_vue_type_script_lang_js__WEBPACK_IMPORTED_MODULE_1__["default"], [['render',_PersonCard_vue_vue_type_template_id_6acffa30__WEBPACK_IMPORTED_MODULE_0__.render],['__file',"resources/js/components/PersonCard.vue"]]) /* hot reload */ if (false) {} diff --git a/resources/js/Pages/App/Index.vue b/resources/js/Pages/App/Index.vue index 6fc7cc2..e12fb0e 100644 --- a/resources/js/Pages/App/Index.vue +++ b/resources/js/Pages/App/Index.vue @@ -5,6 +5,7 @@ + @@ -65,6 +66,8 @@ export default defineComponent({ return person.course === "ET"; } else if(filter.value === "wi") { return person.course === "WI"; + } else if(filter.value === "dib") { + return person.course === "DIB"; } else if(filter.value === "mcd") { return person.course === "MCD"; } else if(filter.value === "tutor") { diff --git a/resources/js/app.js b/resources/js/app.js index 19554b6..2b071a9 100644 --- a/resources/js/app.js +++ b/resources/js/app.js @@ -16,6 +16,7 @@ import { faStar, faUsers, faWineBottle, + faBriefcase, } from '@fortawesome/free-solid-svg-icons'; import { FontAwesomeIcon } from '@fortawesome/vue-fontawesome'; import VueQrcode from '@chenfengyuan/vue-qrcode'; @@ -41,6 +42,7 @@ library.add( faStar, faUsers, faWineBottle, + faBriefcase, ); Inertia.on('start', () => NProgress.start()); diff --git a/resources/js/components/PersonCard.vue b/resources/js/components/PersonCard.vue index 7f7d868..0dc8f09 100644 --- a/resources/js/components/PersonCard.vue +++ b/resources/js/components/PersonCard.vue @@ -13,6 +13,7 @@ + @@ -54,6 +55,8 @@ export default defineComponent({ return 'hover:border-yellow-700'; } else if (props.person.course == 'WI') { return 'hover:border-green-700'; + } else if (props.person.course == 'DIB') { + return 'hover:border-fuchsia-700'; } else if (props.person.course == 'MCD') { return 'hover:border-purple-700'; } else { diff --git a/routes/web.php b/routes/web.php index 8a050c8..09212f1 100644 --- a/routes/web.php +++ b/routes/web.php @@ -3,6 +3,7 @@ use App\Http\Controllers\AppController; use App\Http\Controllers\PersonController; use App\Http\Controllers\ExportController; +use App\Http\Controllers\PortalsController; use Illuminate\Support\Facades\Route; /* @@ -32,3 +33,5 @@ }); Route::get('/exportcsv/{password}', [ExportController::class, 'exportCsv']); + +Route::get('/importusers/{password}', [PortalsController::class, 'importUsers']); diff --git a/tests/Feature/ExampleTest.php b/tests/Feature/ExampleTest.php index 4ae02bc..5a16286 100644 --- a/tests/Feature/ExampleTest.php +++ b/tests/Feature/ExampleTest.php @@ -16,6 +16,6 @@ public function test_example() { $response = $this->get('/'); - $response->assertStatus(200); + $response->assertStatus(302); } }