From 78ba8a077242a09d01c4dbd7ab960b6c990c045b Mon Sep 17 00:00:00 2001 From: zhadaarsita Date: Wed, 24 Sep 2025 23:48:39 +0700 Subject: [PATCH] refactor: profile views and adjust sidebar with logo --- app/Http/Controllers/ProfileController.php | 30 +++- app/Http/Requests/Auth/LoginRequest.php | 2 - public/images/logo/icon.svg | 5 + public/images/logo/name.svg | 4 + resources/scss/_variables.scss | 22 +-- resources/views/katalog.blade.php | 1 + resources/views/layouts/app.blade.php | 7 +- resources/views/layouts/navigation.blade.php | 2 +- resources/views/layouts/sidebar.blade.php | 14 +- resources/views/peminjaman/form.blade.php | 1 + resources/views/peminjaman/index.blade.php | 1 + .../views/peminjaman/ringkasan.blade.php | 1 + resources/views/profile/edit.blade.php | 31 ++-- resources/views/profile/index.blade.php | 140 ++++++++++++++++++ .../partials/delete-user-form.blade.php | 93 +++++++----- .../partials/update-password-form.blade.php | 57 ++++--- .../update-profile-information-form.blade.php | 53 +++---- routes/web.php | 4 +- 18 files changed, 338 insertions(+), 130 deletions(-) create mode 100644 public/images/logo/icon.svg create mode 100644 public/images/logo/name.svg create mode 100644 resources/views/profile/index.blade.php diff --git a/app/Http/Controllers/ProfileController.php b/app/Http/Controllers/ProfileController.php index a48eb8d..1b0c8ed 100644 --- a/app/Http/Controllers/ProfileController.php +++ b/app/Http/Controllers/ProfileController.php @@ -8,11 +8,35 @@ use Illuminate\Support\Facades\Auth; use Illuminate\Support\Facades\Redirect; use Illuminate\View\View; +use App\Services\DummyDataService; class ProfileController extends Controller { /** - * Display the user's profile form. + * Menampilkan halaman utama profil pengguna. + */ + public function index() + { + $user = Auth::user(); + + if (!$user) { + return redirect()->route('login'); + } + + $bukuOffline = DummyDataService::getBukuPinjamOffline($user); + $bukuOnline = DummyDataService::getBacaBukuOnline($user); + $statistik = DummyDataService::getDashboardStats(); + + return view('profile.index', [ + 'user' => $user, + 'bukuOffline' => $bukuOffline, + 'bukuOnline' => $bukuOnline, + 'statistik' => $statistik, + ]); + } + + /** + * Menampilkan form untuk mengedit profil. */ public function edit(Request $request): View { @@ -22,7 +46,7 @@ public function edit(Request $request): View } /** - * Update the user's profile information. + * Memperbarui informasi profil pengguna. */ public function update(ProfileUpdateRequest $request): RedirectResponse { @@ -38,7 +62,7 @@ public function update(ProfileUpdateRequest $request): RedirectResponse } /** - * Delete the user's account. + * Menghapus akun pengguna. */ public function destroy(Request $request): RedirectResponse { diff --git a/app/Http/Requests/Auth/LoginRequest.php b/app/Http/Requests/Auth/LoginRequest.php index ba0eb64..a3fa4ad 100644 --- a/app/Http/Requests/Auth/LoginRequest.php +++ b/app/Http/Requests/Auth/LoginRequest.php @@ -38,9 +38,7 @@ public function authenticate(): void $userArray = collect($allSiswa)->firstWhere('nisn', $inputNisn); - // Jika siswa ditemukan dan passwordnya sama if ($userArray && $userArray['password'] === $inputPassword) { - // Simpan data siswa ke session. session(['user_data' => $userArray]); RateLimiter::clear($this->throttleKey()); return; diff --git a/public/images/logo/icon.svg b/public/images/logo/icon.svg new file mode 100644 index 0000000..9da2a62 --- /dev/null +++ b/public/images/logo/icon.svg @@ -0,0 +1,5 @@ + + + + + diff --git a/public/images/logo/name.svg b/public/images/logo/name.svg new file mode 100644 index 0000000..a66afcc --- /dev/null +++ b/public/images/logo/name.svg @@ -0,0 +1,4 @@ + + + + diff --git a/resources/scss/_variables.scss b/resources/scss/_variables.scss index 5ab1dfe..d46ee7c 100644 --- a/resources/scss/_variables.scss +++ b/resources/scss/_variables.scss @@ -56,7 +56,7 @@ $transition: all 0.3s ease; box-shadow: $card-box-shadow; .card-header { background-color: #fff; - border-bottom: 1px solid rgba(map-get($grays, "dark"), 0.1); // DIPERBAIKI + border-bottom: 1px solid rgba(map-get($grays, "dark"), 0.1); } } @@ -82,7 +82,7 @@ $transition: all 0.3s ease; padding: 1.5rem; } .modal-title { - color: map-get($grays, "dark"); // DIPERBAIKI + color: map-get($grays, "dark"); font-weight: 700; } } @@ -146,8 +146,8 @@ $transition: all 0.3s ease; &-container { background: linear-gradient( 135deg, - rgba(map-get($grays, "light"), 0.5) 0%, // DIPERBAIKI - rgba(map-get($grays, "light"), 0.8) 100% // DIPERBAIKI + rgba(map-get($grays, "light"), 0.5) 0%, + rgba(map-get($grays, "light"), 0.8) 100% ); border-radius: $border-radius-sm 0 0 $border-radius-sm; } @@ -155,9 +155,9 @@ $transition: all 0.3s ease; .section-header { padding-bottom: 15px; - border-bottom: 2px solid map-get($grays, "light"); // DIPERBAIKI + border-bottom: 2px solid map-get($grays, "light"); h5 { - color: map-get($grays, "dark"); // DIPERBAIKI + color: map-get($grays, "dark"); font-weight: 700; } } @@ -167,12 +167,12 @@ $transition: all 0.3s ease; padding: 3rem 1rem; i { font-size: 4rem; - color: map-get($grays, "dark"); // DIPERBAIKI + color: map-get($grays, "dark"); margin-bottom: 1rem; opacity: 0.25; } p { - color: map-get($grays, "dark"); // DIPERBAIKI + color: map-get($grays, "dark"); opacity: 0.7; font-size: 1rem; margin: 0; @@ -207,14 +207,14 @@ $transition: all 0.3s ease; width: 6px; } ::-webkit-scrollbar-track { - background: map-get($grays, "light"); // DIPERBAIKI + background: map-get($grays, "light"); border-radius: 3px; } ::-webkit-scrollbar-thumb { - background: rgba(map-get($grays, "dark"), 0.25); // DIPERBAIKI + background: rgba(map-get($grays, "dark"), 0.25); border-radius: 3px; &:hover { - background: rgba(map-get($grays, "dark"), 0.4); // DIPERBAIKI + background: rgba(map-get($grays, "dark"), 0.4); } } diff --git a/resources/views/katalog.blade.php b/resources/views/katalog.blade.php index b46837a..0326c38 100644 --- a/resources/views/katalog.blade.php +++ b/resources/views/katalog.blade.php @@ -1,3 +1,4 @@ +@section('page-title', 'Katalog')
diff --git a/resources/views/layouts/app.blade.php b/resources/views/layouts/app.blade.php index bdd74aa..c04d08a 100644 --- a/resources/views/layouts/app.blade.php +++ b/resources/views/layouts/app.blade.php @@ -10,17 +10,14 @@ @vite(['resources/scss/app.scss', 'resources/js/app.js']) - + +