refactor: profile views and adjust sidebar with logo
This commit is contained in:
parent
172ac9e3b7
commit
78ba8a0772
|
|
@ -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
|
||||
{
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -0,0 +1,5 @@
|
|||
<svg width="621" height="534" viewBox="0 0 621 534" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<path d="M83.3452 135.773C84.9945 135.934 86.7545 136.111 88.6163 136.307C101.882 137.71 120.258 140.035 140.682 143.715C182.126 151.184 229.744 163.863 260.92 184.324C268.096 189.033 277.103 195.927 284.543 201.848C288.213 204.768 291.41 207.378 293.688 209.257C294.825 210.195 295.73 210.95 296.347 211.465C296.655 211.723 296.892 211.921 297.048 212.053C297.127 212.118 297.185 212.167 297.223 212.199C297.242 212.215 297.255 212.226 297.264 212.234L297.273 212.241L306.654 220.164L316.273 212.534L316.274 212.533C316.276 212.532 316.28 212.529 316.284 212.526C316.294 212.518 316.309 212.506 316.33 212.489C316.372 212.456 316.437 212.405 316.524 212.336C316.697 212.199 316.959 211.993 317.299 211.726C317.981 211.191 318.981 210.409 320.237 209.437C322.75 207.49 326.278 204.786 330.324 201.764C338.519 195.642 348.462 188.502 356.376 183.645C387.873 164.31 434.969 151.843 475.62 144.262C495.677 140.522 513.673 138.057 526.649 136.528C528.253 136.339 529.779 136.165 531.223 136.004L531.222 374.631C529.176 374.616 526.959 374.61 524.586 374.624C510.859 374.705 491.833 375.374 470.627 377.736C428.932 382.381 375.914 393.851 339.235 422.801C328.618 431.181 317.428 443.469 309.27 453.073C308.645 453.808 308.036 454.533 307.44 455.244C307.064 454.757 306.684 454.263 306.297 453.764C298.887 444.23 288.756 432.007 279.163 423.407C245.403 393.141 190.851 381.739 147.867 377.28C125.852 374.996 105.817 374.443 91.2955 374.457C88.4254 374.46 85.7661 374.486 83.3447 374.524L83.3452 135.773Z" stroke="#435EBE" stroke-width="30"/>
|
||||
<path d="M307.203 64.55C311.666 64.55 317.586 67.7484 322.947 76.9934C328.159 85.9823 331.703 99.0617 331.703 114.05C331.703 129.038 328.159 142.118 322.947 151.107C317.586 160.352 311.666 163.55 307.203 163.55C302.739 163.55 296.819 160.352 291.458 151.107C286.246 142.118 282.703 129.038 282.703 114.05C282.703 99.0617 286.246 85.9823 291.458 76.9934C296.819 67.7484 302.739 64.55 307.203 64.55Z" stroke="#435EBE" stroke-width="20"/>
|
||||
<path d="M291.703 276.55C291.703 284.834 298.418 291.55 306.703 291.55C314.987 291.55 321.703 284.834 321.703 276.55H306.703H291.703ZM306.703 216.55H291.703V276.55H306.703H321.703V216.55H306.703Z" fill="#435EBE"/>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 2.2 KiB |
File diff suppressed because one or more lines are too long
|
After Width: | Height: | Size: 16 KiB |
|
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1,3 +1,4 @@
|
|||
@section('page-title', 'Katalog')
|
||||
<x-app-layout>
|
||||
<!-- Header Halaman -->
|
||||
<div class="d-flex justify-content-between flex-wrap flex-md-nowrap align-items-center pb-2 mb-3 border-bottom">
|
||||
|
|
|
|||
|
|
@ -10,17 +10,14 @@
|
|||
|
||||
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap-icons@1.11.3/font/bootstrap-icons.min.css">
|
||||
@vite(['resources/scss/app.scss', 'resources/js/app.js'])
|
||||
<!-- Flatpickr CSS & JS -->
|
||||
|
||||
<!-- Flatpickr CSS & JS untuk calendar picker -->
|
||||
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/flatpickr/dist/flatpickr.min.css">
|
||||
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/flatpickr/dist/themes/material_blue.css">
|
||||
<script src="https://cdn.jsdelivr.net/npm/flatpickr"></script>
|
||||
<script src="https://npmcdn.com/flatpickr/dist/l10n/id.js"></script>
|
||||
|
||||
<style>
|
||||
body {
|
||||
background-color: #f3f3f3;
|
||||
}
|
||||
|
||||
.sidebar {
|
||||
width: 250px;
|
||||
position: fixed;
|
||||
|
|
|
|||
|
|
@ -15,7 +15,7 @@
|
|||
<i class="bi bi-person-circle me-1"></i> {{ Auth::user()->name }}
|
||||
</a>
|
||||
<ul class="dropdown-menu dropdown-menu-end" aria-labelledby="userDropdown">
|
||||
<li><a class="dropdown-item" href="{{ route('profile.edit') }}">{{ __('Profile') }}</a></li>
|
||||
<li><a class="dropdown-item" href="{{ route('profile.index') }}">{{ __('Profile') }}</a></li>
|
||||
<li>
|
||||
<form method="POST" action="{{ route('logout') }}">
|
||||
@csrf
|
||||
|
|
|
|||
|
|
@ -1,7 +1,15 @@
|
|||
<aside id="sidebar" class="sidebar bg-white shadow-sm">
|
||||
<div class="sidebar-header d-flex justify-content-between align-items-center px-3 py-3 border-bottom">
|
||||
<h5 class="text-primary fw-bold mb-0 ms-3 sidebar-title">Perpus</h5>
|
||||
<!-- Tombol close ini hanya untuk mobile -->
|
||||
<div class="sidebar-header d-flex justify-content-between align-items-center px-3 py-3 py-md-2 border-bottom">
|
||||
<a href="{{ route('dashboard') }}" class="d-flex align-items-center text-decoration-none" style="gap: 0.75rem;">
|
||||
<img src="{{ asset('images/logo/icon.svg') }}" alt="Ikon Perpus" style="height: 32px;" class="mt-md-2">
|
||||
|
||||
<div class="d-flex align-items-center mt-md-2" style="gap: 0.75rem;">
|
||||
<div class="vr bg-primary sidebar-title" style="width: 2px;"></div>
|
||||
<img src="{{ asset('images/logo/name.svg') }}" alt="Perpus" style="height: 32px;" class="sidebar-title">
|
||||
</div>
|
||||
</a>
|
||||
|
||||
{{-- Tombol close mobile --}}
|
||||
<button type="button" class="btn-close d-lg-none" id="closeSidebarMobile"></button>
|
||||
</div>
|
||||
|
||||
|
|
|
|||
|
|
@ -1,3 +1,4 @@
|
|||
@section('page-title', 'Form Peminjaman Buku')
|
||||
<x-app-layout>
|
||||
<div class="d-flex align-items-center mb-4">
|
||||
<a href="{{ route('peminjaman.ringkasan', $buku['id']) }}" class="btn btn-outline-secondary me-3">
|
||||
|
|
|
|||
|
|
@ -1,3 +1,4 @@
|
|||
@section('page-title', 'Peminjaman Buku')
|
||||
<x-app-layout>
|
||||
<div class="d-flex justify-content-between flex-wrap flex-md-nowrap align-items-center pb-2 mb-3 border-bottom">
|
||||
<h1 class="h2">Daftar Buku Peminjaman Offline</h1>
|
||||
|
|
|
|||
|
|
@ -1,3 +1,4 @@
|
|||
@section('page-title', 'Ringkasan Buku')
|
||||
<x-app-layout>
|
||||
<div class="d-flex flex-column" style="min-height: calc(100vh - 110px);">
|
||||
|
||||
|
|
|
|||
|
|
@ -1,29 +1,32 @@
|
|||
@section('page-title', 'Profile')
|
||||
<x-app-layout>
|
||||
<x-slot name="header">
|
||||
<h2 class="font-semibold text-xl text-gray-800 leading-tight">
|
||||
{{ __('Profile') }}
|
||||
</h2>
|
||||
</x-slot>
|
||||
<div class="d-flex align-items-center mb-4">
|
||||
<a href="{{ route('profile.index') }}" class="btn btn-outline-secondary me-3">
|
||||
<i class="bi bi-arrow-left"></i>
|
||||
</a>
|
||||
<h1 class="h2 mb-0">Edit Profil</h1>
|
||||
</div>
|
||||
|
||||
<div class="py-12">
|
||||
<div class="max-w-7xl mx-auto sm:px-6 lg:px-8 space-y-6">
|
||||
<div class="p-4 sm:p-8 bg-white shadow sm:rounded-lg">
|
||||
<div class="max-w-xl">
|
||||
<div class="row justify-content-center">
|
||||
<div class="col-lg-8">
|
||||
<div class="card border-0 shadow-sm mb-4">
|
||||
<div class="card-body p-4">
|
||||
@include('profile.partials.update-profile-information-form')
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="p-4 sm:p-8 bg-white shadow sm:rounded-lg">
|
||||
<div class="max-w-xl">
|
||||
<div id="security" class="card border-0 shadow-sm mb-4">
|
||||
<div class="card-body p-4">
|
||||
@include('profile.partials.update-password-form')
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="p-4 sm:p-8 bg-white shadow sm:rounded-lg">
|
||||
<div class="max-w-xl">
|
||||
<div class="card border-danger shadow-sm">
|
||||
<div class="card-body p-4">
|
||||
@include('profile.partials.delete-user-form')
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</x-app-layout>
|
||||
|
||||
</x-app-layout>
|
||||
|
|
@ -0,0 +1,140 @@
|
|||
@section('page-title', 'Profile')
|
||||
<x-app-layout>
|
||||
<div class="d-flex justify-content-between align-items-center mb-4">
|
||||
<h1 class="h2 mb-0">Profil Saya</h1>
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
{{-- Section Left --}}
|
||||
<div class="col-lg-8">
|
||||
<div class="card border-0 mb-4">
|
||||
<div class="card-body p-4">
|
||||
{{-- Section Header Profil --}}
|
||||
<div class="d-flex align-items-center">
|
||||
<img src="https://ui-avatars.com/api/?name={{ urlencode($user->name) }}&background=435ebe&color=fff&size=80&rounded=true"
|
||||
alt="Foto Profil" class="rounded-circle flex-shrink-0">
|
||||
<div class="ms-4">
|
||||
<h4 class="fw-bold mb-1">{{ $user->name }}</h4>
|
||||
<span class="badge rounded-pill bg-primary-soft">{{ $user->role }}</span>
|
||||
</div>
|
||||
<a href="{{ route('profile.edit') }}" class="btn btn-outline-primary rounded-pill ms-auto">
|
||||
<i class="bi bi-pencil-square me-2"></i>Edit Profil
|
||||
</a>
|
||||
</div>
|
||||
|
||||
<hr class="my-4">
|
||||
|
||||
{{-- Informasi Personal --}}
|
||||
<h5 class="fw-bold mb-3">Informasi Personal</h5>
|
||||
<div class="row g-4">
|
||||
<div class="col-md-6 d-flex">
|
||||
<i class="bi bi-person-badge text-primary fs-4 me-3"></i>
|
||||
<div>
|
||||
<small class="text-muted">NISN</small>
|
||||
<p class="fw-semibold mb-0">{{ $user->nisn }}</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-6 d-flex">
|
||||
<i class="bi bi-envelope text-primary fs-4 me-3"></i>
|
||||
<div>
|
||||
<small class="text-muted">Email</small>
|
||||
<p class="fw-semibold mb-0">{{ $user->email }}</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-6 d-flex">
|
||||
<i class="bi bi-telephone text-primary fs-4 me-3"></i>
|
||||
<div>
|
||||
<small class="text-muted">Nomor HP</small>
|
||||
<p class="fw-semibold mb-0">{{ $user->nomor_hp }}</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-6 d-flex">
|
||||
<i class="bi bi-building text-primary fs-4 me-3"></i>
|
||||
<div>
|
||||
<small class="text-muted">Kelas</small>
|
||||
<p class="fw-semibold mb-0">{{ $user->kelas }} / {{ $user->golongan }}</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{{-- Statistic Card --}}
|
||||
<div class="card border-0">
|
||||
<div class="card-body p-4">
|
||||
<div class="section-header mb-3">
|
||||
<h5 class="mb-0">Statistik Saya</h5>
|
||||
</div>
|
||||
<div class="d-flex justify-content-around text-center">
|
||||
@foreach ($statistik as $stat)
|
||||
<div class="flex-fill">
|
||||
<i class="bi {{ $stat['icon'] }} fs-4 text-{{ $stat['color'] }}"></i>
|
||||
<h5 class="fw-bolder mb-0 mt-2">{{ $stat['value'] }}</h5>
|
||||
<small class="text-muted">{{ $stat['label'] }}</small>
|
||||
</div>
|
||||
@endforeach
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{{-- Right Section --}}
|
||||
<div class="col-lg-4">
|
||||
{{-- Card Buku yang Dipinjam --}}
|
||||
<div class="card border-0 mb-4">
|
||||
<div class="card-body p-4">
|
||||
<div class="section-header">
|
||||
<h5 class="mb-0">Buku yang Dipinjam</h5>
|
||||
</div>
|
||||
<ul class="list-group list-group-flush mt-3">
|
||||
@forelse ($bukuOffline as $buku)
|
||||
<li class="list-group-item px-0">
|
||||
<h6 class="fw-semibold mb-1">{{ $buku['judul'] }}</h6>
|
||||
<small class="text-muted">{{ $buku['penulis'] }}</small>
|
||||
<span class="badge bg-danger-light text-danger float-end">Sisa
|
||||
{{ $buku['sisa_hari'] }} hari</span>
|
||||
</li>
|
||||
@empty
|
||||
<li class="list-group-item px-0 text-center text-muted small py-3">Tidak ada buku yang
|
||||
sedang dipinjam.</li>
|
||||
@endforelse
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{{-- Card Riwayat Online --}}
|
||||
<div class="card border-0 mb-4">
|
||||
<div class="card-body p-4">
|
||||
<div class="section-header">
|
||||
<h5 class="mb-0">Riwayat Baca Online</h5>
|
||||
</div>
|
||||
<ul class="list-group list-group-flush mt-3">
|
||||
@forelse ($bukuOnline as $buku)
|
||||
<li class="list-group-item px-0">
|
||||
<h6 class="fw-semibold mb-1">{{ $buku['judul'] }}</h6>
|
||||
<small class="text-muted">{{ $buku['penulis'] }}</small>
|
||||
<span class="badge bg-primary-light text-primary float-end">Progress
|
||||
{{ $buku['progress'] }}%</span>
|
||||
</li>
|
||||
@empty
|
||||
<li class="list-group-item px-0 text-center text-muted small py-3">Tidak ada riwayat buku
|
||||
yang dibaca.</li>
|
||||
@endforelse
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{{-- Card Keamanan Akun --}}
|
||||
<div class="card border-0">
|
||||
<div class="card-body p-4">
|
||||
<div class="section-header mb-3">
|
||||
<h5 class="mb-0">Keamanan Akun</h5>
|
||||
</div>
|
||||
<p class="small text-muted">Ubah password Anda secara berkala untuk menjaga keamanan akun.</p>
|
||||
<a href="{{ route('profile.edit') }}#security" class="btn btn-outline-secondary rounded-pill">Ubah
|
||||
Password</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</x-app-layout>
|
||||
|
|
@ -1,55 +1,68 @@
|
|||
<section class="space-y-6">
|
||||
<section>
|
||||
<header>
|
||||
<h2 class="text-lg font-medium text-gray-900">
|
||||
<h2 class="h5 fw-bold text-danger">
|
||||
{{ __('Delete Account') }}
|
||||
</h2>
|
||||
|
||||
<p class="mt-1 text-sm text-gray-600">
|
||||
<p class="mt-1 text-muted small">
|
||||
{{ __('Once your account is deleted, all of its resources and data will be permanently deleted. Before deleting your account, please download any data or information that you wish to retain.') }}
|
||||
</p>
|
||||
</header>
|
||||
|
||||
<x-danger-button
|
||||
x-data=""
|
||||
x-on:click.prevent="$dispatch('open-modal', 'confirm-user-deletion')"
|
||||
>{{ __('Delete Account') }}</x-danger-button>
|
||||
{{-- Tombol Pemicu Modal --}}
|
||||
<button type="button" class="btn btn-danger mt-3" data-bs-toggle="modal" data-bs-target="#confirmUserDeletionModal">
|
||||
{{ __('Delete Account') }}
|
||||
</button>
|
||||
|
||||
<x-modal name="confirm-user-deletion" :show="$errors->userDeletion->isNotEmpty()" focusable>
|
||||
<form method="post" action="{{ route('profile.destroy') }}" class="p-6">
|
||||
@csrf
|
||||
@method('delete')
|
||||
{{-- Modal Konfirmasi --}}
|
||||
<div class="modal fade" id="confirmUserDeletionModal" tabindex="-1" aria-labelledby="confirmUserDeletionModalLabel"
|
||||
aria-hidden="true">
|
||||
<div class="modal-dialog">
|
||||
<div class="modal-content">
|
||||
<form method="post" action="{{ route('profile.destroy') }}" class="p-3">
|
||||
@csrf
|
||||
@method('delete')
|
||||
|
||||
<h2 class="text-lg font-medium text-gray-900">
|
||||
{{ __('Are you sure you want to delete your account?') }}
|
||||
</h2>
|
||||
<div class="modal-header border-0">
|
||||
<h5 class="modal-title fw-bold" id="confirmUserDeletionModalLabel">
|
||||
{{ __('Are you sure you want to delete your account?') }}
|
||||
</h5>
|
||||
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
|
||||
</div>
|
||||
|
||||
<p class="mt-1 text-sm text-gray-600">
|
||||
{{ __('Once your account is deleted, all of its resources and data will be permanently deleted. Please enter your password to confirm you would like to permanently delete your account.') }}
|
||||
</p>
|
||||
<div class="modal-body">
|
||||
<p class="small text-muted">
|
||||
{{ __('Once your account is deleted, all of its resources and data will be permanently deleted. Please enter your password to confirm you would like to permanently delete your account.') }}
|
||||
</p>
|
||||
|
||||
<div class="mt-6">
|
||||
<x-input-label for="password" value="{{ __('Password') }}" class="sr-only" />
|
||||
<div class="mt-3">
|
||||
<label for="password_delete" class="form-label visually-hidden">{{ __('Password') }}</label>
|
||||
<input id="password_delete" name="password" type="password"
|
||||
class="form-control @error('password', 'userDeletion') is-invalid @enderror"
|
||||
placeholder="{{ __('Password') }}">
|
||||
@error('password', 'userDeletion')
|
||||
<div class="invalid-feedback">{{ $message }}</div>
|
||||
@enderror
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<x-text-input
|
||||
id="password"
|
||||
name="password"
|
||||
type="password"
|
||||
class="mt-1 block w-3/4"
|
||||
placeholder="{{ __('Password') }}"
|
||||
/>
|
||||
|
||||
<x-input-error :messages="$errors->userDeletion->get('password')" class="mt-2" />
|
||||
<div class="modal-footer border-0">
|
||||
<button type="button" class="btn btn-secondary"
|
||||
data-bs-dismiss="modal">{{ __('Cancel') }}</button>
|
||||
<button type="submit" class="btn btn-danger">{{ __('Delete Account') }}</button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
|
||||
<div class="mt-6 flex justify-end">
|
||||
<x-secondary-button x-on:click="$dispatch('close')">
|
||||
{{ __('Cancel') }}
|
||||
</x-secondary-button>
|
||||
|
||||
<x-danger-button class="ms-3">
|
||||
{{ __('Delete Account') }}
|
||||
</x-danger-button>
|
||||
</div>
|
||||
</form>
|
||||
</x-modal>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
{{-- Script untuk membuka modal jika ada error validasi --}}
|
||||
@if ($errors->userDeletion->isNotEmpty())
|
||||
<script>
|
||||
document.addEventListener('DOMContentLoaded', function() {
|
||||
var modal = new bootstrap.Modal(document.getElementById('confirmUserDeletionModal'));
|
||||
modal.show();
|
||||
});
|
||||
</script>
|
||||
@endif
|
||||
|
|
|
|||
|
|
@ -1,47 +1,56 @@
|
|||
<section>
|
||||
<header>
|
||||
<h2 class="text-lg font-medium text-gray-900">
|
||||
<h2 class="h5 fw-bold">
|
||||
{{ __('Update Password') }}
|
||||
</h2>
|
||||
|
||||
<p class="mt-1 text-sm text-gray-600">
|
||||
<p class="mt-1 text-muted small">
|
||||
{{ __('Ensure your account is using a long, random password to stay secure.') }}
|
||||
</p>
|
||||
</header>
|
||||
|
||||
<form method="post" action="{{ route('password.update') }}" class="mt-6 space-y-6">
|
||||
<form method="post" action="{{ route('password.update') }}" class="mt-4">
|
||||
@csrf
|
||||
@method('put')
|
||||
|
||||
<div>
|
||||
<x-input-label for="update_password_current_password" :value="__('Current Password')" />
|
||||
<x-text-input id="update_password_current_password" name="current_password" type="password" class="mt-1 block w-full" autocomplete="current-password" />
|
||||
<x-input-error :messages="$errors->updatePassword->get('current_password')" class="mt-2" />
|
||||
{{-- Current Password --}}
|
||||
<div class="mb-3">
|
||||
<label for="update_password_current_password" class="form-label">{{ __('Current Password') }}</label>
|
||||
<input id="update_password_current_password" name="current_password" type="password"
|
||||
class="form-control @error('current_password', 'updatePassword') is-invalid @enderror"
|
||||
autocomplete="current-password">
|
||||
@error('current_password', 'updatePassword')
|
||||
<div class="invalid-feedback">{{ $message }}</div>
|
||||
@enderror
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<x-input-label for="update_password_password" :value="__('New Password')" />
|
||||
<x-text-input id="update_password_password" name="password" type="password" class="mt-1 block w-full" autocomplete="new-password" />
|
||||
<x-input-error :messages="$errors->updatePassword->get('password')" class="mt-2" />
|
||||
{{-- New Password --}}
|
||||
<div class="mb-3">
|
||||
<label for="update_password_password" class="form-label">{{ __('New Password') }}</label>
|
||||
<input id="update_password_password" name="password" type="password"
|
||||
class="form-control @error('password', 'updatePassword') is-invalid @enderror"
|
||||
autocomplete="new-password">
|
||||
@error('password', 'updatePassword')
|
||||
<div class="invalid-feedback">{{ $message }}</div>
|
||||
@enderror
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<x-input-label for="update_password_password_confirmation" :value="__('Confirm Password')" />
|
||||
<x-text-input id="update_password_password_confirmation" name="password_confirmation" type="password" class="mt-1 block w-full" autocomplete="new-password" />
|
||||
<x-input-error :messages="$errors->updatePassword->get('password_confirmation')" class="mt-2" />
|
||||
{{-- Confirm Password --}}
|
||||
<div class="mb-3">
|
||||
<label for="update_password_password_confirmation" class="form-label">{{ __('Confirm Password') }}</label>
|
||||
<input id="update_password_password_confirmation" name="password_confirmation" type="password"
|
||||
class="form-control @error('password_confirmation', 'updatePassword') is-invalid @enderror"
|
||||
autocomplete="new-password">
|
||||
@error('password_confirmation', 'updatePassword')
|
||||
<div class="invalid-feedback">{{ $message }}</div>
|
||||
@enderror
|
||||
</div>
|
||||
|
||||
<div class="flex items-center gap-4">
|
||||
<x-primary-button>{{ __('Save') }}</x-primary-button>
|
||||
<div class="d-flex align-items-center gap-3">
|
||||
<button type="submit" class="btn btn-primary">{{ __('Save') }}</button>
|
||||
|
||||
@if (session('status') === 'password-updated')
|
||||
<p
|
||||
x-data="{ show: true }"
|
||||
x-show="show"
|
||||
x-transition
|
||||
x-init="setTimeout(() => show = false, 2000)"
|
||||
class="text-sm text-gray-600"
|
||||
>{{ __('Saved.') }}</p>
|
||||
<span class="text-success fw-bold">{{ __('Saved.') }}</span>
|
||||
@endif
|
||||
</div>
|
||||
</form>
|
||||
|
|
|
|||
|
|
@ -1,10 +1,10 @@
|
|||
<section>
|
||||
<header>
|
||||
<h2 class="text-lg font-medium text-gray-900">
|
||||
<h2 class="h5 fw-bold">
|
||||
{{ __('Profile Information') }}
|
||||
</h2>
|
||||
|
||||
<p class="mt-1 text-sm text-gray-600">
|
||||
<p class="mt-1 text-muted small">
|
||||
{{ __("Update your account's profile information and email address.") }}
|
||||
</p>
|
||||
</header>
|
||||
|
|
@ -13,33 +13,42 @@
|
|||
@csrf
|
||||
</form>
|
||||
|
||||
<form method="post" action="{{ route('profile.update') }}" class="mt-6 space-y-6">
|
||||
<form method="post" action="{{ route('profile.update') }}" class="mt-4">
|
||||
@csrf
|
||||
@method('patch')
|
||||
|
||||
<div>
|
||||
<x-input-label for="name" :value="__('Name')" />
|
||||
<x-text-input id="name" name="name" type="text" class="mt-1 block w-full" :value="old('name', $user->name)" required autofocus autocomplete="name" />
|
||||
<x-input-error class="mt-2" :messages="$errors->get('name')" />
|
||||
{{-- Name --}}
|
||||
<div class="mb-3">
|
||||
<label for="name" class="form-label">{{ __('Name') }}</label>
|
||||
<input id="name" name="name" type="text" class="form-control @error('name') is-invalid @enderror"
|
||||
value="{{ old('name', $user->name) }}" required autofocus autocomplete="name">
|
||||
@error('name')
|
||||
<div class="invalid-feedback">{{ $message }}</div>
|
||||
@enderror
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<x-input-label for="email" :value="__('Email')" />
|
||||
<x-text-input id="email" name="email" type="email" class="mt-1 block w-full" :value="old('email', $user->email)" required autocomplete="username" />
|
||||
<x-input-error class="mt-2" :messages="$errors->get('email')" />
|
||||
{{-- Email --}}
|
||||
<div class="mb-3">
|
||||
<label for="email" class="form-label">{{ __('Email') }}</label>
|
||||
<input id="email" name="email" type="email"
|
||||
class="form-control @error('email') is-invalid @enderror" value="{{ old('email', $user->email) }}"
|
||||
required autocomplete="username">
|
||||
@error('email')
|
||||
<div class="invalid-feedback">{{ $message }}</div>
|
||||
@enderror
|
||||
|
||||
@if ($user instanceof \Illuminate\Contracts\Auth\MustVerifyEmail && ! $user->hasVerifiedEmail())
|
||||
<div>
|
||||
<p class="text-sm mt-2 text-gray-800">
|
||||
@if ($user instanceof \Illuminate\Contracts\Auth\MustVerifyEmail && !$user->hasVerifiedEmail())
|
||||
<div class="mt-2">
|
||||
<p class="small text-muted">
|
||||
{{ __('Your email address is unverified.') }}
|
||||
|
||||
<button form="send-verification" class="underline text-sm text-gray-600 hover:text-gray-900 rounded-md focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-indigo-500">
|
||||
<button form="send-verification" class="btn btn-link text-decoration-underline p-0 small">
|
||||
{{ __('Click here to re-send the verification email.') }}
|
||||
</button>
|
||||
</p>
|
||||
|
||||
@if (session('status') === 'verification-link-sent')
|
||||
<p class="mt-2 font-medium text-sm text-green-600">
|
||||
<p class="mt-2 fw-medium small text-success">
|
||||
{{ __('A new verification link has been sent to your email address.') }}
|
||||
</p>
|
||||
@endif
|
||||
|
|
@ -47,17 +56,11 @@
|
|||
@endif
|
||||
</div>
|
||||
|
||||
<div class="flex items-center gap-4">
|
||||
<x-primary-button>{{ __('Save') }}</x-primary-button>
|
||||
<div class="d-flex align-items-center gap-3">
|
||||
<button type="submit" class="btn btn-primary">{{ __('Save') }}</button>
|
||||
|
||||
@if (session('status') === 'profile-updated')
|
||||
<p
|
||||
x-data="{ show: true }"
|
||||
x-show="show"
|
||||
x-transition
|
||||
x-init="setTimeout(() => show = false, 2000)"
|
||||
class="text-sm text-gray-600"
|
||||
>{{ __('Saved.') }}</p>
|
||||
<span class="text-success fw-bold">{{ __('Saved.') }}</span>
|
||||
@endif
|
||||
</div>
|
||||
</form>
|
||||
|
|
|
|||
|
|
@ -22,9 +22,9 @@
|
|||
Route::get('/peminjaman-offline/{id}/form', [PeminjamanController::class, 'form'])->name('peminjaman.form');
|
||||
Route::post('/peminjaman/store', [PeminjamanController::class, 'store'])->name('peminjaman.store');
|
||||
|
||||
// Route untuk user profile dari laravel breeze
|
||||
Route::middleware('auth')->group(function () {
|
||||
Route::get('/profile', [ProfileController::class, 'edit'])->name('profile.edit');
|
||||
Route::get('/profile', [ProfileController::class, 'index'])->name('profile.index');
|
||||
Route::get('/profile/edit', [ProfileController::class, 'edit'])->name('profile.edit');
|
||||
Route::patch('/profile', [ProfileController::class, 'update'])->name('profile.update');
|
||||
Route::delete('/profile', [ProfileController::class, 'destroy'])->name('profile.destroy');
|
||||
});
|
||||
|
|
|
|||
Loading…
Reference in New Issue