From 4cdd7256ef2552511ea71611778c9aba587c9cc5 Mon Sep 17 00:00:00 2001
From: Julian Prieber <60265788+JulianPrieber@users.noreply.github.com>
Date: Sat, 15 Jul 2023 17:32:37 +0200
Subject: [PATCH] Added theme selector to edit user page
---
app/Http/Controllers/AdminController.php | 5 ++-
resources/views/panel/edit-user.blade.php | 46 ++++++++++++++++++++---
2 files changed, 44 insertions(+), 7 deletions(-)
diff --git a/app/Http/Controllers/AdminController.php b/app/Http/Controllers/AdminController.php
index 44b6396..40d79ab 100755
--- a/app/Http/Controllers/AdminController.php
+++ b/app/Http/Controllers/AdminController.php
@@ -267,11 +267,12 @@ public function SendTestMail(Request $request)
$littlelink_description = $request->littlelink_description;
$role = $request->role;
$customBackground = $request->file('background');
+ $theme = $request->theme;
if ($request->password == '') {
- User::where('id', $id)->update(['name' => $name, 'email' => $email, 'littlelink_name' => $littlelink_name, 'littlelink_description' => $littlelink_description, 'role' => $role]);
+ User::where('id', $id)->update(['name' => $name, 'email' => $email, 'littlelink_name' => $littlelink_name, 'littlelink_description' => $littlelink_description, 'role' => $role, 'theme' => $theme]);
} else {
- User::where('id', $id)->update(['name' => $name, 'email' => $email, 'password' => $password, 'littlelink_name' => $littlelink_name, 'littlelink_description' => $littlelink_description, 'role' => $role]);
+ User::where('id', $id)->update(['name' => $name, 'email' => $email, 'password' => $password, 'littlelink_name' => $littlelink_name, 'littlelink_description' => $littlelink_description, 'role' => $role, 'theme' => $theme]);
}
if (!empty($profilePhoto)) {
$profilePhoto->move(base_path('assets/img'), $id . '_' . time() . ".png");
diff --git a/resources/views/panel/edit-user.blade.php b/resources/views/panel/edit-user.blade.php
index 884f451..c49e42e 100755
--- a/resources/views/panel/edit-user.blade.php
+++ b/resources/views/panel/edit-user.blade.php
@@ -62,11 +62,47 @@
@if($_SERVER['QUERY_STRING'] === 'deleteB' and File::exists(base_path('assets/img/background-img/'.findBackground($user->id))))@php File::delete(base_path('assets/img/background-img/'.findBackground($user->id))); header("Location: ".url()->current()); die(); @endphp @endif
-
-
+
+
+