- Migration: handling_status, handled_at, handled_by ke violations - Migration: tabel violation_handlings, handling_participants - Model: ViolationHandling, HandlingParticipant + relasi - Routes: storeHandling, resolveHandling, destroyHandling, calendar data - ViolationController: CRUD penanganan + filter status handling - DashboardController: data handling stats + calendar endpoint - Dashboard view: kalender pelanggaran interaktif (Alpine.js) - Violations index: filter status penanganan + kolom status - Violations show: stat card penanganan + timeline + modal tambah - Menambahkan handling_status filter di index
125 lines
7.4 KiB
PHP
125 lines
7.4 KiB
PHP
@extends('layouts.app')
|
|
|
|
@section('title', 'Pengaturan Akun')
|
|
|
|
@section('content')
|
|
<div>
|
|
<div class="mb-6">
|
|
<nav class="flex items-center space-x-2 text-sm text-gray-400 mb-2">
|
|
<span class="text-gray-700 font-medium">Pengaturan Akun</span>
|
|
</nav>
|
|
<h1 class="text-2xl font-bold text-gray-900 tracking-tight">Pengaturan Akun</h1>
|
|
<p class="text-sm text-gray-500 mt-1">Ubah nama pengguna dan kata sandi</p>
|
|
</div>
|
|
|
|
<div class="grid grid-cols-1 lg:grid-cols-3 gap-6">
|
|
{{-- Profile Info Sidebar --}}
|
|
<div class="lg:col-span-1">
|
|
<div class="bg-white rounded-2xl shadow-sm border border-gray-200 p-6 text-center">
|
|
<div class="w-20 h-20 rounded-2xl bg-gradient-to-br from-blue-500 to-sky-400 flex items-center justify-center text-white text-3xl font-bold shadow-sm mx-auto mb-4">
|
|
{{ strtoupper(substr($user->name, 0, 1)) }}
|
|
</div>
|
|
<h2 class="text-lg font-semibold text-gray-900">{{ $user->name }}</h2>
|
|
<p class="text-sm text-gray-400 capitalize">{{ $user->role }}</p>
|
|
<div class="mt-4 pt-4 border-t border-gray-100">
|
|
<div class="text-left space-y-3">
|
|
<div>
|
|
<p class="text-[10px] font-semibold text-gray-400 uppercase tracking-widest">Username</p>
|
|
<p class="text-sm font-medium text-gray-900 mt-0.5">{{ $user->username }}</p>
|
|
</div>
|
|
<div>
|
|
<p class="text-[10px] font-semibold text-gray-400 uppercase tracking-widest">Email</p>
|
|
<p class="text-sm text-gray-700 mt-0.5">{{ $user->email ?? '—' }}</p>
|
|
</div>
|
|
<div>
|
|
<p class="text-[10px] font-semibold text-gray-400 uppercase tracking-widest">Bergabung</p>
|
|
<p class="text-sm text-gray-700 mt-0.5">{{ $user->created_at->format('d M Y') }}</p>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
{{-- Form --}}
|
|
<div class="lg:col-span-2">
|
|
<form method="POST" action="{{ route('profile.update') }}" class="bg-white rounded-2xl shadow-sm border border-gray-200">
|
|
@csrf
|
|
|
|
{{-- Ubah Profil --}}
|
|
<div class="px-6 py-4 border-b border-gray-100">
|
|
<div class="flex items-center gap-2.5">
|
|
<div class="w-8 h-8 rounded-lg bg-blue-50 flex items-center justify-center">
|
|
<i class="fa-solid fa-user"></i>
|
|
</div>
|
|
<h3 class="text-base font-semibold text-gray-900">Informasi Profil</h3>
|
|
</div>
|
|
</div>
|
|
<div class="p-6 space-y-4">
|
|
<div>
|
|
<label class="block text-sm font-medium text-gray-700 mb-1.5">Nama Lengkap</label>
|
|
<input type="text" name="name" value="{{ old('name', $user->name) }}" required
|
|
class="w-full px-4 py-2.5 border border-gray-300 rounded-xl text-sm focus:outline-none focus:ring-2 focus:ring-blue-500/20 focus:border-blue-500 transition">
|
|
@error('name') <p class="text-xs text-red-500 mt-1">{{ $message }}</p> @enderror
|
|
</div>
|
|
<div>
|
|
<label class="block text-sm font-medium text-gray-700 mb-1.5">Username</label>
|
|
<input type="text" name="username" value="{{ old('username', $user->username) }}" required
|
|
class="w-full px-4 py-2.5 border border-gray-300 rounded-xl text-sm focus:outline-none focus:ring-2 focus:ring-blue-500/20 focus:border-blue-500 transition">
|
|
@error('username') <p class="text-xs text-red-500 mt-1">{{ $message }}</p> @enderror
|
|
</div>
|
|
<div>
|
|
<label class="block text-sm font-medium text-gray-700 mb-1.5">Email</label>
|
|
<input type="email" name="email" value="{{ old('email', $user->email) }}"
|
|
class="w-full px-4 py-2.5 border border-gray-300 rounded-xl text-sm focus:outline-none focus:ring-2 focus:ring-blue-500/20 focus:border-blue-500 transition">
|
|
@error('email') <p class="text-xs text-red-500 mt-1">{{ $message }}</p> @enderror
|
|
</div>
|
|
</div>
|
|
|
|
{{-- Ubah Password --}}
|
|
<div class="px-6 py-4 border-t border-gray-100 border-b border-gray-100">
|
|
<div class="flex items-center gap-2.5">
|
|
<div class="w-8 h-8 rounded-lg bg-blue-50 flex items-center justify-center">
|
|
<i class="fa-solid fa-lock"></i>
|
|
</div>
|
|
<div>
|
|
<h3 class="text-base font-semibold text-gray-900">Ganti Kata Sandi</h3>
|
|
<p class="text-xs text-gray-400">Kosongkan jika tidak ingin mengubah</p>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<div class="p-6 space-y-4">
|
|
<div>
|
|
<label class="block text-sm font-medium text-gray-700 mb-1.5">Kata Sandi Saat Ini</label>
|
|
<input type="password" name="current_password"
|
|
class="w-full px-4 py-2.5 border border-gray-300 rounded-xl text-sm focus:outline-none focus:ring-2 focus:ring-blue-500/20 focus:border-blue-500 transition">
|
|
@error('current_password') <p class="text-xs text-red-500 mt-1">{{ $message }}</p> @enderror
|
|
</div>
|
|
<div class="grid grid-cols-1 sm:grid-cols-2 gap-4">
|
|
<div>
|
|
<label class="block text-sm font-medium text-gray-700 mb-1.5">Kata Sandi Baru</label>
|
|
<input type="password" name="password"
|
|
class="w-full px-4 py-2.5 border border-gray-300 rounded-xl text-sm focus:outline-none focus:ring-2 focus:ring-blue-500/20 focus:border-blue-500 transition">
|
|
@error('password') <p class="text-xs text-red-500 mt-1">{{ $message }}</p> @enderror
|
|
</div>
|
|
<div>
|
|
<label class="block text-sm font-medium text-gray-700 mb-1.5">Konfirmasi Kata Sandi</label>
|
|
<input type="password" name="password_confirmation"
|
|
class="w-full px-4 py-2.5 border border-gray-300 rounded-xl text-sm focus:outline-none focus:ring-2 focus:ring-blue-500/20 focus:border-blue-500 transition">
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
{{-- Submit --}}
|
|
<div class="px-6 py-4 border-t border-gray-100 bg-gray-50/50 rounded-b-2xl flex items-center justify-end">
|
|
<button type="submit"
|
|
class="px-6 py-2.5 text-sm font-medium text-white bg-blue-600 rounded-xl hover:bg-blue-700 transition shadow-sm flex items-center gap-2">
|
|
<i class="fa-solid fa-check"></i>
|
|
Simpan Perubahan
|
|
</button>
|
|
</div>
|
|
</form>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
@endsection
|