Merge branch 'master' of https://github.com/sebathefox/skolehjem-webapp into master
This commit is contained in:
commit
d8a754d398
|
@ -94,7 +94,6 @@
|
||||||
<XML_NAMESPACE>http://schemas.android.com/apk/res/android</XML_NAMESPACE>
|
<XML_NAMESPACE>http://schemas.android.com/apk/res/android</XML_NAMESPACE>
|
||||||
</AND>
|
</AND>
|
||||||
</match>
|
</match>
|
||||||
<order>ANDROID_ATTRIBUTE_ORDER</order>
|
|
||||||
</rule>
|
</rule>
|
||||||
</section>
|
</section>
|
||||||
<section>
|
<section>
|
||||||
|
|
|
@ -0,0 +1,5 @@
|
||||||
|
<component name="ProjectCodeStyleConfiguration">
|
||||||
|
<state>
|
||||||
|
<option name="PREFERRED_PROJECT_CODE_STYLE" value="Default" />
|
||||||
|
</state>
|
||||||
|
</component>
|
|
@ -3,9 +3,7 @@
|
||||||
|
|
||||||
namespace App\Helpers;
|
namespace App\Helpers;
|
||||||
|
|
||||||
|
use Illuminate\Support\Facades\Auth;
|
||||||
|
|
||||||
|
|
||||||
use Jenssegers\Agent\Agent;
|
use Jenssegers\Agent\Agent;
|
||||||
|
|
||||||
class Detector
|
class Detector
|
||||||
|
@ -16,7 +14,13 @@ class Detector
|
||||||
|
|
||||||
if($agent->isMobile()) {
|
if($agent->isMobile()) {
|
||||||
return view(config("detector.mobilePath") . "." . $viewName, $args);
|
return view(config("detector.mobilePath") . "." . $viewName, $args);
|
||||||
}
|
} else if(Auth()->user() !== null) {
|
||||||
|
if (Auth()->user()->can('admin.panel.show') == true)
|
||||||
return view(config("detector.defaultPath") . "." . $viewName, $args);
|
return view(config("detector.defaultPath") . "." . $viewName, $args);
|
||||||
}
|
}
|
||||||
|
if($viewName == "users.login" || $viewName == "users.logout")
|
||||||
|
return view(config("detector.mobilePath") . "." . $viewName, $args);
|
||||||
|
|
||||||
|
return view("errors.403", $args);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -6,6 +6,7 @@ use Illuminate\Http\Request;
|
||||||
use Illuminate\Http\Response;
|
use Illuminate\Http\Response;
|
||||||
use Illuminate\Support\Facades\DB;
|
use Illuminate\Support\Facades\DB;
|
||||||
use Spatie\Permission\Models\Role;
|
use Spatie\Permission\Models\Role;
|
||||||
|
use Illuminate\Database\Eloquent\Collection;
|
||||||
|
|
||||||
class rolesController extends Controller
|
class rolesController extends Controller
|
||||||
{
|
{
|
||||||
|
@ -57,6 +58,13 @@ class rolesController extends Controller
|
||||||
"description" => "required|max:255"
|
"description" => "required|max:255"
|
||||||
]);
|
]);
|
||||||
|
|
||||||
|
$brugerPermissions = new Collection();
|
||||||
|
if ($request->value !== null) {
|
||||||
|
foreach ($request->value as $valuee) {
|
||||||
|
$brugerPermissions->add(\Spatie\Permission\Models\Permission::query()->where("name", "=", $valuee)->first());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
$role = new Role($requestRole);
|
$role = new Role($requestRole);
|
||||||
|
|
||||||
$allRoles = Role::query()->where('name', '=', $request->name)->get();
|
$allRoles = Role::query()->where('name', '=', $request->name)->get();
|
||||||
|
@ -66,11 +74,16 @@ class rolesController extends Controller
|
||||||
return redirect()->route("roles.store");
|
return redirect()->route("roles.store");
|
||||||
else { // Else - Create it
|
else { // Else - Create it
|
||||||
$role->save();
|
$role->save();
|
||||||
|
|
||||||
|
if (!$brugerPermissions->isEmpty()) {
|
||||||
|
foreach ($brugerPermissions as $permission) {
|
||||||
|
\Spatie\Permission\Models\Role::query()->find($role->id)->givePermissionTo($permission);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
$roles = Role::query()->paginate($request->input("limit", 20));
|
$roles = Role::query()->paginate($request->input("limit", 20));
|
||||||
return redirect()->route("roles.index", ['roles' => $roles]);
|
return redirect()->route("roles.index", ['roles' => $roles]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -19,16 +19,16 @@ class RootController extends Controller
|
||||||
|
|
||||||
if(auth()->user()->can('admin.panel.show')) {
|
if(auth()->user()->can('admin.panel.show')) {
|
||||||
if(Response::detect("root.index")->name() == "admin.root.index")
|
if(Response::detect("root.index")->name() == "admin.root.index")
|
||||||
return Response::detect("root.index");
|
return view("admin.root.index");
|
||||||
else {
|
else {
|
||||||
$news = News::query()->orderBy('id', 'desc')->paginate($perPage);
|
$news = News::query()->orderBy('id', 'desc')->paginate($perPage);
|
||||||
return Response::detect("root.index", ["news" => $news]);
|
return view("app.root.index", ["news" => $news]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
$news = News::query()->orderBy('id', 'desc')->paginate($perPage, ['*'], "page");
|
$news = News::query()->orderBy('id', 'desc')->paginate($perPage, ['*'], "page");
|
||||||
|
|
||||||
return view('app.root.index', ["news" => $news]);
|
return Response::detect('root.index', ["news" => $news]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -76,6 +76,7 @@ class UserController extends Controller
|
||||||
"phone" => "required|max:8|min:8",
|
"phone" => "required|max:8|min:8",
|
||||||
]);
|
]);
|
||||||
|
|
||||||
|
|
||||||
$allUsersEmail = User::query()->where('email', '=', $request->email)->get();
|
$allUsersEmail = User::query()->where('email', '=', $request->email)->get();
|
||||||
$allUsersPhone = User::query()->where('phone', '=', $request->phone)->get();
|
$allUsersPhone = User::query()->where('phone', '=', $request->phone)->get();
|
||||||
|
|
||||||
|
@ -140,6 +141,12 @@ class UserController extends Controller
|
||||||
{
|
{
|
||||||
$user = User::find($id);
|
$user = User::find($id);
|
||||||
|
|
||||||
|
if($request->file("resource")) {
|
||||||
|
$user->resource_id = ResourceController::store($request)->id;
|
||||||
|
}
|
||||||
|
|
||||||
|
$user->save();
|
||||||
|
|
||||||
$allUsersEmail = User::query()->where('email', '=', $request->email)->where('id', '!=', $id)->get();
|
$allUsersEmail = User::query()->where('email', '=', $request->email)->where('id', '!=', $id)->get();
|
||||||
$allUsersPhone = User::query()->where('phone', '=', $request->phone)->where('id', '!=', $id)->get();
|
$allUsersPhone = User::query()->where('phone', '=', $request->phone)->where('id', '!=', $id)->get();
|
||||||
|
|
||||||
|
@ -315,18 +322,18 @@ class UserController extends Controller
|
||||||
$data = $request->only(['name_first', 'name_last', 'email', 'phone', 'password']);
|
$data = $request->only(['name_first', 'name_last', 'email', 'phone', 'password']);
|
||||||
if ($request->input('password') != $request->input('confirmpassword')) { // If new password and new password confirm is not the same, go back with fail message.
|
if ($request->input('password') != $request->input('confirmpassword')) { // If new password and new password confirm 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#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
|
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>');
|
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
|
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>');
|
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);
|
||||||
|
|
|
@ -3,6 +3,7 @@
|
||||||
namespace App\Providers;
|
namespace App\Providers;
|
||||||
|
|
||||||
use Illuminate\Http\Response;
|
use Illuminate\Http\Response;
|
||||||
|
use Illuminate\Support\Facades\Auth;
|
||||||
use Illuminate\Support\ServiceProvider;
|
use Illuminate\Support\ServiceProvider;
|
||||||
use Jenssegers\Agent\Facades\Agent;
|
use Jenssegers\Agent\Facades\Agent;
|
||||||
|
|
||||||
|
@ -28,8 +29,14 @@ class DetectorServiceProvider extends ServiceProvider
|
||||||
Response::macro("detect", function ($view, $args = []) {
|
Response::macro("detect", function ($view, $args = []) {
|
||||||
if(Agent::isMobile()) {
|
if(Agent::isMobile()) {
|
||||||
return view(config("detector.mobilePath") . "." . $view, $args);
|
return view(config("detector.mobilePath") . "." . $view, $args);
|
||||||
}
|
} else if(Auth()->user() !== null){
|
||||||
|
if(Auth()->user()->can('admin.panel.show') == true)
|
||||||
return view(config("detector.defaultPath") . "." . $view, $args);
|
return view(config("detector.defaultPath") . "." . $view, $args);
|
||||||
|
}
|
||||||
|
if($view == "users.login" || $view == "users.logout")
|
||||||
|
return view(config("detector.mobilePath") . "." . $view, $args);
|
||||||
|
|
||||||
|
return view("errors.403", $args);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -21,6 +21,7 @@ return[
|
||||||
"dereringenvaskemaskiner" => "Der er ikke nogen vaskemaskiner",
|
"dereringenvaskemaskiner" => "Der er ikke nogen vaskemaskiner",
|
||||||
"lokation" => "Lokation",
|
"lokation" => "Lokation",
|
||||||
"kontakter" => "Kontakt",
|
"kontakter" => "Kontakt",
|
||||||
|
"telefontid" => "Telefontider",
|
||||||
"navn" => "Navn",
|
"navn" => "Navn",
|
||||||
"email"=> "E-mail",
|
"email"=> "E-mail",
|
||||||
"ring" => "Ring",
|
"ring" => "Ring",
|
||||||
|
@ -63,6 +64,7 @@ return[
|
||||||
"infoomappen" => "Denne app er udviklet til Odense erhvervskollegie.",
|
"infoomappen" => "Denne app er udviklet til Odense erhvervskollegie.",
|
||||||
"error" => "Fejl",
|
"error" => "Fejl",
|
||||||
"404" => "Denne side findes ikke.",
|
"404" => "Denne side findes ikke.",
|
||||||
|
"403" => "Du har ikke rettigheder til denne side.",
|
||||||
"canceled" => "Aflyst"
|
"canceled" => "Aflyst"
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -70,5 +70,6 @@ return[
|
||||||
"infoomappen" => "The app is developed and designed for 'Odense erhvervskollegie'.",
|
"infoomappen" => "The app is developed and designed for 'Odense erhvervskollegie'.",
|
||||||
"error" => "Error",
|
"error" => "Error",
|
||||||
"404" => "This page doesn't exist.",
|
"404" => "This page doesn't exist.",
|
||||||
|
"403" => "You don't have permissions to access this page.",
|
||||||
"canceled" => "Canceled"
|
"canceled" => "Canceled"
|
||||||
];
|
];
|
||||||
|
|
|
@ -54,7 +54,7 @@
|
||||||
[{ 'header': '1' }, { 'header': '2' }, 'blockquote' ],
|
[{ 'header': '1' }, { 'header': '2' }, 'blockquote' ],
|
||||||
[{ 'list': 'ordered' }, { 'list': 'bullet'}, { 'indent': '-1' }, { 'indent': '+1' }],
|
[{ 'list': 'ordered' }, { 'list': 'bullet'}, { 'indent': '-1' }, { 'indent': '+1' }],
|
||||||
[ {'direction': 'rtl'}, { 'align': [] }],
|
[ {'direction': 'rtl'}, { 'align': [] }],
|
||||||
[ 'link' ],
|
[ 'link', 'video' ],
|
||||||
[ 'clean' ]
|
[ 'clean' ]
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
|
|
|
@ -54,7 +54,7 @@
|
||||||
[{ 'header': '1' }, { 'header': '2' }, 'blockquote' ],
|
[{ 'header': '1' }, { 'header': '2' }, 'blockquote' ],
|
||||||
[{ 'list': 'ordered' }, { 'list': 'bullet'}, { 'indent': '-1' }, { 'indent': '+1' }],
|
[{ 'list': 'ordered' }, { 'list': 'bullet'}, { 'indent': '-1' }, { 'indent': '+1' }],
|
||||||
[ {'direction': 'rtl'}, { 'align': [] }],
|
[ {'direction': 'rtl'}, { 'align': [] }],
|
||||||
[ 'link' ],
|
[ 'link', 'video' ],
|
||||||
[ 'clean' ]
|
[ 'clean' ]
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
|
|
|
@ -95,7 +95,7 @@
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td><label>Aktivitet ansvarlig</label></td>
|
<td><label>Aktivitet ansvarlig</label></td>
|
||||||
<td>{{__('msg.af')}}: {{ \App\Event::query()->orderByDesc("date")->first()->accountable }}</td>
|
<td>Af: {{ \App\Event::query()->orderByDesc("date")->first()->accountable }}</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td><label>Tidspunkt</label></td>
|
<td><label>Tidspunkt</label></td>
|
||||||
|
|
|
@ -10,6 +10,23 @@
|
||||||
@endsection
|
@endsection
|
||||||
|
|
||||||
@section("content")
|
@section("content")
|
||||||
|
<style>
|
||||||
|
td > p, td > input {
|
||||||
|
margin: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
small {
|
||||||
|
font-size: 16px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.form-text {
|
||||||
|
display: block;
|
||||||
|
}
|
||||||
|
|
||||||
|
.text-muted {
|
||||||
|
color: #6c757d !important;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
<h1 id="errormesseages" >Opret Rolle:</h1>
|
<h1 id="errormesseages" >Opret Rolle:</h1>
|
||||||
<form method="post" action="{{ route("roles.store") }}">
|
<form method="post" action="{{ route("roles.store") }}">
|
||||||
@csrf
|
@csrf
|
||||||
|
@ -18,6 +35,208 @@
|
||||||
<input type="text" name="name" id="name" placeholder="Admin" required>
|
<input type="text" name="name" id="name" placeholder="Admin" required>
|
||||||
<label for="name">Beskrivelse:</label>
|
<label for="name">Beskrivelse:</label>
|
||||||
<input type="text" name="description" id="description" placeholder="Admin rollen bruges til administratorene" required>
|
<input type="text" name="description" id="description" placeholder="Admin rollen bruges til administratorene" required>
|
||||||
|
|
||||||
|
|
||||||
|
<div class="mb-2" style="width: 100%;">
|
||||||
|
<button id="kontoButton" type="button" class="btn btn-sde-blue mb-1 mr-1" value="konto">Konto rettigheder</button>
|
||||||
|
<button id="adminButton" type="button" class="btn btn-sde-blue mb-1">Admin rettigheder</button>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
<div id="konto">
|
||||||
|
<small class="form-text text-muted">Her kan alle basale rettigheder for appens forbrugere slås til eller fra.</small>
|
||||||
|
<table class="tbl mb-2">
|
||||||
|
<tr>
|
||||||
|
<th>Konto</th>
|
||||||
|
<th>Beskrivelse</th>
|
||||||
|
<th>Create</th>
|
||||||
|
<th>Read</th>
|
||||||
|
<th>Delete</th>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td>Konto</td>
|
||||||
|
<td><p>Egen bruger</p></td>
|
||||||
|
<td></td>
|
||||||
|
<td><input type="checkbox" name="value[]" value="ownuser.edit"></td>
|
||||||
|
<td></td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td>Nyheder</td>
|
||||||
|
<td><p>Empty</p></td>
|
||||||
|
<td></td>
|
||||||
|
<td><input type="checkbox" name="value[]" value="news.show"></td>
|
||||||
|
<td></td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td>Menuplan</td>
|
||||||
|
<td><p>Empty</p></td>
|
||||||
|
<td></td>
|
||||||
|
<td><input type="checkbox" name="value[]" value="menuplan.show"></td>
|
||||||
|
<td></td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td>Aktiviteter</td>
|
||||||
|
<td><p>Empty</p></td>
|
||||||
|
<td></td>
|
||||||
|
<td><input type="checkbox" name="value[]" value="event.show"></td>
|
||||||
|
<td></td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td>Reservationer</td>
|
||||||
|
<td>Empty</td>
|
||||||
|
<td><input type="checkbox" name="value[]" value="washing.machine.reservation.create"></td>
|
||||||
|
<td><input type="checkbox" name="value[]" value="washing.machine.reservation.show"></td>
|
||||||
|
<td><input type="checkbox" name="value[]" value="washing.machine.reservation.delete"></td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td>Kontakter</td>
|
||||||
|
<td><p>Empty</p></td>
|
||||||
|
<td></td>
|
||||||
|
<td><input type="checkbox" name="value[]" value="contact.show"></td>
|
||||||
|
<td></td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td>Vejledning</td>
|
||||||
|
<td><p>Empty</p></td>
|
||||||
|
<td></td>
|
||||||
|
<td><input type="checkbox" name="value[]" value="guides.show"></td>
|
||||||
|
<td></td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td>Feedback</td>
|
||||||
|
<td>Empty</td>
|
||||||
|
<td><input type="checkbox" name="value[]" value="feedback.create"></td>
|
||||||
|
<td><input type="checkbox" name="value[]" value="feedback.show"></td>
|
||||||
|
<td></td>
|
||||||
|
</tr>
|
||||||
|
</table>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<div id="admin">
|
||||||
|
<small class="form-text text-muted">Her kan alle rettigheder for administrationssiden slås til eller fra.</small>
|
||||||
|
<table class="tbl mb-2" >
|
||||||
|
<tr><!--Header Start-->
|
||||||
|
<th>Side</th>
|
||||||
|
<th>Beskrivelse</th>
|
||||||
|
<th>Create</th>
|
||||||
|
<th>Read</th>
|
||||||
|
<th>Update</th>
|
||||||
|
<th>Delete</th>
|
||||||
|
<th>Fuld Kontrol</th>
|
||||||
|
</tr><!--Header Slut-->
|
||||||
|
<tr>
|
||||||
|
<td>Admin Panel</td>
|
||||||
|
<td><p>Adgang til admin panelet</p></td>
|
||||||
|
<td></td>
|
||||||
|
<td><input type="checkbox" name="value[]" value="admin.panel.show"></td>
|
||||||
|
<td></td>
|
||||||
|
<td></td>
|
||||||
|
<td></td>
|
||||||
|
</tr>
|
||||||
|
<tr><!--Bruger Start-->
|
||||||
|
<td>Brugere</td>
|
||||||
|
<td><p>Empty</p></td>
|
||||||
|
<td><input id="UserC" type="checkbox" name="value[]" value="user.create"></td>
|
||||||
|
<td><input id="UserR" type="checkbox" name="value[]" value="user.show"></td>
|
||||||
|
<td><input id="UserU" type="checkbox" name="value[]" value="user.edit"></td>
|
||||||
|
<td><input id="UserD" type="checkbox" name="value[]" value="user.delete"></td>
|
||||||
|
<td><input id="User" type="checkbox" onclick="FullControl(this)"></td>
|
||||||
|
</tr><!--Bruger Start-->
|
||||||
|
<tr>
|
||||||
|
<td>Roller</td>
|
||||||
|
<td><p>Empty</p></td>
|
||||||
|
<td><input id="RoleC" type="checkbox" name="value[]" value="roles.create"></td>
|
||||||
|
<td><input id="RoleR" type="checkbox" name="value[]" value="roles.show"></td>
|
||||||
|
<td><input id="RoleU" type="checkbox" name="value[]" value="roles.edit"></td>
|
||||||
|
<td><input id="RoleD" type="checkbox" name="value[]" value="roles.delete"></td>
|
||||||
|
<td><input id="Role" type="checkbox" onclick="FullControl(this)"></td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td>Nyheder</td>
|
||||||
|
<td><p>Empty</p></td>
|
||||||
|
<td><input id="NewsC" type="checkbox" name="value[]" value="Bike"></td>
|
||||||
|
<td><input id="NewsR" type="checkbox" name="value[]" value="Bike"></td>
|
||||||
|
<td><input id="NewsU" type="checkbox" name="value[]" value="Bike"></td>
|
||||||
|
<td><input id="NewsD" type="checkbox" name="value[]" value="Bike"></td>
|
||||||
|
<td><input id="News" type="checkbox" onclick="FullControl(this)"></td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td>Menuplan</td>
|
||||||
|
<td><p>Empty</p></td>
|
||||||
|
<td><input id="MenuC" type="checkbox" name="value[]" value="news.create"></td>
|
||||||
|
<td><input id="MenuR" type="checkbox" name="value[]" value="news.show"></td>
|
||||||
|
<td><input id="MenuU" type="checkbox" name="value[]" value="news.edit"></td>
|
||||||
|
<td><input id="MenuD" type="checkbox" name="value[]" value="news.delete"></td>
|
||||||
|
<td><input id="Menu" type="checkbox" onclick="FullControl(this)"></td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td>Aktiviteter</td>
|
||||||
|
<td><p>Empty</p></td>
|
||||||
|
<td><input id="EventC" type="checkbox" name="value[]" value="events.create"></td>
|
||||||
|
<td><input id="EventR" type="checkbox" name="value[]" value="events.show"></td>
|
||||||
|
<td><input id="EventU" type="checkbox" name="value[]" value="events.edit"></td>
|
||||||
|
<td><input id="EventD" type="checkbox" name="value[]" value="events.delete"></td>
|
||||||
|
<td><input id="Event" type="checkbox" onclick="FullControl(this)"></td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td>Lokation</td>
|
||||||
|
<td><p>Empty</p></td>
|
||||||
|
<td><input id="LocationC" type="checkbox" name="value[]" value="locations.create"></td>
|
||||||
|
<td><input id="LocationR" type="checkbox" name="value[]" value="locations.show"></td>
|
||||||
|
<td><input id="LocationU" type="checkbox" name="value[]" value="locations.edit"></td>
|
||||||
|
<td><input id="LocationD" type="checkbox" name="value[]" value="locations.delete"></td>
|
||||||
|
<td><input id="Location" type="checkbox" onclick="FullControl(this)"></td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td>Vaskemaskiner</td>
|
||||||
|
<td><p>Empty</p></td>
|
||||||
|
<td><input id="WashingMachineC" type="checkbox" name="value[]" value="washing.machine.create"></td>
|
||||||
|
<td><input id="WashingMachineR" type="checkbox" name="value[]" value="washing.machine.show"></td>
|
||||||
|
<td><input id="WashingMachineU" type="checkbox" name="value[]" value="washing.machine.edit"></td>
|
||||||
|
<td><input id="WashingMachineD" type="checkbox" name="value[]" value="washing.machine.delete"></td>
|
||||||
|
<td><input id="WashingMachine" type="checkbox" onclick="FullControl(this)"></td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td>Reservationer</td>
|
||||||
|
<td>Empty</td>
|
||||||
|
<td><input id="ReservationC" type="checkbox" name="value[]" value="washing.machine.reservation.create"></td>
|
||||||
|
<td><input id="ReservationR" type="checkbox" name="value[]" value="washing.machine.reservation.show"></td>
|
||||||
|
<td><input id="ReservationU" type="checkbox" name="value[]" value="washing.machine.reservation.edit"></td>
|
||||||
|
<td><input id="ReservationD" type="checkbox" name="value[]" value="washing.machine.reservation.delete"></td>
|
||||||
|
<td><input id="Reservation" type="checkbox" onclick="FullControl(this)"></td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td>Kontakter</td>
|
||||||
|
<td><p>Empty</p></td>
|
||||||
|
<td><input id="ContactC" type="checkbox" name="value[]" value="contact.create"></td>
|
||||||
|
<td><input id="ContactR" type="checkbox" name="value[]" value="contact.show"></td>
|
||||||
|
<td><input id="ContactU" type="checkbox" name="value[]" value="contact.edit"></td>
|
||||||
|
<td><input id="ContactD" type="checkbox" name="value[]" value="contact.delete"></td>
|
||||||
|
<td><input id="Contact" type="checkbox" onclick="FullControl(this)"></td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td>Vejledning</td>
|
||||||
|
<td><p>Empty</p></td>
|
||||||
|
<td><input id="GuideC" type="checkbox" name="value[]" value="guides.create"></td>
|
||||||
|
<td><input id="GuideR" type="checkbox" name="value[]" value="guides.show"></td>
|
||||||
|
<td><input id="GuideU" type="checkbox" name="value[]" value="guides.edit"></td>
|
||||||
|
<td><input id="GuideD" type="checkbox" name="value[]" value="guides.delete"></td>
|
||||||
|
<td><input id="Guide" type="checkbox" onclick="FullControl(this)"></td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td>Feedback</td>
|
||||||
|
<td><p>Empty</p></td>
|
||||||
|
<td><input id="FeedbackC" type="checkbox" name="value[]" value="feedback.create"></td>
|
||||||
|
<td><input id="FeedbackR" type="checkbox" name="value[]" value="feedback.show"></td>
|
||||||
|
<td><input id="FeedbackU" type="checkbox" name="value[]" value="feedback.edit"></td>
|
||||||
|
<td><input id="FeedbackD" type="checkbox" name="value[]" value="feedback.delete"></td>
|
||||||
|
<td><input id="Feedback" type="checkbox" onclick="FullControl(this)"></td>
|
||||||
|
</tr>
|
||||||
|
</table>
|
||||||
|
</div>
|
||||||
|
|
||||||
<input type="submit" id="disable" class="btn btn-dark text-white" value="Opret">
|
<input type="submit" id="disable" class="btn btn-dark text-white" value="Opret">
|
||||||
</form>
|
</form>
|
||||||
@endsection
|
@endsection
|
||||||
|
@ -81,5 +300,56 @@
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
})
|
})
|
||||||
|
|
||||||
|
// hide permissions
|
||||||
|
$('#konto').hide();
|
||||||
|
$('#admin').hide();
|
||||||
|
|
||||||
|
|
||||||
|
//Show konto settings
|
||||||
|
$("#kontoButton").click(function(){
|
||||||
|
var value = $('#kontoButton').text();
|
||||||
|
if(value === 'Konto rettigheder'){
|
||||||
|
$('#konto').slideDown('slow');
|
||||||
|
$('#kontoButton').html('Luk konto rettigheder')
|
||||||
|
}else{
|
||||||
|
$('#konto').slideUp('slow');
|
||||||
|
$('#kontoButton').html('Konto rettigheder')
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
|
//Show admin permissions
|
||||||
|
$("#adminButton").click(function(){
|
||||||
|
var value = $('#adminButton').text();
|
||||||
|
if(value === 'Admin rettigheder'){
|
||||||
|
$('#admin').slideDown('slow');
|
||||||
|
$('#adminButton').html('Luk admin rettigheder')
|
||||||
|
}else{
|
||||||
|
$('#admin').slideUp('slow');
|
||||||
|
$('#adminButton').html('Admin rettigheder')
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
function FullControl(FC) { //FC == Full Controll
|
||||||
|
var Create = $(FC).attr('id') + 'C'; // Takes FC's ID Name and puts C at the back of it
|
||||||
|
var Read = $(FC).attr('id') + 'R'; // Takes FC's ID Name and puts R at the back of it
|
||||||
|
var Update = $(FC).attr('id') + 'U'; // Takes FC's ID Name and puts U at the back of it
|
||||||
|
var Delete = $(FC).attr('id') + 'D'; // Takes FC's ID Name and puts D at the back of it
|
||||||
|
|
||||||
|
$(FC).prop('checked', false);
|
||||||
|
|
||||||
|
if ($('#' + Create).prop('checked') == true && $('#' + Read).prop('checked') == true && $('#' + Update).prop('checked') == true && $('#' + Delete).prop('checked') == true) {
|
||||||
|
$('#' + Create).prop('checked', false);
|
||||||
|
$('#' + Read).prop('checked', false);
|
||||||
|
$('#' + Update).prop('checked', false);
|
||||||
|
$('#' + Delete).prop('checked', false);
|
||||||
|
} else {
|
||||||
|
$('#' + Create).prop('checked', true);
|
||||||
|
$('#' + Read).prop('checked', true);
|
||||||
|
$('#' + Update).prop('checked', true);
|
||||||
|
$('#' + Delete).prop('checked', true);
|
||||||
|
}
|
||||||
|
}
|
||||||
</script>
|
</script>
|
||||||
@endsection
|
@endsection
|
||||||
|
|
|
@ -10,6 +10,23 @@
|
||||||
@endsection
|
@endsection
|
||||||
|
|
||||||
@section("content")
|
@section("content")
|
||||||
|
<style>
|
||||||
|
td > p, td > input {
|
||||||
|
margin: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
small {
|
||||||
|
font-size: 16px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.form-text {
|
||||||
|
display: block;
|
||||||
|
}
|
||||||
|
|
||||||
|
.text-muted {
|
||||||
|
color: #6c757d !important;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
<h1>Rediger Rolle:</h1>
|
<h1>Rediger Rolle:</h1>
|
||||||
<form method="post" action="{{ route("roles.update", ['role' => $role]) }}">
|
<form method="post" action="{{ route("roles.update", ['role' => $role]) }}">
|
||||||
@csrf
|
@csrf
|
||||||
|
@ -19,6 +36,209 @@
|
||||||
<input type="text" name="name" id="name" placeholder="Admin" value="{{ $role->name }}" required>
|
<input type="text" name="name" id="name" placeholder="Admin" value="{{ $role->name }}" required>
|
||||||
<label for="name">Beskrivelse:</label>
|
<label for="name">Beskrivelse:</label>
|
||||||
<input type="text" name="description" id="description" placeholder="Admin rollen bruges til administratorene" value="{{ $role->description }}" required>
|
<input type="text" name="description" id="description" placeholder="Admin rollen bruges til administratorene" value="{{ $role->description }}" required>
|
||||||
|
|
||||||
|
|
||||||
|
<div class="mb-2" style="width: 100%;">
|
||||||
|
<button id="kontoButton" type="button" class="btn btn-sde-blue mb-1 mr-1" value="konto">Rediger konto rettigheder</button>
|
||||||
|
<button id="adminButton" type="button" class="btn btn-sde-blue mb-1">Rediger admin rettigheder</button>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
<div id="konto">
|
||||||
|
<small class="form-text text-muted">Her kan alle basale rettigheder for appens forbrugere slås til eller fra.</small>
|
||||||
|
<table class="tbl mb-2">
|
||||||
|
<tr>
|
||||||
|
<th>Konto</th>
|
||||||
|
<th>Beskrivelse</th>
|
||||||
|
<th>Create</th>
|
||||||
|
<th>Read</th>
|
||||||
|
<th>Delete</th>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td>Konto</td>
|
||||||
|
<td><p>Egen bruger</p></td>
|
||||||
|
<td></td>
|
||||||
|
<td><input type="checkbox" name="value[]" value="ownuser.edit"></td>
|
||||||
|
<td></td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td>Nyheder</td>
|
||||||
|
<td><p>Empty</p></td>
|
||||||
|
<td></td>
|
||||||
|
<td><input type="checkbox" name="value[]" value="news.show"></td>
|
||||||
|
<td></td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td>Menuplan</td>
|
||||||
|
<td><p>Empty</p></td>
|
||||||
|
<td></td>
|
||||||
|
<td><input type="checkbox" name="value[]" value="menuplan.show"></td>
|
||||||
|
<td></td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td>Aktiviteter</td>
|
||||||
|
<td><p>Empty</p></td>
|
||||||
|
<td></td>
|
||||||
|
<td><input type="checkbox" name="value[]" value="event.show"></td>
|
||||||
|
<td></td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td>Reservationer</td>
|
||||||
|
<td>Empty</td>
|
||||||
|
<td><input type="checkbox" name="value[]" value="washing.machine.reservation.create"></td>
|
||||||
|
<td><input type="checkbox" name="value[]" value="washing.machine.reservation.show"></td>
|
||||||
|
<td><input type="checkbox" name="value[]" value="washing.machine.reservation.delete"></td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td>Kontakter</td>
|
||||||
|
<td><p>Empty</p></td>
|
||||||
|
<td></td>
|
||||||
|
<td><input type="checkbox" name="value[]" value="contact.show"></td>
|
||||||
|
<td></td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td>Vejledning</td>
|
||||||
|
<td><p>Empty</p></td>
|
||||||
|
<td></td>
|
||||||
|
<td><input type="checkbox" name="value[]" value="guides.show"></td>
|
||||||
|
<td></td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td>Feedback</td>
|
||||||
|
<td>Empty</td>
|
||||||
|
<td><input type="checkbox" name="value[]" value="feedback.create"></td>
|
||||||
|
<td><input type="checkbox" name="value[]" value="feedback.show"></td>
|
||||||
|
<td></td>
|
||||||
|
</tr>
|
||||||
|
</table>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<div id="admin">
|
||||||
|
<small class="form-text text-muted">Her kan alle rettigheder for administrationssiden slås til eller fra.</small>
|
||||||
|
<table class="tbl mb-2" >
|
||||||
|
<tr><!--Header Start-->
|
||||||
|
<th>Side</th>
|
||||||
|
<th>Beskrivelse</th>
|
||||||
|
<th>Create</th>
|
||||||
|
<th>Read</th>
|
||||||
|
<th>Update</th>
|
||||||
|
<th>Delete</th>
|
||||||
|
<th>Fuld Kontrol</th>
|
||||||
|
</tr><!--Header Slut-->
|
||||||
|
<tr>
|
||||||
|
<td>Admin Panel</td>
|
||||||
|
<td><p>Adgang til admin panelet</p></td>
|
||||||
|
<td></td>
|
||||||
|
<td><input type="checkbox" name="value[]" value="admin.panel.show"></td>
|
||||||
|
<td></td>
|
||||||
|
<td></td>
|
||||||
|
<td></td>
|
||||||
|
</tr>
|
||||||
|
<tr><!--Bruger Start-->
|
||||||
|
<td>Brugere</td>
|
||||||
|
<td><p>Empty</p></td>
|
||||||
|
<td><input type="checkbox" name="value[]" value="user.create"></td>
|
||||||
|
<td><input type="checkbox" name="value[]" value="user.show"></td>
|
||||||
|
<td><input type="checkbox" name="value[]" value="user.edit"></td>
|
||||||
|
<td><input type="checkbox" name="value[]" value="user.delete"></td>
|
||||||
|
<td><input type="checkbox" name="value[]" value="Bike"></td><!--Lave en rolle som give fuld adgang ligesom ownuser.edit-->
|
||||||
|
</tr><!--Bruger Start-->
|
||||||
|
<tr>
|
||||||
|
<td>Roller</td>
|
||||||
|
<td><p>Empty</p></td>
|
||||||
|
<td><input type="checkbox" name="value[]" value="roles.create"></td>
|
||||||
|
<td><input type="checkbox" name="value[]" value="roles.show"></td>
|
||||||
|
<td><input type="checkbox" name="value[]" value="roles.edit"></td>
|
||||||
|
<td><input type="checkbox" name="value[]" value="roles.delete"></td>
|
||||||
|
<td><input type="checkbox" name="value[]" value="Bike"></td><!--Lave en rolle som give fuld adgang ligesom ownuser.edit-->
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td>Nyheder</td>
|
||||||
|
<td><p>Empty</p></td>
|
||||||
|
<td><input type="checkbox" name="value[]" value="Bike"></td>
|
||||||
|
<td><input type="checkbox" name="value[]" value="Bike"></td>
|
||||||
|
<td><input type="checkbox" name="value[]" value="Bike"></td>
|
||||||
|
<td><input type="checkbox" name="value[]" value="Bike"></td>
|
||||||
|
<td><input type="checkbox" name="value[]" value="Bike"></td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td>Menuplan</td>
|
||||||
|
<td><p>Empty</p></td>
|
||||||
|
<td><input type="checkbox" name="value[]" value="news.create"></td>
|
||||||
|
<td><input type="checkbox" name="value[]" value="news.show"></td>
|
||||||
|
<td><input type="checkbox" name="value[]" value="news.edit"></td>
|
||||||
|
<td><input type="checkbox" name="value[]" value="news.delete"></td>
|
||||||
|
<td><input type="checkbox" name="value[]" value="Bike"></td><!--Lave en rolle som give fuld adgang ligesom ownuser.edit-->
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td>Aktiviteter</td>
|
||||||
|
<td><p>Empty</p></td>
|
||||||
|
<td><input type="checkbox" name="value[]" value="events.create"></td>
|
||||||
|
<td><input type="checkbox" name="value[]" value="events.show"></td>
|
||||||
|
<td><input type="checkbox" name="value[]" value="events.edit"></td>
|
||||||
|
<td><input type="checkbox" name="value[]" value="events.delete"></td>
|
||||||
|
<td><input type="checkbox" name="value[]" value="Bike"></td><!--Lave en rolle som give fuld adgang ligesom ownuser.edit-->
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td>Lokation</td>
|
||||||
|
<td><p>Empty</p></td>
|
||||||
|
<td><input type="checkbox" name="value[]" value="locations.create"></td>
|
||||||
|
<td><input type="checkbox" name="value[]" value="locations.show"></td>
|
||||||
|
<td><input type="checkbox" name="value[]" value="locations.edit"></td>
|
||||||
|
<td><input type="checkbox" name="value[]" value="locations.delete"></td>
|
||||||
|
<td><input type="checkbox" name="value[]" value="Bike"></td><!--Lave en rolle som give fuld adgang ligesom ownuser.edit-->
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td>Vaskemaskiner</td>
|
||||||
|
<td><p>Empty</p></td>
|
||||||
|
<td><input type="checkbox" name="value[]" value="washing.machine.create"></td>
|
||||||
|
<td><input type="checkbox" name="value[]" value="washing.machine.show"></td>
|
||||||
|
<td><input type="checkbox" name="value[]" value="washing.machine.edit"></td>
|
||||||
|
<td><input type="checkbox" name="value[]" value="washing.machine.delete"></td>
|
||||||
|
<td><input type="checkbox" name="value[]" value="Bike"></td><!--Lave en rolle som give fuld adgang ligesom ownuser.edit-->
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td>Reservationer</td>
|
||||||
|
<td>Empty</td>
|
||||||
|
<td><input type="checkbox" name="value[]" value="washing.machine.reservation.create"></td>
|
||||||
|
<td><input type="checkbox" name="value[]" value="washing.machine.reservation.show"></td>
|
||||||
|
<td><input type="checkbox" name="value[]" value="washing.machine.reservation.edit"></td>
|
||||||
|
<td><input type="checkbox" name="value[]" value="washing.machine.reservation.delete"></td>
|
||||||
|
<td><input type="checkbox" name="value[]" value="Bike"></td><!--Lave en rolle som give fuld adgang ligesom ownuser.edit-->
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td>Kontakter</td>
|
||||||
|
<td><p>Empty</p></td>
|
||||||
|
<td><input type="checkbox" name="value[]" value="contact.create"></td>
|
||||||
|
<td><input type="checkbox" name="value[]" value="contact.show"></td>
|
||||||
|
<td><input type="checkbox" name="value[]" value="contact.edit"></td>
|
||||||
|
<td><input type="checkbox" name="value[]" value="contact.delete"></td>
|
||||||
|
<td><input type="checkbox" name="value[]" value="Bike"></td><!--Lave en rolle som give fuld adgang ligesom ownuser.edit-->
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td>Vejledning</td>
|
||||||
|
<td><p>Empty</p></td>
|
||||||
|
<td><input type="checkbox" name="value[]" value="guides.create"></td>
|
||||||
|
<td><input type="checkbox" name="value[]" value="guides.show"></td>
|
||||||
|
<td><input type="checkbox" name="value[]" value="guides.edit"></td>
|
||||||
|
<td><input type="checkbox" name="value[]" value="guides.delete"></td>
|
||||||
|
<td><input type="checkbox" name="value[]" value="Bike"></td><!--Lave en rolle som give fuld adgang ligesom ownuser.edit-->
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td>Feedback</td>
|
||||||
|
<td><p>Empty</p></td>
|
||||||
|
<td><input type="checkbox" name="value[]" value="feedback.create"></td>
|
||||||
|
<td><input type="checkbox" name="value[]" value="feedback.show"></td>
|
||||||
|
<td><input type="checkbox" name="value[]" value="feedback.edit"></td>
|
||||||
|
<td><input type="checkbox" name="value[]" value="feedback.delete"></td>
|
||||||
|
<td><input type="checkbox" name="value[]" value="Bike"></td><!--Lave en rolle som give fuld adgang ligesom ownuser.edit-->
|
||||||
|
</tr>
|
||||||
|
</table>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
<input type="submit" id="disable" class="btn btn-dark text-white" value="Rediger">
|
<input type="submit" id="disable" class="btn btn-dark text-white" value="Rediger">
|
||||||
</form>
|
</form>
|
||||||
@endsection
|
@endsection
|
||||||
|
@ -82,5 +302,39 @@
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|
||||||
|
// hide permissions
|
||||||
|
$('#konto').hide();
|
||||||
|
$('#admin').hide();
|
||||||
|
|
||||||
|
|
||||||
|
//Show konto settings
|
||||||
|
$("#kontoButton").click(function(){
|
||||||
|
var value = $('#kontoButton').text();
|
||||||
|
if(value === 'Rediger konto rettigheder'){
|
||||||
|
$('#konto').slideDown('slow');
|
||||||
|
$('#kontoButton').html('Luk konto rettigheder')
|
||||||
|
}else{
|
||||||
|
$('#konto').slideUp('slow');
|
||||||
|
$('#kontoButton').html('Rediger konto rettigheder')
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
|
//Show admin permissions
|
||||||
|
$("#adminButton").click(function(){
|
||||||
|
var value = $('#adminButton').text();
|
||||||
|
if(value === 'Rediger admin rettigheder'){
|
||||||
|
$('#admin').slideDown('slow');
|
||||||
|
$('#adminButton').html('Luk admin rettigheder')
|
||||||
|
}else{
|
||||||
|
$('#admin').slideUp('slow');
|
||||||
|
$('#adminButton').html('Rediger admin rettigheder')
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
@endsection
|
@endsection
|
||||||
|
|
|
@ -11,7 +11,7 @@
|
||||||
|
|
||||||
@section("content")
|
@section("content")
|
||||||
<h1>Rediger Bruger:</h1>
|
<h1>Rediger Bruger:</h1>
|
||||||
<form method="post" action="{{ route("users.update", ['user' => $user]) }}" onsubmit="return checkInputs()">
|
<form method="post" action="{{ route("users.update", ['user' => $user]) }}" onsubmit="return checkInputs()" enctype="multipart/form-data">
|
||||||
@csrf
|
@csrf
|
||||||
@method("put")
|
@method("put")
|
||||||
<label for="name_first">Fornavn:</label>
|
<label for="name_first">Fornavn:</label>
|
||||||
|
@ -20,7 +20,7 @@
|
||||||
<input type="text" name="name_last" id="name_last" value="{{ $user->name_last }}" required>
|
<input type="text" name="name_last" id="name_last" value="{{ $user->name_last }}" required>
|
||||||
<label for="email">Email:</label>
|
<label for="email">Email:</label>
|
||||||
<label hidden id="erroremail">Der findes allerede en bruger med denne email!</label>
|
<label hidden id="erroremail">Der findes allerede en bruger med denne email!</label>
|
||||||
<input type="email" name="email" id="email" value="{{ $user->email }}" required>
|
<input type="email" name="email" id="email" placeholder="x@y.z" value="{{ $user->email }}" required>
|
||||||
<label for="password1">Password: (Forblives blank, hvis password ikke skal ændres)</label>
|
<label for="password1">Password: (Forblives blank, hvis password ikke skal ændres)</label>
|
||||||
<label hidden id="errornotsamepass" for="errormesseages">Der stod ikke det samme i `Adgangskode` & `Bekræft Adgangskode`!</label>
|
<label hidden id="errornotsamepass" for="errormesseages">Der stod ikke det samme i `Adgangskode` & `Bekræft Adgangskode`!</label>
|
||||||
<div class="input-group text-left">
|
<div class="input-group text-left">
|
||||||
|
@ -34,7 +34,7 @@
|
||||||
</div>
|
</div>
|
||||||
<label for="tel">Telefon nr:</label>
|
<label for="tel">Telefon nr:</label>
|
||||||
<label hidden id="errorphone">Der findes allerede en bruger med dette telefon nr!</label>
|
<label hidden id="errorphone">Der findes allerede en bruger med dette telefon nr!</label>
|
||||||
<input type="tel" name="phone" id="phone" value="{{ $user->phone }}" required>
|
<input type="tel" name="phone" id="phone" value="{{ $user->phone }}" placeholder="12345678" pattern="[0-9]{2}[0-9]{2}[0-9]{2}[0-9]{2}" required>
|
||||||
<label for="role">Rolle: (Brug ctrl og shift til at vælge flere)</label>
|
<label for="role">Rolle: (Brug ctrl og shift til at vælge flere)</label>
|
||||||
<select class="w-100" name="roles[]" id="roles" class="mb-2" multiple="multiple" required>
|
<select class="w-100" name="roles[]" id="roles" class="mb-2" multiple="multiple" required>
|
||||||
@if(count($user->roles) == 0)
|
@if(count($user->roles) == 0)
|
||||||
|
@ -57,6 +57,8 @@
|
||||||
@endforeach
|
@endforeach
|
||||||
@endif
|
@endif
|
||||||
</select>
|
</select>
|
||||||
|
<label for="fileuploade">Skift brugerens profile billede:</label>
|
||||||
|
<input id="fileuploade" type="file" name="resource" accept="image/*">
|
||||||
<input type="submit" class="btn btn-dark text-white" value="Rediger">
|
<input type="submit" class="btn btn-dark text-white" value="Rediger">
|
||||||
</form>
|
</form>
|
||||||
@endsection
|
@endsection
|
||||||
|
|
|
@ -29,7 +29,6 @@
|
||||||
text-align: center;
|
text-align: center;
|
||||||
border-radius: 6px;
|
border-radius: 6px;
|
||||||
padding: 5px 0;
|
padding: 5px 0;
|
||||||
/* Position the tooltip */
|
|
||||||
position: absolute;
|
position: absolute;
|
||||||
z-index: 10;
|
z-index: 10;
|
||||||
top: -5px;
|
top: -5px;
|
||||||
|
|
|
@ -16,7 +16,7 @@
|
||||||
<label class="toggle">
|
<label class="toggle">
|
||||||
<input class="toggle__input" type="checkbox" name="rememberpassword">
|
<input class="toggle__input" type="checkbox" name="rememberpassword">
|
||||||
<span class="toggle__label">
|
<span class="toggle__label">
|
||||||
<span class="toggle__text text-white">Remember password</span>
|
<span class="toggle__text text-white">Remember me</span>
|
||||||
</span>
|
</span>
|
||||||
</label>
|
</label>
|
||||||
{!! session()->get('success#passwordchange') !!}
|
{!! session()->get('success#passwordchange') !!}
|
||||||
|
|
|
@ -5,6 +5,10 @@
|
||||||
|
|
||||||
@section("content")
|
@section("content")
|
||||||
<style>
|
<style>
|
||||||
|
iframe, .ql-video {
|
||||||
|
width: 100%;
|
||||||
|
}
|
||||||
|
|
||||||
div.card {
|
div.card {
|
||||||
margin-top: 1rem;
|
margin-top: 1rem;
|
||||||
margin-bottom: 30px;
|
margin-bottom: 30px;
|
||||||
|
|
|
@ -6,6 +6,10 @@
|
||||||
|
|
||||||
@section("content")
|
@section("content")
|
||||||
<style>
|
<style>
|
||||||
|
iframe, .ql-video {
|
||||||
|
width: 100%;
|
||||||
|
}
|
||||||
|
|
||||||
h2, h3, h4 {
|
h2, h3, h4 {
|
||||||
margin-top: 0;
|
margin-top: 0;
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,6 +1,10 @@
|
||||||
@extends("app.layout.base")
|
@extends("app.layout.base")
|
||||||
@section("content")
|
@section("content")
|
||||||
<style>
|
<style>
|
||||||
|
iframe, .ql-video {
|
||||||
|
width: 100%;
|
||||||
|
}
|
||||||
|
|
||||||
div.card {
|
div.card {
|
||||||
margin-top: 1rem;
|
margin-top: 1rem;
|
||||||
margin-bottom: 30px;
|
margin-bottom: 30px;
|
||||||
|
|
|
@ -13,9 +13,9 @@
|
||||||
<span>{{__('msg.navn')}}:</span>
|
<span>{{__('msg.navn')}}:</span>
|
||||||
<input type="text" value="{{ Auth::user()->name_first . " " . Auth::user()->name_last }}" disabled>
|
<input type="text" value="{{ Auth::user()->name_first . " " . Auth::user()->name_last }}" disabled>
|
||||||
<span>{{__('msg.email')}}:</span>
|
<span>{{__('msg.email')}}:</span>
|
||||||
<input type="email" name="email" id="email" value="{{ Auth::user()->email }}" required>
|
<input type="email" name="email" id="email" placeholder="x@y.z" value="{{ Auth::user()->email }}" required>
|
||||||
<span>{{__('msg.telefon')}} Nr.:</span>
|
<span>{{__('msg.telefon')}} Nr.:</span>
|
||||||
<input type="text" name="phone" id="phone" value="{{ Auth::user()->phone }}" required>
|
<input type="tel" name="phone" id="phone" value="{{ Auth::user()->phone }}" placeholder="12345678" pattern="[0-9]{2}[0-9]{2}[0-9]{2}[0-9]{2}" required>
|
||||||
<button type="submit" class="btn text-center btn-sde-blue mt-1">{{__('msg.rediger')}}</button>
|
<button type="submit" class="btn text-center btn-sde-blue mt-1">{{__('msg.rediger')}}</button>
|
||||||
<a onclick="window.history.back()" class="btn text-center btn-sde-blue mt-1">{{__('msg.tilbage')}}</a>
|
<a onclick="window.history.back()" class="btn text-center btn-sde-blue mt-1">{{__('msg.tilbage')}}</a>
|
||||||
</form>
|
</form>
|
||||||
|
|
|
@ -19,7 +19,7 @@
|
||||||
<label class="toggle">
|
<label class="toggle">
|
||||||
<input class="toggle__input" type="checkbox" name="rememberpassword">
|
<input class="toggle__input" type="checkbox" name="rememberpassword">
|
||||||
<span class="toggle__label">
|
<span class="toggle__label">
|
||||||
<span class="toggle__text text-white">Remember password</span>
|
<span class="toggle__text text-white">Remember me</span>
|
||||||
</span>
|
</span>
|
||||||
</label>
|
</label>
|
||||||
{!! session()->get('success#passwordchange') !!}
|
{!! session()->get('success#passwordchange') !!}
|
||||||
|
|
|
@ -0,0 +1,78 @@
|
||||||
|
<!DOCTYPE html>
|
||||||
|
<html lang="en">
|
||||||
|
<head>
|
||||||
|
<title>@yield("title")</title>
|
||||||
|
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||||
|
@if(request()->cookie("mode") == "dark")
|
||||||
|
<link type="text/css" rel="stylesheet" href="{{ mix("/css/webappdark.css") }}">
|
||||||
|
@else
|
||||||
|
<link type="text/css" rel="stylesheet" href="{{ mix("/css/webapp.css") }}">
|
||||||
|
@endif
|
||||||
|
|
||||||
|
<script type="text/javascript">
|
||||||
|
function setMain() {
|
||||||
|
var main = document.getElementsByTagName("main")[0];
|
||||||
|
var header = document.getElementsByTagName("header")[0];
|
||||||
|
main.style.minHeight = 'calc(100% - ' + header.clientHeight + 'px)';
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
</head>
|
||||||
|
<body onload="onLoadRedirect()">
|
||||||
|
|
||||||
|
<main style="justify-content: unset">
|
||||||
|
<h1 class="sde-blue" style="font-size: 12vw; text-align: center">{{__("msg.error")}}</h1>
|
||||||
|
<p class="mb-0" style="text-align: center; font-size: 3.25vw;">{{__("msg.403")}}</p>
|
||||||
|
</main>
|
||||||
|
|
||||||
|
<script src="{{ mix("/js/app.js") }}"></script>
|
||||||
|
@if(request()->cookie("mode") == "dark")
|
||||||
|
<script type="text/javascript">
|
||||||
|
function toggleMenu(menu) {
|
||||||
|
let menuElement = document.getElementById(menu);
|
||||||
|
let logoElement = document.getElementById("sdeLogo");
|
||||||
|
let htmlElement = document.getElementsByTagName('html')[0];
|
||||||
|
let bodyElement = document.getElementsByTagName('body')[0];
|
||||||
|
let mainElement = document.getElementsByTagName('main')[0];
|
||||||
|
let iconElement = document.getElementById("icon");
|
||||||
|
let headerElement = document.getElementById("header");
|
||||||
|
|
||||||
|
if(menuElement.classList.contains("hide")) {
|
||||||
|
menuElement.classList.remove("hide");
|
||||||
|
mainElement.classList.remove("d-none");
|
||||||
|
htmlElement.style.backgroundColor = '';
|
||||||
|
bodyElement.style.backgroundColor = '#666666';
|
||||||
|
logoElement.src = '/images/logos/Logo-hvid.svg';
|
||||||
|
iconElement.classList.remove("fa-times");
|
||||||
|
iconElement.classList.add("fa-bars");
|
||||||
|
headerElement.style.backgroundColor = '';
|
||||||
|
} else {
|
||||||
|
menuElement.classList.add("hide");
|
||||||
|
mainElement.classList.add("d-none");
|
||||||
|
htmlElement.style.backgroundColor = 'rgb(0, 120, 138)';
|
||||||
|
bodyElement.style.backgroundColor = 'rgb(0, 120, 138)';
|
||||||
|
logoElement.src = '/images/logos/Logo-hvid.svg';
|
||||||
|
iconElement.classList.remove("fa-bars");
|
||||||
|
iconElement.classList.add("fa-times");
|
||||||
|
headerElement.style.backgroundColor = 'rgb(0, 120, 138)';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if(document.getElementById("toggle"))
|
||||||
|
document.getElementById("toggle").onclick = function () {
|
||||||
|
toggleMenu('menu');
|
||||||
|
};
|
||||||
|
</script>
|
||||||
|
@endif
|
||||||
|
@yield("scripts")
|
||||||
|
<script>
|
||||||
|
function onLoadRedirect(){
|
||||||
|
setTimeout(function () {
|
||||||
|
if(window.history.back() !== undefined)
|
||||||
|
window.location.href = window.history.back();
|
||||||
|
else
|
||||||
|
window.location.href = "{{route("root.index")}}";
|
||||||
|
}, 3000)
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
</body>
|
||||||
|
</html>
|
Loading…
Reference in New Issue