351 lines
26 KiB
PHP
351 lines
26 KiB
PHP
@php
|
|
$user = auth()->user();
|
|
$isAdmin = $user && method_exists($user, 'isAdmin') ? $user->isAdmin() : false;
|
|
try {
|
|
$branding = \App\Models\AppSetting::branding();
|
|
} catch (\Throwable $e) {
|
|
$branding = \App\Models\AppSetting::brandingDefaults();
|
|
}
|
|
|
|
$masterDataOpen = request()->routeIs('academic-years.*')
|
|
|| request()->routeIs('departments.*')
|
|
|| request()->routeIs('classes.*')
|
|
|| request()->routeIs('document-types.*');
|
|
|
|
$kesiswaanOpen = request()->routeIs('students.*')
|
|
|| request()->routeIs('student-exits.*')
|
|
|| request()->routeIs('student-transfers.*')
|
|
|| request()->routeIs('student-promotions.*')
|
|
|| request()->routeIs('student-achievements.*')
|
|
|| request()->routeIs('student-self-service.*');
|
|
|
|
$settingsOpen = request()->routeIs('settings.*');
|
|
@endphp
|
|
|
|
<div x-data="{ sidebarOpen: false, masterDataOpen: @js($masterDataOpen), kesiswaanOpen: @js($kesiswaanOpen), settingsOpen: @js($settingsOpen), profileMenuOpen: false }" class="min-h-screen bg-slate-50">
|
|
<div
|
|
x-show="sidebarOpen"
|
|
x-transition.opacity
|
|
class="fixed inset-0 z-40 bg-slate-900/50 lg:hidden"
|
|
@click="sidebarOpen = false"
|
|
></div>
|
|
|
|
<aside
|
|
:class="sidebarOpen ? 'translate-x-0' : '-translate-x-full'"
|
|
class="fixed left-0 top-0 z-50 flex h-screen w-72 flex-col border-r border-slate-200 bg-white transition-transform duration-300 lg:translate-x-0"
|
|
>
|
|
<div class="flex h-20 items-center justify-between border-b border-slate-200 px-6">
|
|
<a href="{{ route('dashboard') }}" class="flex items-center gap-3">
|
|
<div class="flex h-12 w-12 items-center justify-center overflow-hidden rounded-2xl bg-indigo-600 text-base font-bold text-white shadow-lg shadow-indigo-200">
|
|
@if (!empty($branding['app_logo']))
|
|
<img src="{{ asset('storage/' . $branding['app_logo']) }}" alt="{{ $branding['app_name'] }}" class="h-full w-full object-contain bg-white p-2">
|
|
@else
|
|
{{ $branding['app_short_name'] ?? 'DK' }}
|
|
@endif
|
|
</div>
|
|
<div>
|
|
<div class="text-sm font-semibold text-slate-900">{{ $branding['app_name'] ?? 'Database Kesiswaan' }}</div>
|
|
<div class="text-xs text-slate-500">Admin Dashboard</div>
|
|
</div>
|
|
</a>
|
|
|
|
<button @click="sidebarOpen = false" class="rounded-lg p-2 text-slate-500 hover:bg-slate-100 lg:hidden">
|
|
<svg class="h-5 w-5" viewBox="0 0 24 24" fill="none" stroke="currentColor">
|
|
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="1.8" d="M6 18L18 6M6 6l12 12" />
|
|
</svg>
|
|
</button>
|
|
</div>
|
|
|
|
<div class="flex-1 overflow-y-auto px-4 py-6">
|
|
<div class="mb-6 px-3">
|
|
<p class="text-[11px] font-semibold uppercase tracking-[0.2em] text-slate-400">Menu Utama</p>
|
|
</div>
|
|
|
|
<nav class="space-y-2">
|
|
<a href="{{ route('dashboard') }}"
|
|
class="flex items-center gap-3 rounded-xl px-4 py-3 text-sm font-medium transition {{ request()->routeIs('dashboard') ? 'bg-indigo-50 text-indigo-700' : 'text-slate-600 hover:bg-slate-100 hover:text-slate-900' }}">
|
|
<span class="inline-flex h-9 w-9 items-center justify-center rounded-lg {{ request()->routeIs('dashboard') ? 'bg-indigo-100 text-indigo-700' : 'bg-slate-100 text-slate-500' }}">
|
|
<svg class="h-5 w-5" viewBox="0 0 24 24" fill="none" stroke="currentColor">
|
|
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="1.8" d="M3 10.5L12 3l9 7.5V21a1 1 0 0 1-1 1h-5v-6H9v6H4a1 1 0 0 1-1-1v-10.5Z" />
|
|
</svg>
|
|
</span>
|
|
<span>Dashboard</span>
|
|
</a>
|
|
|
|
@if ($isAdmin)
|
|
<div class="space-y-2">
|
|
<button
|
|
type="button"
|
|
@click="masterDataOpen = !masterDataOpen"
|
|
class="flex w-full items-center justify-between rounded-xl px-4 py-3 text-sm font-medium transition {{ $masterDataOpen ? 'bg-indigo-50 text-indigo-700' : 'text-slate-600 hover:bg-slate-100 hover:text-slate-900' }}"
|
|
>
|
|
<div class="flex items-center gap-3">
|
|
<span class="inline-flex h-9 w-9 items-center justify-center rounded-lg {{ $masterDataOpen ? 'bg-indigo-100 text-indigo-700' : 'bg-slate-100 text-slate-500' }}">
|
|
<svg class="h-5 w-5" viewBox="0 0 24 24" fill="none" stroke="currentColor">
|
|
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="1.8" d="M4 7.5A1.5 1.5 0 0 1 5.5 6h13A1.5 1.5 0 0 1 20 7.5v9a1.5 1.5 0 0 1-1.5 1.5h-13A1.5 1.5 0 0 1 4 16.5v-9Z" />
|
|
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="1.8" d="M8 10h8M8 14h5" />
|
|
</svg>
|
|
</span>
|
|
<span>Master Data</span>
|
|
</div>
|
|
<svg class="h-4 w-4 transition-transform" :class="masterDataOpen ? 'rotate-180' : ''" viewBox="0 0 24 24" fill="none" stroke="currentColor">
|
|
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="1.8" d="m6 9 6 6 6-6" />
|
|
</svg>
|
|
</button>
|
|
|
|
<div x-show="masterDataOpen" x-collapse class="space-y-1 pl-4">
|
|
<a href="{{ route('academic-years.index') }}"
|
|
class="flex items-center gap-3 rounded-xl px-4 py-3 text-sm font-medium transition {{ request()->routeIs('academic-years.*') ? 'bg-indigo-50 text-indigo-700' : 'text-slate-500 hover:bg-slate-100 hover:text-slate-900' }}">
|
|
<svg class="h-4 w-4" viewBox="0 0 24 24" fill="none" stroke="currentColor">
|
|
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="1.8" d="M8 3v3M16 3v3M4 9h16M5.5 5.5h13A1.5 1.5 0 0 1 20 7v11.5A1.5 1.5 0 0 1 18.5 20h-13A1.5 1.5 0 0 1 4 18.5V7A1.5 1.5 0 0 1 5.5 5.5Z" />
|
|
</svg>
|
|
<span>Tahun Angkatan</span>
|
|
</a>
|
|
<a href="{{ route('departments.index') }}"
|
|
class="flex items-center gap-3 rounded-xl px-4 py-3 text-sm font-medium transition {{ request()->routeIs('departments.*') ? 'bg-indigo-50 text-indigo-700' : 'text-slate-500 hover:bg-slate-100 hover:text-slate-900' }}">
|
|
<svg class="h-4 w-4" viewBox="0 0 24 24" fill="none" stroke="currentColor">
|
|
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="1.8" d="M4 19h16M6 19V9l6-4 6 4v10M10 13h4M10 16h4" />
|
|
</svg>
|
|
<span>Program Keahlian</span>
|
|
</a>
|
|
<a href="{{ route('classes.index') }}"
|
|
class="flex items-center gap-3 rounded-xl px-4 py-3 text-sm font-medium transition {{ request()->routeIs('classes.*') ? 'bg-indigo-50 text-indigo-700' : 'text-slate-500 hover:bg-slate-100 hover:text-slate-900' }}">
|
|
<svg class="h-4 w-4" viewBox="0 0 24 24" fill="none" stroke="currentColor">
|
|
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="1.8" d="M3 7.5 12 3l9 4.5-9 4.5-9-4.5Zm3 4.5v4.5c0 .7 2.7 2.5 6 2.5s6-1.8 6-2.5V12" />
|
|
</svg>
|
|
<span>Kelas</span>
|
|
</a>
|
|
<a href="{{ route('document-types.index') }}"
|
|
class="flex items-center gap-3 rounded-xl px-4 py-3 text-sm font-medium transition {{ request()->routeIs('document-types.*') ? 'bg-indigo-50 text-indigo-700' : 'text-slate-500 hover:bg-slate-100 hover:text-slate-900' }}">
|
|
<svg class="h-4 w-4" viewBox="0 0 24 24" fill="none" stroke="currentColor">
|
|
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="1.8" d="M8 3.5h6l4 4V20a1 1 0 0 1-1 1H8a1 1 0 0 1-1-1V4.5a1 1 0 0 1 1-1Z" />
|
|
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="1.8" d="M14 3.5V8h4" />
|
|
</svg>
|
|
<span>Jenis Dokumen</span>
|
|
</a>
|
|
</div>
|
|
</div>
|
|
@endif
|
|
|
|
<div class="space-y-2">
|
|
<button
|
|
type="button"
|
|
@click="kesiswaanOpen = !kesiswaanOpen"
|
|
class="flex w-full items-center justify-between rounded-xl px-4 py-3 text-sm font-medium transition {{ $kesiswaanOpen ? 'bg-indigo-50 text-indigo-700' : 'text-slate-600 hover:bg-slate-100 hover:text-slate-900' }}"
|
|
>
|
|
<div class="flex items-center gap-3">
|
|
<span class="inline-flex h-9 w-9 items-center justify-center rounded-lg {{ $kesiswaanOpen ? 'bg-indigo-100 text-indigo-700' : 'bg-slate-100 text-slate-500' }}">
|
|
<svg class="h-5 w-5" viewBox="0 0 24 24" fill="none" stroke="currentColor">
|
|
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="1.8" d="M16 7a4 4 0 1 1-8 0 4 4 0 0 1 8 0ZM4 20a6 6 0 1 1 12 0" />
|
|
</svg>
|
|
</span>
|
|
<span>Kesiswaan</span>
|
|
</div>
|
|
<svg class="h-4 w-4 transition-transform" :class="kesiswaanOpen ? 'rotate-180' : ''" viewBox="0 0 24 24" fill="none" stroke="currentColor">
|
|
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="1.8" d="m6 9 6 6 6-6" />
|
|
</svg>
|
|
</button>
|
|
|
|
<div x-show="kesiswaanOpen" x-collapse class="space-y-1 pl-4">
|
|
<a href="{{ route('students.index') }}"
|
|
class="flex items-center gap-3 rounded-xl px-4 py-3 text-sm font-medium transition {{ request()->routeIs('students.index') || request()->routeIs('students.create') || request()->routeIs('students.edit') || request()->routeIs('students.show') || request()->routeIs('students.import.*') ? 'bg-indigo-50 text-indigo-700' : 'text-slate-500 hover:bg-slate-100 hover:text-slate-900' }}">
|
|
<svg class="h-4 w-4" viewBox="0 0 24 24" fill="none" stroke="currentColor">
|
|
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="1.8" d="M16 7a4 4 0 1 1-8 0 4 4 0 0 1 8 0ZM4 20a6 6 0 1 1 12 0" />
|
|
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="1.8" d="M18 9a3 3 0 0 1 0 6m-1 5a5 5 0 0 0-3-4.58" />
|
|
</svg>
|
|
<span>Data Siswa</span>
|
|
</a>
|
|
<a href="{{ route('student-exits.index') }}"
|
|
class="flex items-center gap-3 rounded-xl px-4 py-3 text-sm font-medium transition {{ request()->routeIs('student-exits.*') ? 'bg-indigo-50 text-indigo-700' : 'text-slate-500 hover:bg-slate-100 hover:text-slate-900' }}">
|
|
<svg class="h-4 w-4" viewBox="0 0 24 24" fill="none" stroke="currentColor">
|
|
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="1.8" d="M17 7 7 17" />
|
|
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="1.8" d="M7 7h10v10" />
|
|
</svg>
|
|
<span>Data Siswa Keluar</span>
|
|
</a>
|
|
<a href="{{ route('student-transfers.index') }}"
|
|
class="flex items-center gap-3 rounded-xl px-4 py-3 text-sm font-medium transition {{ request()->routeIs('student-transfers.*') ? 'bg-indigo-50 text-indigo-700' : 'text-slate-500 hover:bg-slate-100 hover:text-slate-900' }}">
|
|
<svg class="h-4 w-4" viewBox="0 0 24 24" fill="none" stroke="currentColor">
|
|
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="1.8" d="M4 12h11" />
|
|
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="1.8" d="m11 5 7 7-7 7" />
|
|
</svg>
|
|
<span>Data Siswa Mutasi</span>
|
|
</a>
|
|
<a href="{{ route('students.graduated') }}"
|
|
class="flex items-center gap-3 rounded-xl px-4 py-3 text-sm font-medium transition {{ request()->routeIs('students.graduated') ? 'bg-indigo-50 text-indigo-700' : 'text-slate-500 hover:bg-slate-100 hover:text-slate-900' }}">
|
|
<svg class="h-4 w-4" viewBox="0 0 24 24" fill="none" stroke="currentColor">
|
|
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="1.8" d="M3 9.5 12 5l9 4.5-9 4.5-9-4.5Z" />
|
|
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="1.8" d="M7 12.5v3.5c0 .8 2.2 2.5 5 2.5s5-1.7 5-2.5v-3.5" />
|
|
</svg>
|
|
<span>Data Siswa Lulus</span>
|
|
</a>
|
|
<a href="{{ route('student-achievements.index') }}"
|
|
class="flex items-center gap-3 rounded-xl px-4 py-3 text-sm font-medium transition {{ request()->routeIs('student-achievements.*') ? 'bg-indigo-50 text-indigo-700' : 'text-slate-500 hover:bg-slate-100 hover:text-slate-900' }}">
|
|
<svg class="h-4 w-4" viewBox="0 0 24 24" fill="none" stroke="currentColor">
|
|
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="1.8" d="M12 3 9.5 8H4l4.5 3.3L6.8 17 12 13.8 17.2 17l-1.7-5.7L20 8h-5.5L12 3Z" />
|
|
</svg>
|
|
<span>Data Siswa Berprestasi</span>
|
|
</a>
|
|
<a href="{{ route('student-promotions.index') }}"
|
|
class="flex items-center gap-3 rounded-xl px-4 py-3 text-sm font-medium transition {{ request()->routeIs('student-promotions.*') ? 'bg-indigo-50 text-indigo-700' : 'text-slate-500 hover:bg-slate-100 hover:text-slate-900' }}">
|
|
<svg class="h-4 w-4" viewBox="0 0 24 24" fill="none" stroke="currentColor">
|
|
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="1.8" d="M7 17 17 7M9 7h8v8" />
|
|
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="1.8" d="M5 12v7h7" />
|
|
</svg>
|
|
<span>Kenaikan Kelas</span>
|
|
</a>
|
|
<a href="{{ route('student-self-service.index') }}"
|
|
class="flex items-center gap-3 rounded-xl px-4 py-3 text-sm font-medium transition {{ request()->routeIs('student-self-service.*') ? 'bg-indigo-50 text-indigo-700' : 'text-slate-500 hover:bg-slate-100 hover:text-slate-900' }}">
|
|
<svg class="h-4 w-4" viewBox="0 0 24 24" fill="none" stroke="currentColor">
|
|
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="1.8" d="M12 4v16" />
|
|
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="1.8" d="M4 12h16" />
|
|
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="1.8" d="M7.5 7.5h9v9h-9z" />
|
|
</svg>
|
|
<span>Self Servis Siswa</span>
|
|
</a>
|
|
|
|
</div>
|
|
</div>
|
|
|
|
@if ($isAdmin)
|
|
<div class="space-y-2">
|
|
<button
|
|
type="button"
|
|
@click="settingsOpen = !settingsOpen"
|
|
class="flex w-full items-center justify-between rounded-xl px-4 py-3 text-sm font-medium transition {{ $settingsOpen ? 'bg-indigo-50 text-indigo-700' : 'text-slate-600 hover:bg-slate-100 hover:text-slate-900' }}"
|
|
>
|
|
<div class="flex items-center gap-3">
|
|
<span class="inline-flex h-9 w-9 items-center justify-center rounded-lg {{ $settingsOpen ? 'bg-indigo-100 text-indigo-700' : 'bg-slate-100 text-slate-500' }}">
|
|
<svg class="h-5 w-5" viewBox="0 0 24 24" fill="none" stroke="currentColor">
|
|
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="1.8" d="M11.25 3h1.5l.62 2.18a7.52 7.52 0 0 1 1.78.74l2.05-.98 1.06 1.06-.98 2.05c.29.56.54 1.16.74 1.78L21 11.25v1.5l-2.18.62a7.52 7.52 0 0 1-.74 1.78l.98 2.05-1.06 1.06-2.05-.98a7.52 7.52 0 0 1-1.78.74L12.75 21h-1.5l-.62-2.18a7.52 7.52 0 0 1-1.78-.74l-2.05.98-1.06-1.06.98-2.05a7.52 7.52 0 0 1-.74-1.78L3 12.75v-1.5l2.18-.62c.2-.62.45-1.22.74-1.78l-.98-2.05 1.06-1.06 2.05.98c.56-.29 1.16-.54 1.78-.74L11.25 3Z" />
|
|
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="1.8" d="M15 12a3 3 0 1 1-6 0 3 3 0 0 1 6 0Z" />
|
|
</svg>
|
|
</span>
|
|
<span>Pengaturan</span>
|
|
</div>
|
|
<svg class="h-4 w-4 transition-transform" :class="settingsOpen ? 'rotate-180' : ''" viewBox="0 0 24 24" fill="none" stroke="currentColor">
|
|
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="1.8" d="m6 9 6 6 6-6" />
|
|
</svg>
|
|
</button>
|
|
|
|
<div x-show="settingsOpen" x-collapse class="space-y-1 pl-4">
|
|
<a href="{{ route('settings.users.index') }}"
|
|
class="flex items-center gap-3 rounded-xl px-4 py-3 text-sm font-medium transition {{ request()->routeIs('settings.users.*') ? 'bg-indigo-50 text-indigo-700' : 'text-slate-500 hover:bg-slate-100 hover:text-slate-900' }}">
|
|
<svg class="h-4 w-4" viewBox="0 0 24 24" fill="none" stroke="currentColor">
|
|
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="1.8" d="M16 7a4 4 0 1 1-8 0 4 4 0 0 1 8 0ZM4 20a6 6 0 1 1 12 0" />
|
|
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="1.8" d="M19 8v6M22 11h-6" />
|
|
</svg>
|
|
<span>Manajemen Pengguna</span>
|
|
</a>
|
|
<a href="{{ route('settings.branding.index') }}"
|
|
class="flex items-center gap-3 rounded-xl px-4 py-3 text-sm font-medium transition {{ request()->routeIs('settings.branding.*') ? 'bg-indigo-50 text-indigo-700' : 'text-slate-500 hover:bg-slate-100 hover:text-slate-900' }}">
|
|
<svg class="h-4 w-4" viewBox="0 0 24 24" fill="none" stroke="currentColor">
|
|
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="1.8" d="M12 3l2.7 5.46 6.03.88-4.36 4.25 1.03 6.01L12 16.77 6.6 19.6l1.03-6.01L3.27 9.34l6.03-.88L12 3Z" />
|
|
</svg>
|
|
<span>Branding Aplikasi</span>
|
|
</a>
|
|
<a href="{{ route('settings.reset-data.index') }}"
|
|
class="flex items-center gap-3 rounded-xl px-4 py-3 text-sm font-medium transition {{ request()->routeIs('settings.reset-data.*') ? 'bg-rose-50 text-rose-700' : 'text-slate-500 hover:bg-rose-50 hover:text-rose-700' }}">
|
|
<svg class="h-4 w-4" viewBox="0 0 24 24" fill="none" stroke="currentColor">
|
|
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="1.8" d="M6 7h12M9 7V5.5A1.5 1.5 0 0 1 10.5 4h3A1.5 1.5 0 0 1 15 5.5V7m-8 0 1 12a1.5 1.5 0 0 0 1.5 1.5h5A1.5 1.5 0 0 0 16 19l1-12" />
|
|
</svg>
|
|
<span>Kosongkan Data</span>
|
|
</a>
|
|
</div>
|
|
</div>
|
|
@endif
|
|
</nav>
|
|
</div>
|
|
|
|
<div class="mt-auto border-t border-slate-200 px-4 py-3">
|
|
<div class="text-center">
|
|
<span class="text-[10px] font-semibold uppercase tracking-[0.22em] text-slate-400">Developed by</span>
|
|
<a href="https://noctkj.net" target="_blank" rel="noopener noreferrer" class="mt-1 block text-sm font-semibold tracking-[0.04em] text-slate-700 transition hover:text-indigo-600">
|
|
noctkj.net
|
|
</a>
|
|
</div>
|
|
</div>
|
|
</aside>
|
|
|
|
<div class="lg:pl-72">
|
|
<header class="sticky top-0 z-30 border-b border-slate-200 bg-white/80 backdrop-blur-xl">
|
|
<div class="flex h-20 items-center justify-between px-4 sm:px-6 lg:px-8">
|
|
<div class="flex items-center gap-3">
|
|
<button @click="sidebarOpen = true" class="inline-flex h-11 w-11 items-center justify-center rounded-xl border border-slate-200 bg-white text-slate-500 shadow-sm lg:hidden">
|
|
<svg class="h-5 w-5" viewBox="0 0 24 24" fill="none" stroke="currentColor">
|
|
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="1.8" d="M4 6h16M4 12h16M4 18h16" />
|
|
</svg>
|
|
</button>
|
|
|
|
<div>
|
|
<p class="text-xs font-semibold uppercase tracking-[0.2em] text-slate-400">Panel Admin</p>
|
|
<h1 class="text-lg font-semibold text-slate-900">{{ $branding['app_name'] ?? 'Database Kesiswaan' }}</h1>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="flex items-center gap-3">
|
|
<div class="relative" @click.away="profileMenuOpen = false">
|
|
@php
|
|
$currentUser = auth()->user();
|
|
$currentUserName = data_get($currentUser, 'name', 'User');
|
|
$currentUserEmail = data_get($currentUser, 'email', '-');
|
|
$currentUserInitial = strtoupper(substr((string) $currentUserName, 0, 1)) ?: 'U';
|
|
@endphp
|
|
|
|
<button
|
|
type="button"
|
|
@click="profileMenuOpen = !profileMenuOpen"
|
|
class="flex items-center gap-3 rounded-2xl border border-slate-200 bg-white px-3 py-2 shadow-sm transition hover:border-indigo-200 hover:bg-slate-50"
|
|
>
|
|
<div class="hidden text-right md:block">
|
|
<div class="text-sm font-semibold text-slate-800">{{ $currentUserName }}</div>
|
|
<div class="text-xs text-slate-500">{{ $isAdmin ? 'Administrator' : 'Staff' }}</div>
|
|
</div>
|
|
|
|
<div class="flex h-11 w-11 items-center justify-center rounded-full bg-indigo-100 text-sm font-bold text-indigo-700">
|
|
{{ $currentUserInitial }}
|
|
</div>
|
|
|
|
<svg class="hidden h-4 w-4 text-slate-400 transition-transform md:block" :class="profileMenuOpen ? 'rotate-180' : ''" viewBox="0 0 24 24" fill="none" stroke="currentColor">
|
|
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="1.8" d="m6 9 6 6 6-6" />
|
|
</svg>
|
|
</button>
|
|
|
|
<div
|
|
x-show="profileMenuOpen"
|
|
x-transition.origin.top.right
|
|
class="absolute right-0 z-50 mt-3 w-60 overflow-hidden rounded-2xl border border-slate-200 bg-white shadow-xl shadow-slate-200/70"
|
|
>
|
|
<div class="border-b border-slate-100 px-4 py-4">
|
|
<div class="text-sm font-semibold text-slate-800">{{ $currentUserName }}</div>
|
|
<div class="mt-1 text-xs text-slate-500">{{ $currentUserEmail }}</div>
|
|
</div>
|
|
<div class="p-2">
|
|
<a href="{{ route('profile.edit') }}" class="flex items-center rounded-xl px-3 py-3 text-sm font-medium text-slate-700 transition hover:bg-slate-50 hover:text-indigo-700">
|
|
Profil Administrator
|
|
</a>
|
|
<form method="POST" action="{{ route('logout') }}">
|
|
@csrf
|
|
<button type="submit" class="flex w-full items-center rounded-xl px-3 py-3 text-sm font-medium text-rose-600 transition hover:bg-rose-50">
|
|
Logout
|
|
</button>
|
|
</form>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</header>
|
|
|
|
<main class="px-4 py-6 sm:px-6 lg:px-8">
|
|
@isset($header)
|
|
<div class="mb-6 rounded-2xl border border-slate-200 bg-white px-6 py-5 shadow-sm">
|
|
{{ $header }}
|
|
</div>
|
|
@endisset
|
|
|
|
{{ $slot }}
|
|
</main>
|
|
</div>
|
|
</div>
|