This commit is contained in:
frederikpyt 2020-08-10 12:44:45 +02:00
commit 534fbe2efd
10 changed files with 132 additions and 68 deletions

View File

@ -216,6 +216,8 @@ class UserController extends Controller
return redirect()->back(303)->with('error#wrongcredentials', '<p class="text-center text-white"><b>Email eller Password matchede ikke!</b></p>'); return redirect()->back(303)->with('error#wrongcredentials', '<p class="text-center text-white"><b>Email eller Password matchede ikke!</b></p>');
if (request()->cookie('languagesSetting') == "en") if (request()->cookie('languagesSetting') == "en")
return redirect()->back(303)->with('error#wrongcredentials', '<p class="text-center text-white"><b>Wrong Email or Password!</b></p>'); return redirect()->back(303)->with('error#wrongcredentials', '<p class="text-center text-white"><b>Wrong Email or Password!</b></p>');
return redirect()->back(303)->with('error#wrongcredentials', '<p class="text-center text-white"><b>Email eller Password matchede ikke!</b></p>');
} }
public function logout(Request $request) { public function logout(Request $request) {
@ -225,6 +227,8 @@ class UserController extends Controller
return redirect()->route("users.login")->with('success#loggedout', '<p class="text-center text-white"><b>Du er hermed logget ud!</b></p>'); return redirect()->route("users.login")->with('success#loggedout', '<p class="text-center text-white"><b>Du er hermed logget ud!</b></p>');
if (request()->cookie('languagesSetting') == "en") if (request()->cookie('languagesSetting') == "en")
return redirect()->route("users.login")->with('success#loggedout', '<p class="text-center text-white"><b>You are logged out!</b></p>'); return redirect()->route("users.login")->with('success#loggedout', '<p class="text-center text-white"><b>You are logged out!</b></p>');
return redirect()->route("users.login")->with('success#loggedout', '<p class="text-center text-white"><b>Du er hermed logget ud!</b></p>');
} }
/*******************************************/ /*******************************************/
@ -301,11 +305,15 @@ class UserController extends Controller
return redirect()->route("users.accounteditpass")->with('error#notsamepass', '<p class="text-center"><b>Der stod ikke det samme i `Nyt Password` & `Confirm Password`!</b></p>'); return redirect()->route("users.accounteditpass")->with('error#notsamepass', '<p class="text-center"><b>Der stod ikke det samme i `Nyt Password` & `Confirm Password`!</b></p>');
elseif (request()->cookie('languagesSetting') == "en") elseif (request()->cookie('languagesSetting') == "en")
return redirect()->route("users.accounteditpass")->with('error#notsamepass', '<p class="text-center"><b>`New Password` & `Confirm Password` was not the same!</b></p>'); return redirect()->route("users.accounteditpass")->with('error#notsamepass', '<p class="text-center"><b>`New Password` & `Confirm Password` was not the same!</b></p>');
else
return redirect()->route("users.accounteditpass")->with('error#notsamepass', '<p class="text-center"><b>Der stod ikke det samme i `Nyt Password` & `Confirm Password`!</b></p>');
} elseif (!Hash::check($request->input('oldpassword'), $user->password)) { // If the written current password and current password in DB is not the same, go back with fail message. } elseif (!Hash::check($request->input('oldpassword'), $user->password)) { // If the written current password and current password in DB is not the same, go back with fail message.
if (request()->cookie('languagesSetting') == "dk") if (request()->cookie('languagesSetting') == "dk")
return redirect()->route("users.accounteditpass")->with('error#oldpass', '<p class="text-center"><b>Det indtastede password i `Nuværende Password` er ikke dit nuværende password!</b></p>'); return redirect()->route("users.accounteditpass")->with('error#oldpass', '<p class="text-center"><b>Det indtastede password i `Nuværende Password` er ikke dit nuværende password!</b></p>');
elseif (request()->cookie('languagesSetting') == "en") elseif (request()->cookie('languagesSetting') == "en")
return redirect()->route("users.accounteditpass")->with('error#oldpass', '<p class="text-center"><b>The entered `Current Password` was not the same as your current password!</b></p>'); return redirect()->route("users.accounteditpass")->with('error#oldpass', '<p class="text-center"><b>The entered `Current Password` was not the same as your current password!</b></p>');
else
return redirect()->route("users.accounteditpass")->with('error#oldpass', '<p class="text-center"><b>Det indtastede password i `Nuværende Password` er ikke dit nuværende password!</b></p>');
} else { // If new password and current password is the same AND current written and current DB password is the same. Then update and logout. } else { // If new password and current password is the same AND current written and current DB password is the same. Then update and logout.
/** @var User $user */ /** @var User $user */
$user->update($data); $user->update($data);
@ -315,6 +323,8 @@ class UserController extends Controller
return redirect()->route("users.login")->with('success#passwordchange', '<p class="text-center text-white"><b>Dit password er hermed ændret!</b></p>'); return redirect()->route("users.login")->with('success#passwordchange', '<p class="text-center text-white"><b>Dit password er hermed ændret!</b></p>');
elseif (request()->cookie('languagesSetting') == "en") elseif (request()->cookie('languagesSetting') == "en")
return redirect()->route("users.login")->with('success#passwordchange', '<p class="text-center text-white"><b>Your password was changed successfully!</b></p>'); return redirect()->route("users.login")->with('success#passwordchange', '<p class="text-center text-white"><b>Your password was changed successfully!</b></p>');
else
return redirect()->route("users.login")->with('success#passwordchange', '<p class="text-center text-white"><b>Dit password er hermed ændret!</b></p>');
} }
} else { // Else if you're not editing the password but anything else (Email, Phone Number). Then update user. } else { // Else if you're not editing the password but anything else (Email, Phone Number). Then update user.
$data = $request->only(['email', 'phone']); $data = $request->only(['email', 'phone']);
@ -324,6 +334,8 @@ class UserController extends Controller
return redirect()->route("users.account")->with('success#credentialschanged', '<p class="text-center"><b>Dine oplysninger er hermed ændret!</b></p>'); return redirect()->route("users.account")->with('success#credentialschanged', '<p class="text-center"><b>Dine oplysninger er hermed ændret!</b></p>');
elseif (request()->cookie('languagesSetting') == "en") elseif (request()->cookie('languagesSetting') == "en")
return redirect()->route("users.account")->with('success#credentialschanged', '<p class="text-center"><b>Your information has changed!</b></p>'); return redirect()->route("users.account")->with('success#credentialschanged', '<p class="text-center"><b>Your information has changed!</b></p>');
else
return redirect()->route("users.account")->with('success#credentialschanged', '<p class="text-center"><b>Dine oplysninger er hermed ændret!</b></p>');
} }
$users = User::query()->paginate(20); $users = User::query()->paginate(20);

