Update navbar
This commit is contained in:
@@ -1,81 +1,34 @@
|
||||
<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
|
||||
// Mengambil data branding dari database
|
||||
$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">
|
||||
<div class="flex justify-between h-20">
|
||||
{{-- Logo Section --}}
|
||||
<div class="flex">
|
||||
<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-12 h-12 bg-indigo-600 rounded-xl flex items-center justify-center text-white font-black text-sm 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-lg font-black text-slate-800 uppercase tracking-tighter leading-none">{{ $appName }}</span>
|
||||
<span class="text-[10px] font-bold text-indigo-600 uppercase tracking-[0.2em] mt-1 italic">Cattery Management</span>
|
||||
</div>
|
||||
</a>
|
||||
</div>
|
||||
|
||||
<div class="hidden space-x-2 sm:-my-px sm:ms-10 sm:flex items-center">
|
||||
<x-nav-link :href="route('dashboard')" :active="request()->routeIs('dashboard')" class="text-[10px] font-black uppercase tracking-widest px-4 py-2 rounded-xl transition-all duration-200">
|
||||
<i class="fas fa-th-large mr-2 opacity-50 group-hover:opacity-100"></i> {{ __('Dashboard') }}
|
||||
</x-nav-link>
|
||||
|
||||
@if(Auth::user()->role === 'admin')
|
||||
<x-nav-link :href="route('admin.settings.index')" :active="request()->routeIs('admin.settings.*')" class="text-[10px] font-black uppercase tracking-widest px-4 py-2 rounded-xl text-rose-500 hover:text-rose-600 transition-all duration-200">
|
||||
<i class="fas fa-cog mr-2 opacity-50"></i> {{ __('Settings') }}
|
||||
</x-nav-link>
|
||||
@endif
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="hidden sm:flex sm:items-center sm:ms-6">
|
||||
<x-dropdown align="right" width="56">
|
||||
<x-slot name="trigger">
|
||||
<button class="inline-flex items-center gap-3 px-4 py-2 border-2 border-slate-50 text-xs leading-4 font-bold rounded-2xl text-slate-500 bg-slate-50/50 hover:bg-white hover:border-indigo-100 hover:text-indigo-600 focus:outline-none transition-all duration-200 shadow-sm active:scale-95">
|
||||
<div class="w-7 h-7 bg-indigo-100 text-indigo-600 rounded-lg flex items-center justify-center font-black ring-2 ring-white">
|
||||
{{ strtoupper(substr(Auth::user()->name, 0, 1)) }}
|
||||
</div>
|
||||
<div class="uppercase tracking-tighter">{{ Auth::user()->name }}</div>
|
||||
<i class="fas fa-chevron-down text-[10px] ml-1 opacity-30"></i>
|
||||
</button>
|
||||
</x-slot>
|
||||
|
||||
<x-slot name="content">
|
||||
<div class="px-4 py-3 border-b border-slate-50">
|
||||
<p class="text-[8px] font-black text-slate-400 uppercase tracking-widest">Signed in as</p>
|
||||
<p class="text-xs font-bold text-slate-800 truncate">{{ Auth::user()->email }}</p>
|
||||
<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>
|
||||
<x-dropdown-link :href="route('profile.edit')" class="text-xs font-bold py-3 hover:bg-indigo-50 transition-colors">
|
||||
<i class="fas fa-user-circle mr-2 opacity-40"></i> {{ __('My Profile') }}
|
||||
</x-dropdown-link>
|
||||
|
||||
<div class="h-px bg-slate-50 my-1"></div>
|
||||
|
||||
<form method="POST" action="{{ route('logout') }}">
|
||||
@csrf
|
||||
<x-dropdown-link :href="route('logout')" class="text-xs font-bold py-3 text-rose-500 hover:bg-rose-50 transition-colors" onclick="event.preventDefault(); this.closest('form').submit();">
|
||||
<i class="fas fa-sign-out-alt mr-2 opacity-40"></i> {{ __('Log Out') }}
|
||||
</x-dropdown-link>
|
||||
</form>
|
||||
</x-slot>
|
||||
</x-dropdown>
|
||||
<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>
|
||||
|
||||
<div class="-me-2 flex items-center sm:hidden">
|
||||
<button @click="open = ! open" class="inline-flex items-center justify-center p-2.5 rounded-xl text-slate-400 hover:text-indigo-600 hover:bg-indigo-50 transition-all duration-200 active:scale-90">
|
||||
<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" />
|
||||
@@ -85,44 +38,138 @@
|
||||
</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="hidden sm:hidden bg-white border-t border-slate-100">
|
||||
<div class="pt-2 pb-3 space-y-1 px-4">
|
||||
<x-responsive-nav-link :href="route('dashboard')" :active="request()->routeIs('dashboard')" class="rounded-xl font-black text-[10px] uppercase tracking-widest py-3">
|
||||
<i class="fas fa-th-large mr-3"></i> {{ __('Dashboard') }}
|
||||
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>
|
||||
|
||||
{{-- MEDICAL INSIGHT --}}
|
||||
@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')
|
||||
<x-responsive-nav-link :href="route('admin.settings.index')" :active="request()->routeIs('admin.settings.*')" class="rounded-xl font-black text-[10px] uppercase tracking-widest text-rose-500 py-3">
|
||||
<i class="fas fa-cog mr-3"></i> {{ __('System Settings') }}
|
||||
</x-responsive-nav-link>
|
||||
<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>
|
||||
|
||||
{{-- ROLE MANAGEMENT --}}
|
||||
@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
|
||||
|
||||
{{-- LOG AUDIT --}}
|
||||
@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>
|
||||
|
||||
<div class="pt-4 pb-4 border-t border-slate-100 bg-slate-50/50">
|
||||
<div class="flex items-center px-6 gap-4">
|
||||
<div class="w-12 h-12 bg-indigo-600 text-white rounded-2xl flex items-center justify-center font-black shadow-lg shadow-indigo-100 ring-4 ring-white">
|
||||
{{-- USER INFO & LOGOUT --}}
|
||||
<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">
|
||||
<div class="w-8 h-8 bg-indigo-600 text-white rounded-lg flex items-center justify-center font-black text-[10px]">
|
||||
{{ strtoupper(substr(Auth::user()->name, 0, 1)) }}
|
||||
</div>
|
||||
<div class="overflow-hidden">
|
||||
<div class="font-black text-sm text-slate-800 uppercase tracking-tighter">{{ Auth::user()->name }}</div>
|
||||
<div class="font-bold text-[10px] text-slate-400 truncate">{{ Auth::user()->email }}</div>
|
||||
<div class="font-black text-[9px] text-slate-800 uppercase leading-none">{{ Auth::user()->name }}</div>
|
||||
<div class="font-bold text-[7px] text-slate-400 truncate mt-1">{{ Auth::user()->email }}</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="mt-4 space-y-1 px-4">
|
||||
<x-responsive-nav-link :href="route('profile.edit')" class="rounded-xl font-bold text-xs uppercase tracking-widest py-3">
|
||||
<i class="fas fa-user-circle mr-3"></i> {{ __('Profile Settings') }}
|
||||
</x-responsive-nav-link>
|
||||
<form method="POST" action="{{ route('logout') }}">
|
||||
@csrf
|
||||
<x-responsive-nav-link :href="route('logout')" class="rounded-xl font-black text-xs uppercase tracking-widest text-rose-500 py-3" onclick="event.preventDefault(); this.closest('form').submit();">
|
||||
<i class="fas fa-sign-out-alt mr-3"></i> {{ __('Sign Out') }}
|
||||
</x-responsive-nav-link>
|
||||
</form>
|
||||
</div>
|
||||
<form method="POST" action="{{ route('logout') }}" class="px-4">
|
||||
@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>
|
||||
</nav>
|
||||
Reference in New Issue
Block a user