Files
ilycats/resources/views/layouts/navigation.blade.php
T
2026-02-08 20:24:39 +07:00

210 lines
14 KiB
PHP

<nav x-data="{ open: false }" class="bg-white/80 backdrop-blur-md border-b border-slate-100 sticky top-0 z-50 shadow-sm">
@php
$appLogo = \App\Models\Setting::where('key', 'app_logo')->value('value');
$appName = \App\Models\Setting::where('key', 'app_name')->value('value') ?? 'ILY Aregau';
@endphp
<div class="max-w-7xl mx-auto px-4 sm:px-6 lg:px-8">
<div class="flex justify-between h-20">
<div class="flex">
{{-- Logo Section --}}
<div class="shrink-0 flex items-center">
<a href="{{ route('dashboard') }}" class="flex items-center gap-4 group">
<div class="flex items-center justify-center transition-transform duration-300 group-hover:scale-105">
@if($appLogo)
<img src="{{ Storage::url($appLogo) }}" alt="Logo {{ $appName }}" class="h-16 w-auto max-w-[200px] object-contain object-left">
@else
<div class="w-10 h-10 bg-indigo-600 rounded-xl flex items-center justify-center text-white font-black text-xs shadow-lg">
{{ strtoupper(substr($appName, 0, 2)) }}
</div>
@endif
</div>
<div class="hidden md:flex flex-col border-l-2 border-slate-100 pl-4">
<span class="text-base font-black text-slate-800 uppercase tracking-tighter leading-none">{{ $appName }}</span>
<span class="text-[9px] font-bold text-indigo-600 uppercase tracking-[0.2em] mt-1 italic">Cattery Management</span>
</div>
</a>
</div>
</div>
{{-- MENU DESKTOP (USER PROFILE DROPDOWN) --}}
<div class="hidden lg:flex lg:items-center lg:ms-6">
<x-dropdown align="right" width="48">
<x-slot name="trigger">
<button class="inline-flex items-center px-3 py-2 border border-transparent text-sm leading-4 font-black rounded-xl text-slate-500 bg-slate-50 hover:text-indigo-600 hover:bg-indigo-50 transition ease-in-out duration-150">
<div class="w-8 h-8 bg-indigo-600 text-white rounded-lg flex items-center justify-center text-[10px] mr-2 shadow-sm">
{{ strtoupper(substr(Auth::user()->name, 0, 1)) }}
</div>
<div>{{ Auth::user()->name }}</div>
<div class="ms-1">
<svg class="fill-current h-4 w-4" viewBox="0 0 20 20">
<path fill-rule="evenodd" d="M5.293 7.293a1 1 0 011.414 0L10 10.586l3.293-3.293a1 1 0 111.414 1.414l-4 4a1 1 0 01-1.414 0l-4-4a1 1 0 010-1.414z" clip-rule="evenodd" />
</svg>
</div>
</button>
</x-slot>
<x-slot name="content">
<div class="px-4 py-2 border-b border-slate-50">
<p class="text-[10px] font-black text-slate-800 uppercase tracking-tighter">{{ Auth::user()->name }}</p>
<p class="text-[8px] font-bold text-slate-400 truncate">{{ Auth::user()->email }}</p>
</div>
<x-dropdown-link :href="route('profile.edit')" class="text-[10px] font-bold uppercase tracking-widest">
<i class="fas fa-user-circle mr-2 opacity-50"></i> {{ __('My Profile') }}
</x-dropdown-link>
<form method="POST" action="{{ route('logout') }}">
@csrf
<x-dropdown-link :href="route('logout')" class="text-[10px] font-black uppercase tracking-widest text-rose-500"
onclick="event.preventDefault(); this.closest('form').submit();">
<i class="fas fa-sign-out-alt mr-2"></i> {{ __('Log Out') }}
</x-dropdown-link>
</form>
</x-slot>
</x-dropdown>
</div>
{{-- Hamburger Button (Hanya Mobile) --}}
<div class="-me-2 flex items-center lg:hidden">
<button @click="open = ! open" class="inline-flex items-center justify-center p-2 rounded-xl text-slate-400 hover:text-indigo-600 hover:bg-indigo-50 transition-all duration-200 focus:outline-none">
<svg class="h-6 w-6" stroke="currentColor" fill="none" viewBox="0 0 24 24">
<path :class="{'hidden': open, 'inline-flex': ! open }" class="inline-flex" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M4 6h16M4 12h16M4 18h16" />
<path :class="{'hidden': ! open, 'inline-flex': open }" class="hidden" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M6 18L18 6M6 6l12 12" />
</svg>
</button>
</div>
</div>
</div>
{{-- MOBILE MENU ACCORDION --}}
<div x-show="open"
x-cloak
x-data="{ activeMenu: 'dashboard' }"
x-transition:enter="transition ease-out duration-200"
x-transition:enter-start="opacity-0 -translate-y-4"
x-transition:enter-end="opacity-100 translate-y-0"
class="lg:hidden bg-white border-t border-slate-100 shadow-xl overflow-y-auto max-h-[85vh]">
<div class="pt-2 pb-3 space-y-0.5 px-3">
{{-- 1. DASHBOARD --}}
<x-responsive-nav-link :href="route('dashboard')" :active="request()->routeIs('dashboard')" class="rounded-lg font-black text-[8.5px] uppercase tracking-widest py-2">
<i class="fas fa-th-large mr-2 w-4"></i> Dashboard
</x-responsive-nav-link>
{{-- 2. CATTERY & MEDICAL --}}
<div class="border-t border-slate-50">
<button @click="activeMenu = activeMenu === 'cattery' ? '' : 'cattery'" class="w-full flex justify-between items-center px-3 py-2.5 text-[7px] font-black text-slate-400 uppercase tracking-[0.2em]">
<span>Cattery & Medical</span>
<i class="fas fa-chevron-down transition-transform" :class="activeMenu === 'cattery' ? 'rotate-180' : ''"></i>
</button>
<div x-show="activeMenu === 'cattery'" x-collapse class="bg-slate-50/50 rounded-lg">
<x-responsive-nav-link :href="route('cats.index')" :active="request()->routeIs('cats.*')" class="text-[8.5px] font-bold py-2">
<i class="fas fa-cat mr-2 w-4"></i> Data Kucing
</x-responsive-nav-link>
<x-responsive-nav-link :href="route('matting.index')" :active="request()->routeIs('matting.*')" class="text-[8.5px] font-bold py-2">
<i class="fas fa-heart mr-2 w-4"></i> Breeding
</x-responsive-nav-link>
<x-responsive-nav-link :href="route('treatments.index')" :active="request()->routeIs('treatments.*')" class="text-[8.5px] font-bold py-2">
<i class="fas fa-notes-medical mr-2 w-4"></i> Rekam Medis
</x-responsive-nav-link>
@if(Route::has('medical.dashboard'))
<x-responsive-nav-link :href="route('medical.dashboard')" :active="request()->routeIs('medical.dashboard')" class="text-[8.5px] font-bold py-2">
<i class="fas fa-microscope mr-2 w-4"></i> Medical Insight
</x-responsive-nav-link>
@endif
</div>
</div>
{{-- 3. LOGISTIK & MASTER --}}
<div class="border-t border-slate-50">
<button @click="activeMenu = activeMenu === 'logistik' ? '' : 'logistik'" class="w-full flex justify-between items-center px-3 py-2.5 text-[7px] font-black text-slate-400 uppercase tracking-[0.2em]">
<span>Logistik & Master</span>
<i class="fas fa-chevron-down transition-transform" :class="activeMenu === 'logistik' ? 'rotate-180' : ''"></i>
</button>
<div x-show="activeMenu === 'logistik'" x-collapse class="bg-slate-50/50 rounded-lg">
@if(Route::has('categories.index'))
<x-responsive-nav-link :href="route('categories.index')" :active="request()->routeIs('categories.*')" class="text-[8.5px] font-bold py-2">
<i class="fas fa-tags mr-2 w-4"></i> Master Kategori
</x-responsive-nav-link>
@endif
<x-responsive-nav-link :href="route('inventory.medicines.index')" :active="request()->routeIs('inventory.medicines.*')" class="text-[8.5px] font-bold py-2">
<i class="fas fa-pills mr-2 w-4"></i> Obat-obatan
</x-responsive-nav-link>
<x-responsive-nav-link :href="route('inventory.foods.index')" :active="request()->routeIs('inventory.foods.*')" class="text-[8.5px] font-bold py-2">
<i class="fas fa-utensils mr-2 w-4"></i> Makanan
</x-responsive-nav-link>
<x-responsive-nav-link :href="route('inventory.supplies.index')" :active="request()->routeIs('inventory.supplies.*')" class="text-[8.5px] font-bold py-2">
<i class="fas fa-boxes mr-2 w-4"></i> Perlengkapan
</x-responsive-nav-link>
</div>
</div>
{{-- 4. PUSAT LAPORAN --}}
<div class="border-t border-slate-50">
<button @click="activeMenu = activeMenu === 'reports' ? '' : 'reports'" class="w-full flex justify-between items-center px-3 py-2.5 text-[7px] font-black text-slate-400 uppercase tracking-[0.2em]">
<span>Pusat Laporan</span>
<i class="fas fa-chevron-down transition-transform" :class="activeMenu === 'reports' ? 'rotate-180' : ''"></i>
</button>
<div x-show="activeMenu === 'reports'" x-collapse class="bg-slate-50/50 rounded-lg">
<x-responsive-nav-link :href="route('admin.reports.index')" :active="request()->routeIs('admin.reports.index')" class="text-[8.5px] font-bold py-2">
<i class="fas fa-chart-pie mr-2 w-4"></i> Intelligence Center
</x-responsive-nav-link>
<x-responsive-nav-link :href="route('admin.reports.matting.index')" :active="request()->routeIs('admin.reports.matting.*')" class="text-[8.5px] font-bold py-2">
<i class="fas fa-scroll mr-2 w-4"></i> Laporan Breeding
</x-responsive-nav-link>
</div>
</div>
{{-- 5. KONFIGURASI --}}
@if(Auth::user()->role === 'admin')
<div class="border-t border-slate-50">
<button @click="activeMenu = activeMenu === 'config' ? '' : 'config'" class="w-full flex justify-between items-center px-3 py-2.5 text-[7px] font-black text-slate-400 uppercase tracking-[0.2em]">
<span>Konfigurasi & Sistem</span>
<i class="fas fa-chevron-down transition-transform" :class="activeMenu === 'config' ? 'rotate-180' : ''"></i>
</button>
<div x-show="activeMenu === 'config'" x-collapse class="bg-slate-50/50 rounded-lg">
<x-responsive-nav-link :href="route('admin.users.index')" :active="request()->routeIs('admin.users.*')" class="text-[8.5px] font-bold py-2">
<i class="fas fa-user-shield mr-2 w-4"></i> Management User
</x-responsive-nav-link>
@if(Route::has('admin.roles.index'))
<x-responsive-nav-link :href="route('admin.roles.index')" :active="request()->routeIs('admin.roles.*')" class="text-[8.5px] font-bold py-2">
<i class="fas fa-key mr-2 w-4"></i> Role Management
</x-responsive-nav-link>
@endif
@if(Route::has('admin.logs.index'))
<x-responsive-nav-link :href="route('admin.logs.index')" :active="request()->routeIs('admin.logs.*')" class="text-[8.5px] font-bold py-2 text-amber-600">
<i class="fas fa-history mr-2 w-4"></i> Log Audit
</x-responsive-nav-link>
@endif
<x-responsive-nav-link :href="route('admin.settings.index')" :active="request()->routeIs('admin.settings.*')" class="text-[8.5px] font-black py-2 text-rose-500 border-t border-slate-100">
<i class="fas fa-cogs mr-2 w-4"></i> Pengaturan Sistem
</x-responsive-nav-link>
</div>
</div>
@endif
</div>
{{-- USER INFO & LOGOUT (MOBILE) --}}
<div class="pt-4 pb-8 border-t border-slate-100 bg-slate-50/50">
<div class="flex items-center px-6 gap-3 mb-4 text-left">
<div class="w-10 h-10 bg-indigo-600 text-white rounded-xl flex items-center justify-center font-black text-[12px] shadow-md">
{{ strtoupper(substr(Auth::user()->name, 0, 1)) }}
</div>
<div class="overflow-hidden">
<div class="font-black text-[10px] text-slate-800 uppercase leading-none">{{ Auth::user()->name }}</div>
<div class="font-bold text-[8px] text-slate-400 truncate mt-1">{{ Auth::user()->email }}</div>
</div>
</div>
<div class="px-4 space-y-1">
<x-responsive-nav-link :href="route('profile.edit')" class="rounded-xl font-bold text-[9px] uppercase tracking-widest py-2.5">
<i class="fas fa-user-circle mr-3 w-4"></i> Edit Profile
</x-responsive-nav-link>
<form method="POST" action="{{ route('logout') }}">
@csrf
<button type="submit" class="w-full flex items-center justify-center gap-2 rounded-xl font-black text-[9px] uppercase tracking-widest text-rose-500 py-3 bg-white border border-rose-100 shadow-sm transition-all active:scale-95">
<i class="fas fa-sign-out-alt"></i> Keluar Aplikasi
</button>
</form>
</div>
</div>
</div>
</nav>