View File

@ -91,6 +91,8 @@ class UserEventController extends Controller
return redirect()->route("userevents.index", [ "userevents" => $JoinedEvents ])->with('eventunsubscribed', '<p class="text-center"><b>Du er hermed afmeldt aktiviteten!</b></p>'); return redirect()->route("userevents.index", [ "userevents" => $JoinedEvents ])->with('eventunsubscribed', '<p class="text-center"><b>Du er hermed afmeldt aktiviteten!</b></p>');
if (request()->cookie('languagesSetting') == "en") if (request()->cookie('languagesSetting') == "en")
return redirect()->route("userevents.index", [ "userevents" => $JoinedEvents ])->with('eventunsubscribed', '<p class="text-center"><b>You are no longer participating in this event!</b></p>'); return redirect()->route("userevents.index", [ "userevents" => $JoinedEvents ])->with('eventunsubscribed', '<p class="text-center"><b>You are no longer participating in this event!</b></p>');
return redirect()->route("userevents.index", [ "userevents" => $JoinedEvents ])->with('eventunsubscribed', '<p class="text-center"><b>Du er hermed afmeldt aktiviteten!</b></p>');
} }
public function show() public function show()

View File

@ -23,6 +23,7 @@ class AppServiceProvider extends ServiceProvider
*/ */
public function boot() public function boot()
{ {
url()->forceScheme('https'); if(env('HTTPS_ONLY') == true)
url()->forceScheme('https');
} }
} }

View File

@ -2409,6 +2409,11 @@
} }
} }
}, },
"clone": {
"version": "2.1.2",
"resolved": "https://registry.npmjs.org/clone/-/clone-2.1.2.tgz",
"integrity": "sha1-G39Ln1kfHo+DZwQBYANFoCiHQ18="
},
"clone-deep": { "clone-deep": {
"version": "4.0.1", "version": "4.0.1",
"resolved": "https://registry.npmjs.org/clone-deep/-/clone-deep-4.0.1.tgz", "resolved": "https://registry.npmjs.org/clone-deep/-/clone-deep-4.0.1.tgz",
@ -3064,7 +3069,6 @@
"version": "1.1.1", "version": "1.1.1",
"resolved": "https://registry.npmjs.org/deep-equal/-/deep-equal-1.1.1.tgz", "resolved": "https://registry.npmjs.org/deep-equal/-/deep-equal-1.1.1.tgz",
"integrity": "sha512-yd9c5AdiqVcR+JjcwUQb9DkhJc8ngNr0MahEBGvDiJw8puWab2yZlh+nkasOnZP+EGTAP6rRp2JzJhJZzvNF8g==", "integrity": "sha512-yd9c5AdiqVcR+JjcwUQb9DkhJc8ngNr0MahEBGvDiJw8puWab2yZlh+nkasOnZP+EGTAP6rRp2JzJhJZzvNF8g==",
"dev": true,
"requires": { "requires": {
"is-arguments": "^1.0.4", "is-arguments": "^1.0.4",
"is-date-object": "^1.0.1", "is-date-object": "^1.0.1",
@ -3094,7 +3098,6 @@
"version": "1.1.3", "version": "1.1.3",
"resolved": "https://registry.npmjs.org/define-properties/-/define-properties-1.1.3.tgz", "resolved": "https://registry.npmjs.org/define-properties/-/define-properties-1.1.3.tgz",
"integrity": "sha512-3MqfYKj2lLzdMSf8ZIZE/V+Zuy+BgD6f164e8K2w7dgnpKArBDerGYpM46IYYcjnkdPNMjPk9A6VFB8+3SKlXQ==", "integrity": "sha512-3MqfYKj2lLzdMSf8ZIZE/V+Zuy+BgD6f164e8K2w7dgnpKArBDerGYpM46IYYcjnkdPNMjPk9A6VFB8+3SKlXQ==",
"dev": true,
"requires": { "requires": {
"object-keys": "^1.0.12" "object-keys": "^1.0.12"
} }
@ -3467,7 +3470,6 @@
"version": "1.17.5", "version": "1.17.5",
"resolved": "https://registry.npmjs.org/es-abstract/-/es-abstract-1.17.5.tgz", "resolved": "https://registry.npmjs.org/es-abstract/-/es-abstract-1.17.5.tgz",
"integrity": "sha512-BR9auzDbySxOcfog0tLECW8l28eRGpDpU3Dm3Hp4q/N+VtLTmyj4EUN088XZWQDW/hzj6sYRDXeOFsaAODKvpg==", "integrity": "sha512-BR9auzDbySxOcfog0tLECW8l28eRGpDpU3Dm3Hp4q/N+VtLTmyj4EUN088XZWQDW/hzj6sYRDXeOFsaAODKvpg==",
"dev": true,
"requires": { "requires": {
"es-to-primitive": "^1.2.1", "es-to-primitive": "^1.2.1",
"function-bind": "^1.1.1", "function-bind": "^1.1.1",
@ -3486,7 +3488,6 @@
"version": "1.2.1", "version": "1.2.1",
"resolved": "https://registry.npmjs.org/es-to-primitive/-/es-to-primitive-1.2.1.tgz", "resolved": "https://registry.npmjs.org/es-to-primitive/-/es-to-primitive-1.2.1.tgz",
"integrity": "sha512-QCOllgZJtaUo9miYBcLChTUaHNjJF3PYs1VidD7AwiEj1kYxKeQTctLAezAOH5ZKRH0g2IgPn6KwB4IT8iRpvA==", "integrity": "sha512-QCOllgZJtaUo9miYBcLChTUaHNjJF3PYs1VidD7AwiEj1kYxKeQTctLAezAOH5ZKRH0g2IgPn6KwB4IT8iRpvA==",
"dev": true,
"requires": { "requires": {
"is-callable": "^1.1.4", "is-callable": "^1.1.4",
"is-date-object": "^1.0.1", "is-date-object": "^1.0.1",
@ -3763,6 +3764,11 @@
} }
} }
}, },
"extend": {
"version": "3.0.2",
"resolved": "https://registry.npmjs.org/extend/-/extend-3.0.2.tgz",
"integrity": "sha512-fjquC59cD7CyW6urNXK0FBufkZcoiGG80wTuPujX590cB5Ttln20E2UB4S/WARVqhXffZl2LNgS+gQdPIIim/g=="
},
"extend-shallow": { "extend-shallow": {
"version": "3.0.2", "version": "3.0.2",
"resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-3.0.2.tgz", "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-3.0.2.tgz",
@ -3874,6 +3880,11 @@
"integrity": "sha512-8UEa58QDLauDNfpbrX55Q9jrGHThw2ZMdOky5Gl1CDtVeJDPVrG4Jxx1N8jw2gkWaff5UUuX1KJd+9zGe2B+ZA==", "integrity": "sha512-8UEa58QDLauDNfpbrX55Q9jrGHThw2ZMdOky5Gl1CDtVeJDPVrG4Jxx1N8jw2gkWaff5UUuX1KJd+9zGe2B+ZA==",
"dev": true "dev": true
}, },
"fast-diff": {
"version": "1.1.2",
"resolved": "https://registry.npmjs.org/fast-diff/-/fast-diff-1.1.2.tgz",
"integrity": "sha512-KaJUt+M9t1qaIteSvjc6P3RbMdXsNhK61GRftR6SNxqmhthcd9MGIi4T+o0jD8LUSpSnSKXE20nLtJ3fOHxQig=="
},
"fast-glob": { "fast-glob": {
"version": "2.2.7", "version": "2.2.7",
"resolved": "https://registry.npmjs.org/fast-glob/-/fast-glob-2.2.7.tgz", "resolved": "https://registry.npmjs.org/fast-glob/-/fast-glob-2.2.7.tgz",
@ -4184,8 +4195,7 @@
"function-bind": { "function-bind": {
"version": "1.1.1", "version": "1.1.1",
"resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.1.tgz", "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.1.tgz",
"integrity": "sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A==", "integrity": "sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A=="
"dev": true
}, },
"gensync": { "gensync": {
"version": "1.0.0-beta.1", "version": "1.0.0-beta.1",
@ -4370,7 +4380,6 @@
"version": "1.0.3", "version": "1.0.3",
"resolved": "https://registry.npmjs.org/has/-/has-1.0.3.tgz", "resolved": "https://registry.npmjs.org/has/-/has-1.0.3.tgz",
"integrity": "sha512-f2dvO0VU6Oej7RkWJGrehjbzMAjFp5/VKPp5tTpWIV4JHHZK1/BxbFRtf/siA2SWTe09caDmVtYYzWEIbBS4zw==", "integrity": "sha512-f2dvO0VU6Oej7RkWJGrehjbzMAjFp5/VKPp5tTpWIV4JHHZK1/BxbFRtf/siA2SWTe09caDmVtYYzWEIbBS4zw==",
"dev": true,
"requires": { "requires": {
"function-bind": "^1.1.1" "function-bind": "^1.1.1"
} }
@ -4393,8 +4402,7 @@
"has-symbols": { "has-symbols": {
"version": "1.0.1", "version": "1.0.1",
"resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.0.1.tgz", "resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.0.1.tgz",
"integrity": "sha512-PLcsoqu++dmEIZB+6totNFKq/7Do+Z0u4oT0zKOJNl3lYK6vGwwu2hjHs+68OEZbTjiUE9bgOABXbP/GvrS0Kg==", "integrity": "sha512-PLcsoqu++dmEIZB+6totNFKq/7Do+Z0u4oT0zKOJNl3lYK6vGwwu2hjHs+68OEZbTjiUE9bgOABXbP/GvrS0Kg=="
"dev": true
}, },
"has-value": { "has-value": {
"version": "1.0.0", "version": "1.0.0",
@ -4891,8 +4899,7 @@
"is-arguments": { "is-arguments": {
"version": "1.0.4", "version": "1.0.4",
"resolved": "https://registry.npmjs.org/is-arguments/-/is-arguments-1.0.4.tgz", "resolved": "https://registry.npmjs.org/is-arguments/-/is-arguments-1.0.4.tgz",
"integrity": "sha512-xPh0Rmt8NE65sNzvyUmWgI1tz3mKq74lGA0mL8LYZcoIzKOzDh6HmrYm3d18k60nHerC8A9Km8kYu87zfSFnLA==", "integrity": "sha512-xPh0Rmt8NE65sNzvyUmWgI1tz3mKq74lGA0mL8LYZcoIzKOzDh6HmrYm3d18k60nHerC8A9Km8kYu87zfSFnLA=="
"dev": true
}, },
"is-arrayish": { "is-arrayish": {
"version": "0.2.1", "version": "0.2.1",
@ -4918,8 +4925,7 @@
"is-callable": { "is-callable": {
"version": "1.2.0", "version": "1.2.0",
"resolved": "https://registry.npmjs.org/is-callable/-/is-callable-1.2.0.tgz", "resolved": "https://registry.npmjs.org/is-callable/-/is-callable-1.2.0.tgz",
"integrity": "sha512-pyVD9AaGLxtg6srb2Ng6ynWJqkHU9bEM087AKck0w8QwDarTfNcpIYoU8x8Hv2Icm8u6kFJM18Dag8lyqGkviw==", "integrity": "sha512-pyVD9AaGLxtg6srb2Ng6ynWJqkHU9bEM087AKck0w8QwDarTfNcpIYoU8x8Hv2Icm8u6kFJM18Dag8lyqGkviw=="
"dev": true
}, },
"is-color-stop": { "is-color-stop": {
"version": "1.1.0", "version": "1.1.0",
@ -4958,8 +4964,7 @@
"is-date-object": { "is-date-object": {
"version": "1.0.2", "version": "1.0.2",
"resolved": "https://registry.npmjs.org/is-date-object/-/is-date-object-1.0.2.tgz", "resolved": "https://registry.npmjs.org/is-date-object/-/is-date-object-1.0.2.tgz",
"integrity": "sha512-USlDT524woQ08aoZFzh3/Z6ch9Y/EWXEHQ/AaRN0SkKq4t2Jw2R2339tSXmwuVoY7LLlBCbOIlx2myP/L5zk0g==", "integrity": "sha512-USlDT524woQ08aoZFzh3/Z6ch9Y/EWXEHQ/AaRN0SkKq4t2Jw2R2339tSXmwuVoY7LLlBCbOIlx2myP/L5zk0g=="
"dev": true
}, },
"is-descriptor": { "is-descriptor": {
"version": "0.1.6", "version": "0.1.6",
@ -5079,7 +5084,6 @@
"version": "1.1.0", "version": "1.1.0",
"resolved": "https://registry.npmjs.org/is-regex/-/is-regex-1.1.0.tgz", "resolved": "https://registry.npmjs.org/is-regex/-/is-regex-1.1.0.tgz",
"integrity": "sha512-iI97M8KTWID2la5uYXlkbSDQIg4F6o1sYboZKKTDpnDQMLtUL86zxhgDet3Q2SriaYsyGqZ6Mn2SjbRKeLHdqw==", "integrity": "sha512-iI97M8KTWID2la5uYXlkbSDQIg4F6o1sYboZKKTDpnDQMLtUL86zxhgDet3Q2SriaYsyGqZ6Mn2SjbRKeLHdqw==",
"dev": true,
"requires": { "requires": {
"has-symbols": "^1.0.1" "has-symbols": "^1.0.1"
} }
@ -5109,7 +5113,6 @@
"version": "1.0.3", "version": "1.0.3",
"resolved": "https://registry.npmjs.org/is-symbol/-/is-symbol-1.0.3.tgz", "resolved": "https://registry.npmjs.org/is-symbol/-/is-symbol-1.0.3.tgz",
"integrity": "sha512-OwijhaRSgqvhm/0ZdAcXNZt9lYdKFpcRDT5ULUuYXPoT794UNOdU+gpT6Rzo7b4V2HUl/op6GqY894AZwv9faQ==", "integrity": "sha512-OwijhaRSgqvhm/0ZdAcXNZt9lYdKFpcRDT5ULUuYXPoT794UNOdU+gpT6Rzo7b4V2HUl/op6GqY894AZwv9faQ==",
"dev": true,
"requires": { "requires": {
"has-symbols": "^1.0.1" "has-symbols": "^1.0.1"
} }
@ -6081,14 +6084,12 @@
"object-inspect": { "object-inspect": {
"version": "1.7.0", "version": "1.7.0",
"resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.7.0.tgz", "resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.7.0.tgz",
"integrity": "sha512-a7pEHdh1xKIAgTySUGgLMx/xwDZskN1Ud6egYYN3EdRW4ZMPNEDUTF+hwy2LUC+Bl+SyLXANnwz/jyh/qutKUw==", "integrity": "sha512-a7pEHdh1xKIAgTySUGgLMx/xwDZskN1Ud6egYYN3EdRW4ZMPNEDUTF+hwy2LUC+Bl+SyLXANnwz/jyh/qutKUw=="
"dev": true
}, },
"object-is": { "object-is": {
"version": "1.1.2", "version": "1.1.2",
"resolved": "https://registry.npmjs.org/object-is/-/object-is-1.1.2.tgz", "resolved": "https://registry.npmjs.org/object-is/-/object-is-1.1.2.tgz",
"integrity": "sha512-5lHCz+0uufF6wZ7CRFWJN3hp8Jqblpgve06U5CMQ3f//6iDjPr2PEo9MWCjEssDsa+UZEL4PkFpr+BMop6aKzQ==", "integrity": "sha512-5lHCz+0uufF6wZ7CRFWJN3hp8Jqblpgve06U5CMQ3f//6iDjPr2PEo9MWCjEssDsa+UZEL4PkFpr+BMop6aKzQ==",
"dev": true,
"requires": { "requires": {
"define-properties": "^1.1.3", "define-properties": "^1.1.3",
"es-abstract": "^1.17.5" "es-abstract": "^1.17.5"
@ -6097,8 +6098,7 @@
"object-keys": { "object-keys": {
"version": "1.1.1", "version": "1.1.1",
"resolved": "https://registry.npmjs.org/object-keys/-/object-keys-1.1.1.tgz", "resolved": "https://registry.npmjs.org/object-keys/-/object-keys-1.1.1.tgz",
"integrity": "sha512-NuAESUOUMrlIXOfHKzD6bpPu3tYt3xvjNdRIQ+FeT0lNb4K8WR70CaDxhuNguS2XG+GjkyMwOzsN5ZktImfhLA==", "integrity": "sha512-NuAESUOUMrlIXOfHKzD6bpPu3tYt3xvjNdRIQ+FeT0lNb4K8WR70CaDxhuNguS2XG+GjkyMwOzsN5ZktImfhLA=="
"dev": true
}, },
"object-path": { "object-path": {
"version": "0.9.2", "version": "0.9.2",
@ -6119,7 +6119,6 @@
"version": "4.1.0", "version": "4.1.0",
"resolved": "https://registry.npmjs.org/object.assign/-/object.assign-4.1.0.tgz", "resolved": "https://registry.npmjs.org/object.assign/-/object.assign-4.1.0.tgz",
"integrity": "sha512-exHJeq6kBKj58mqGyTQ9DFvrZC/eR6OwxzoM9YRoGBqrXYonaFyGiFMuc9VZrXf7DarreEwMpurG3dd+CNyW5w==", "integrity": "sha512-exHJeq6kBKj58mqGyTQ9DFvrZC/eR6OwxzoM9YRoGBqrXYonaFyGiFMuc9VZrXf7DarreEwMpurG3dd+CNyW5w==",
"dev": true,
"requires": { "requires": {
"define-properties": "^1.1.2", "define-properties": "^1.1.2",
"function-bind": "^1.1.1", "function-bind": "^1.1.1",
@ -6334,6 +6333,11 @@
"no-case": "^2.2.0" "no-case": "^2.2.0"
} }
}, },
"parchment": {
"version": "1.1.4",
"resolved": "https://registry.npmjs.org/parchment/-/parchment-1.1.4.tgz",
"integrity": "sha512-J5FBQt/pM2inLzg4hEWmzQx/8h8D0CiDxaG3vyp9rKrQRSDgBlhjdP5jQGgosEajXPSQouXGHOmVdgo7QmJuOg=="
},
"parse-asn1": { "parse-asn1": {
"version": "5.1.5", "version": "5.1.5",
"resolved": "https://registry.npmjs.org/parse-asn1/-/parse-asn1-5.1.5.tgz", "resolved": "https://registry.npmjs.org/parse-asn1/-/parse-asn1-5.1.5.tgz",
@ -7381,6 +7385,36 @@
"integrity": "sha512-w7fLxIRCRT7U8Qu53jQnJyPkYZIaR4n5151KMfcJlO/A9397Wxb1amJvROTK6TOnp7PfoAmg/qXiNHI+08jRfA==", "integrity": "sha512-w7fLxIRCRT7U8Qu53jQnJyPkYZIaR4n5151KMfcJlO/A9397Wxb1amJvROTK6TOnp7PfoAmg/qXiNHI+08jRfA==",
"dev": true "dev": true
}, },
"quill": {
"version": "1.3.7",
"resolved": "https://registry.npmjs.org/quill/-/quill-1.3.7.tgz",
"integrity": "sha512-hG/DVzh/TiknWtE6QmWAF/pxoZKYxfe3J/d/+ShUWkDvvkZQVTPeVmUJVu1uE6DDooC4fWTiCLh84ul89oNz5g==",
"requires": {
"clone": "^2.1.1",
"deep-equal": "^1.0.1",
"eventemitter3": "^2.0.3",
"extend": "^3.0.2",
"parchment": "^1.1.4",
"quill-delta": "^3.6.2"
},
"dependencies": {
"eventemitter3": {
"version": "2.0.3",
"resolved": "https://registry.npmjs.org/eventemitter3/-/eventemitter3-2.0.3.tgz",
"integrity": "sha1-teEHm1n7XhuidxwKmTvgYKWMmbo="
}
}
},
"quill-delta": {
"version": "3.6.3",
"resolved": "https://registry.npmjs.org/quill-delta/-/quill-delta-3.6.3.tgz",
"integrity": "sha512-wdIGBlcX13tCHOXGMVnnTVFtGRLoP0imqxM696fIPwIf5ODIYUHIvHbZcyvGlZFiFhK5XzDC2lpjbxRhnM05Tg==",
"requires": {
"deep-equal": "^1.0.1",
"extend": "^3.0.2",
"fast-diff": "1.1.2"
}
},
"randombytes": { "randombytes": {
"version": "2.1.0", "version": "2.1.0",
"resolved": "https://registry.npmjs.org/randombytes/-/randombytes-2.1.0.tgz", "resolved": "https://registry.npmjs.org/randombytes/-/randombytes-2.1.0.tgz",
@ -7515,7 +7549,6 @@
"version": "1.3.0", "version": "1.3.0",
"resolved": "https://registry.npmjs.org/regexp.prototype.flags/-/regexp.prototype.flags-1.3.0.tgz", "resolved": "https://registry.npmjs.org/regexp.prototype.flags/-/regexp.prototype.flags-1.3.0.tgz",
"integrity": "sha512-2+Q0C5g951OlYlJz6yu5/M33IcsESLlLfsyIaLJaG4FA2r4yP8MvVMJUUP/fVBkSpbbbZlS5gynbEWLipiiXiQ==", "integrity": "sha512-2+Q0C5g951OlYlJz6yu5/M33IcsESLlLfsyIaLJaG4FA2r4yP8MvVMJUUP/fVBkSpbbbZlS5gynbEWLipiiXiQ==",
"dev": true,
"requires": { "requires": {
"define-properties": "^1.1.3", "define-properties": "^1.1.3",
"es-abstract": "^1.17.0-next.1" "es-abstract": "^1.17.0-next.1"
@ -8510,7 +8543,6 @@
"version": "1.0.1", "version": "1.0.1",
"resolved": "https://registry.npmjs.org/string.prototype.trimend/-/string.prototype.trimend-1.0.1.tgz", "resolved": "https://registry.npmjs.org/string.prototype.trimend/-/string.prototype.trimend-1.0.1.tgz",
"integrity": "sha512-LRPxFUaTtpqYsTeNKaFOw3R4bxIzWOnbQ837QfBylo8jIxtcbK/A/sMV7Q+OAV/vWo+7s25pOE10KYSjaSO06g==", "integrity": "sha512-LRPxFUaTtpqYsTeNKaFOw3R4bxIzWOnbQ837QfBylo8jIxtcbK/A/sMV7Q+OAV/vWo+7s25pOE10KYSjaSO06g==",
"dev": true,
"requires": { "requires": {
"define-properties": "^1.1.3", "define-properties": "^1.1.3",
"es-abstract": "^1.17.5" "es-abstract": "^1.17.5"
@ -8520,7 +8552,6 @@
"version": "2.1.2", "version": "2.1.2",
"resolved": "https://registry.npmjs.org/string.prototype.trimleft/-/string.prototype.trimleft-2.1.2.tgz", "resolved": "https://registry.npmjs.org/string.prototype.trimleft/-/string.prototype.trimleft-2.1.2.tgz",
"integrity": "sha512-gCA0tza1JBvqr3bfAIFJGqfdRTyPae82+KTnm3coDXkZN9wnuW3HjGgN386D7hfv5CHQYCI022/rJPVlqXyHSw==", "integrity": "sha512-gCA0tza1JBvqr3bfAIFJGqfdRTyPae82+KTnm3coDXkZN9wnuW3HjGgN386D7hfv5CHQYCI022/rJPVlqXyHSw==",
"dev": true,
"requires": { "requires": {
"define-properties": "^1.1.3", "define-properties": "^1.1.3",
"es-abstract": "^1.17.5", "es-abstract": "^1.17.5",
@ -8531,7 +8562,6 @@
"version": "2.1.2", "version": "2.1.2",
"resolved": "https://registry.npmjs.org/string.prototype.trimright/-/string.prototype.trimright-2.1.2.tgz", "resolved": "https://registry.npmjs.org/string.prototype.trimright/-/string.prototype.trimright-2.1.2.tgz",
"integrity": "sha512-ZNRQ7sY3KroTaYjRS6EbNiiHrOkjihL9aQE/8gfQ4DtAC/aEBRHFJa44OmoWxGGqXuJlfKkZW4WcXErGr+9ZFg==", "integrity": "sha512-ZNRQ7sY3KroTaYjRS6EbNiiHrOkjihL9aQE/8gfQ4DtAC/aEBRHFJa44OmoWxGGqXuJlfKkZW4WcXErGr+9ZFg==",
"dev": true,
"requires": { "requires": {
"define-properties": "^1.1.3", "define-properties": "^1.1.3",
"es-abstract": "^1.17.5", "es-abstract": "^1.17.5",
@ -8542,7 +8572,6 @@
"version": "1.0.1", "version": "1.0.1",
"resolved": "https://registry.npmjs.org/string.prototype.trimstart/-/string.prototype.trimstart-1.0.1.tgz", "resolved": "https://registry.npmjs.org/string.prototype.trimstart/-/string.prototype.trimstart-1.0.1.tgz",
"integrity": "sha512-XxZn+QpvrBI1FOcg6dIpxUPgWCPuNXvMD72aaRaUQv1eD4e/Qy8i/hFTe0BUmD60p/QA6bh1avmuPTfNjqVWRw==", "integrity": "sha512-XxZn+QpvrBI1FOcg6dIpxUPgWCPuNXvMD72aaRaUQv1eD4e/Qy8i/hFTe0BUmD60p/QA6bh1avmuPTfNjqVWRw==",
"dev": true,
"requires": { "requires": {
"define-properties": "^1.1.3", "define-properties": "^1.1.3",
"es-abstract": "^1.17.5" "es-abstract": "^1.17.5"

View File

@ -27,6 +27,7 @@
"@ckeditor/ckeditor5-build-decoupled-document": "^21.0.0", "@ckeditor/ckeditor5-build-decoupled-document": "^21.0.0",
"@ckeditor/ckeditor5-table": "^21.0.0", "@ckeditor/ckeditor5-table": "^21.0.0",
"ckeditor": "github:unisharp/laravel-ckeditor", "ckeditor": "github:unisharp/laravel-ckeditor",
"moment": "^2.27.0" "moment": "^2.27.0",
"quill": "^1.3.7"
} }
} }

View File

@ -45,6 +45,7 @@ return[
"nuværendepassword" => "Nuværende Adgangskode", "nuværendepassword" => "Nuværende Adgangskode",
"nytpassword" => "Ny Adgangskode", "nytpassword" => "Ny Adgangskode",
"confirmpassword" => "Gentag Adgangskode", "confirmpassword" => "Gentag Adgangskode",
"ingennyheder" => "Der er ingen nyheder",

View File

@ -54,4 +54,5 @@ return[
"nuværendepassword" => "Current password", "nuværendepassword" => "Current password",
"nytpassword" => "New password", "nytpassword" => "New password",
"confirmpassword" => "Confirm password", "confirmpassword" => "Confirm password",
"ingennyheder" => "No news were found",
]; ];

View File

@ -17,17 +17,8 @@
.toggle__text::before { .toggle__text::before {
border-color: black; border-color: black;
} }
.tox-notification {
display: none !important;
}
.tox {
border-radius: 4px !important;
margin-bottom: 1rem;
}
</style> </style>
<script src="https://cdn.tiny.cloud/1/ikwmbvigw8ass90tn37xiql6mk1gjoks77t3m6tld60hdjov/tinymce/5/tinymce.min.js" referrerpolicy="origin"></script> <link href="https://cdn.quilljs.com/1.3.6/quill.snow.css" rel="stylesheet">
<h1>Opret Aktivitet:</h1> <h1>Opret Aktivitet:</h1>
<form method="post" action="{{ route("events.store") }}"> <form method="post" action="{{ route("events.store") }}">
@csrf @csrf
@ -36,7 +27,8 @@
<label for="accountable">Event Ansvarlig:</label> <label for="accountable">Event Ansvarlig:</label>
<input type="text" name="accountable" id="accountable" required> <input type="text" name="accountable" id="accountable" required>
<label for="description">Event Beskrivelse:</label> <label for="description">Event Beskrivelse:</label>
<textarea name="description" id="editor"></textarea> <div id="editor"></div>
<textarea name="description" class="d-none" id="hiddenArea"></textarea>
<label for="date">Event dato:</label> <label for="date">Event dato:</label>
<input type="datetime-local" name="date" id="date" required> <input type="datetime-local" name="date" id="date" required>
<label class="toggle"> <label class="toggle">
@ -47,15 +39,31 @@
</label> </label>
<input type="submit" class="btn btn-dark text-white" value="Opret"> <input type="submit" class="btn btn-dark text-white" value="Opret">
</form> </form>
<script src="https://cdn.quilljs.com/1.3.6/quill.js"></script>
<script> <script>
tinymce.init({ var container = document.getElementById("editor");
selector: 'textarea', var fullEditor = new Quill(container, {
setup: function (editor) { modules: {
editor.on('change', function () { 'toolbar': [
tinymce.triggerSave(); [ 'bold', 'italic', 'underline', 'strike' ],
}); [{ 'color': [] }, { 'background': [] }],
} [{ 'script': 'super' }, { 'script': 'sub' }],
[{ 'header': '1' }, { 'header': '2' }, 'blockquote', 'code-block' ],
[{ 'list': 'ordered' }, { 'list': 'bullet'}, { 'indent': '-1' }, { 'indent': '+1' }],
[ {'direction': 'rtl'}, { 'align': [] }],
[ 'link', 'image', 'video', 'formula' ],
[ 'clean' ]
],
},
theme: 'snow'
}); });
</script> </script>
<script>
var form = document.querySelector('form');
form.onsubmit = function() {
var myEditor = document.getElementById('editor');
var html = myEditor.children[0].innerHTML;
document.getElementById('hiddenArea').innerText = html;
}
</script>
@endsection @endsection

View File

@ -17,17 +17,8 @@
.toggle__text::before { .toggle__text::before {
border-color: black; border-color: black;
} }
.tox-notification {
display: none !important;
}
.tox {
border-radius: 4px !important;
margin-bottom: 1rem;
}
</style> </style>
<script src="https://cdn.tiny.cloud/1/ikwmbvigw8ass90tn37xiql6mk1gjoks77t3m6tld60hdjov/tinymce/5/tinymce.min.js" referrerpolicy="origin"></script> <link href="https://cdn.quilljs.com/1.3.6/quill.snow.css" rel="stylesheet">
<h1>Rediger Link:</h1> <h1>Rediger Link:</h1>
<form method="post" action="{{route("events.update", ["event" => $event])}}"> <form method="post" action="{{route("events.update", ["event" => $event])}}">
@csrf @csrf
@ -37,7 +28,8 @@
<label for="accountable">Event Ansvarlig:</label> <label for="accountable">Event Ansvarlig:</label>
<input value="{{$event->accountable}}" type="text" name="accountable" id="accountable" required> <input value="{{$event->accountable}}" type="text" name="accountable" id="accountable" required>
<label for="description">Beskrivelse</label> <label for="description">Beskrivelse</label>
<textarea type="text" name="description" id="description" required>{!! $event->description !!}</textarea> <div id="editor">{!! $event->description !!}</div>
<textarea name="description" class="d-none" id="hiddenArea"></textarea>
<label for="date">Beskrivelse</label> <label for="date">Beskrivelse</label>
<input value="{{$event->date}}" type="datetime-local" name="date" id="date" required> <input value="{{$event->date}}" type="datetime-local" name="date" id="date" required>
<label class="toggle"> <label class="toggle">
@ -49,14 +41,31 @@
<input type="submit" class="btn btn-dark text-white" value="Rediger"> <input type="submit" class="btn btn-dark text-white" value="Rediger">
</form> </form>
<script src="https://cdn.quilljs.com/1.3.6/quill.js"></script>
<script> <script>
tinymce.init({ var container = document.getElementById("editor");
selector: 'textarea', var fullEditor = new Quill(container, {
setup: function (editor) { modules: {
editor.on('change', function () { 'toolbar': [
tinymce.triggerSave(); [ 'bold', 'italic', 'underline', 'strike' ],
}); [{ 'color': [] }, { 'background': [] }],
} [{ 'script': 'super' }, { 'script': 'sub' }],
[{ 'header': '1' }, { 'header': '2' }, 'blockquote', 'code-block' ],
[{ 'list': 'ordered' }, { 'list': 'bullet'}, { 'indent': '-1' }, { 'indent': '+1' }],
[ {'direction': 'rtl'}, { 'align': [] }],
[ 'link', 'image', 'video', 'formula' ],
[ 'clean' ]
],
},
theme: 'snow'
}); });
</script> </script>
<script>
var form = document.querySelector('form');
form.onsubmit = function() {
var myEditor = document.getElementById('editor');
var html = myEditor.children[0].innerHTML;
document.getElementById('hiddenArea').innerText = html;
}
</script>
@endsection @endsection

View File

@ -101,7 +101,7 @@
</div> </div>
@endforeach @endforeach
@if(count(\App\News::query()->orderBy("created_at", "desc")->get()) == 0) @if(count(\App\News::query()->orderBy("created_at", "desc")->get()) == 0)
<p class="text-center">Der er ingen nyheder.</p> <p class="text-center">{{__('msg.ingennyheder')}}</p>
@endif @endif
</main> </main>
<script src="{{ mix("/js/app.js") }}"></script> <script src="{{ mix("/js/app.js") }}"></script>