perbaikan sidebar
This commit is contained in:
@@ -6,7 +6,6 @@
|
|||||||
});
|
});
|
||||||
$appName = $appSettings['app_name'] ?? 'Ily Cattery';
|
$appName = $appSettings['app_name'] ?? 'Ily Cattery';
|
||||||
|
|
||||||
// Hitung stok kritis untuk badge (TETAP UTUH)
|
|
||||||
$lowMedicinesCount = \App\Models\Medicine::where('qty', '<', 5)->count();
|
$lowMedicinesCount = \App\Models\Medicine::where('qty', '<', 5)->count();
|
||||||
$lowFoodsCount = \App\Models\Food::where('qty', '<', 5)->count();
|
$lowFoodsCount = \App\Models\Food::where('qty', '<', 5)->count();
|
||||||
@endphp
|
@endphp
|
||||||
@@ -25,7 +24,6 @@
|
|||||||
{{-- Navigation Links --}}
|
{{-- Navigation Links --}}
|
||||||
<nav class="flex-1 px-4 space-y-1 overflow-y-auto custom-scrollbar">
|
<nav class="flex-1 px-4 space-y-1 overflow-y-auto custom-scrollbar">
|
||||||
|
|
||||||
{{-- Dashboard biasanya dapat diakses oleh semua user terautentikasi --}}
|
|
||||||
<x-sidebar-link :href="route('dashboard')" :active="request()->routeIs('dashboard')" icon="fa-th-large">
|
<x-sidebar-link :href="route('dashboard')" :active="request()->routeIs('dashboard')" icon="fa-th-large">
|
||||||
Dashboard
|
Dashboard
|
||||||
</x-sidebar-link>
|
</x-sidebar-link>
|
||||||
@@ -51,62 +49,55 @@
|
|||||||
@endcan
|
@endcan
|
||||||
@endif
|
@endif
|
||||||
|
|
||||||
{{-- KESEHATAN --}}
|
{{-- LOGISTIK (CONTOH DROPDOWN) --}}
|
||||||
@if(Gate::allows('check-access', ['medical_insights', 'read']) || Gate::allows('check-access', ['treatments', 'read']))
|
|
||||||
<div class="pt-6 pb-2 px-5 text-[9px] font-black text-slate-400 uppercase tracking-[0.3em] flex items-center gap-3">
|
|
||||||
<span>Kesehatan</span>
|
|
||||||
<div class="h-px bg-slate-100 flex-1"></div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
@can('check-access', ['medical_insights', 'read'])
|
|
||||||
<x-sidebar-link :href="route('medical.dashboard')" :active="request()->routeIs('medical.dashboard')" icon="fa-chart-pie">
|
|
||||||
Medical Insight
|
|
||||||
</x-sidebar-link>
|
|
||||||
@endcan
|
|
||||||
|
|
||||||
@can('check-access', ['treatments', 'read'])
|
|
||||||
<x-sidebar-link :href="route('treatments.index')" :active="request()->routeIs('treatments.*')" icon="fa-notes-medical">
|
|
||||||
Rekam Medis
|
|
||||||
</x-sidebar-link>
|
|
||||||
@endcan
|
|
||||||
@endif
|
|
||||||
|
|
||||||
{{-- LOGISTIK --}}
|
|
||||||
@if(Gate::allows('check-access', ['medicines', 'read']) || Gate::allows('check-access', ['foods', 'read']) || Gate::allows('check-access', ['supplies', 'read']) || Gate::allows('check-access', ['categories', 'read']))
|
@if(Gate::allows('check-access', ['medicines', 'read']) || Gate::allows('check-access', ['foods', 'read']) || Gate::allows('check-access', ['supplies', 'read']) || Gate::allows('check-access', ['categories', 'read']))
|
||||||
<div class="pt-6 pb-2 px-5 text-[9px] font-black text-slate-400 uppercase tracking-[0.3em] flex items-center gap-3">
|
<div class="pt-6 pb-2 px-5 text-[9px] font-black text-slate-400 uppercase tracking-[0.3em] flex items-center gap-3">
|
||||||
<span>Logistik</span>
|
<span>Inventori</span>
|
||||||
<div class="h-px bg-slate-100 flex-1"></div>
|
<div class="h-px bg-slate-100 flex-1"></div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@can('check-access', ['medicines', 'read'])
|
{{-- Parent Dropdown Logistik --}}
|
||||||
<x-sidebar-link :href="route('inventory.medicines.index')" :active="request()->routeIs('inventory.medicines.*')" icon="fa-pills">
|
<div x-data="{ open: {{ request()->routeIs('inventory.*') || request()->routeIs('categories.*') ? 'true' : 'false' }} }">
|
||||||
<span class="flex-1">Obat & Vitamin</span>
|
<button @click="open = !open"
|
||||||
@if($lowMedicinesCount > 0)
|
class="w-full flex items-center gap-3 px-5 py-3 text-xs font-bold rounded-2xl transition-all {{ request()->routeIs('inventory.*') ? 'bg-indigo-50 text-indigo-600' : 'text-slate-500 hover:bg-slate-50' }}">
|
||||||
<span class="bg-rose-500 text-white text-[9px] font-black px-2 py-0.5 rounded-lg animate-pulse">{{ $lowMedicinesCount }}</span>
|
<i class="fas fa-box-open w-5 text-center"></i>
|
||||||
@endif
|
<span class="flex-1 text-left">Gudang Logistik</span>
|
||||||
</x-sidebar-link>
|
<i class="fas fa-chevron-down text-[10px] transition-transform duration-200" :class="open ? 'rotate-180' : ''"></i>
|
||||||
@endcan
|
</button>
|
||||||
|
|
||||||
@can('check-access', ['foods', 'read'])
|
{{-- Sub-menu Items --}}
|
||||||
<x-sidebar-link :href="route('inventory.foods.index')" :active="request()->routeIs('inventory.foods.*')" icon="fa-bowl-food">
|
<div x-show="open" x-cloak x-collapse class="mt-1 ml-4 pl-4 border-l border-slate-100 space-y-1">
|
||||||
<span class="flex-1">Stok Makanan</span>
|
@can('check-access', ['medicines', 'read'])
|
||||||
@if($lowFoodsCount > 0)
|
<x-sidebar-link :href="route('inventory.medicines.index')" :active="request()->routeIs('inventory.medicines.*')" icon="fa-pills">
|
||||||
<span class="bg-rose-500 text-white text-[9px] font-black px-2 py-0.5 rounded-lg">{{ $lowFoodsCount }}</span>
|
<span class="flex-1">Obat & Vitamin</span>
|
||||||
@endif
|
@if($lowMedicinesCount > 0)
|
||||||
</x-sidebar-link>
|
<span class="bg-rose-500 text-white text-[9px] font-black px-2 py-0.5 rounded-lg animate-pulse">{{ $lowMedicinesCount }}</span>
|
||||||
@endcan
|
@endif
|
||||||
|
</x-sidebar-link>
|
||||||
|
@endcan
|
||||||
|
|
||||||
@can('check-access', ['supplies', 'read'])
|
@can('check-access', ['foods', 'read'])
|
||||||
<x-sidebar-link :href="route('inventory.supplies.index')" :active="request()->routeIs('inventory.supplies.*')" icon="fa-box-archive">
|
<x-sidebar-link :href="route('inventory.foods.index')" :active="request()->routeIs('inventory.foods.*')" icon="fa-bowl-food">
|
||||||
Perlengkapan
|
<span class="flex-1">Stok Makanan</span>
|
||||||
</x-sidebar-link>
|
@if($lowFoodsCount > 0)
|
||||||
@endcan
|
<span class="bg-rose-500 text-white text-[9px] font-black px-2 py-0.5 rounded-lg">{{ $lowFoodsCount }}</span>
|
||||||
|
@endif
|
||||||
|
</x-sidebar-link>
|
||||||
|
@endcan
|
||||||
|
|
||||||
@can('check-access', ['categories', 'read'])
|
@can('check-access', ['supplies', 'read'])
|
||||||
<x-sidebar-link :href="route('categories.index')" :active="request()->routeIs('categories.*')" icon="fa-tags">
|
<x-sidebar-link :href="route('inventory.supplies.index')" :active="request()->routeIs('inventory.supplies.*')" icon="fa-box-archive">
|
||||||
Master Kategori
|
Perlengkapan
|
||||||
</x-sidebar-link>
|
</x-sidebar-link>
|
||||||
@endcan
|
@endcan
|
||||||
|
|
||||||
|
@can('check-access', ['categories', 'read'])
|
||||||
|
<x-sidebar-link :href="route('categories.index')" :active="request()->routeIs('categories.*')" icon="fa-tags">
|
||||||
|
Master Kategori
|
||||||
|
</x-sidebar-link>
|
||||||
|
@endcan
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
@endif
|
@endif
|
||||||
|
|
||||||
{{-- INTELLIGENCE --}}
|
{{-- INTELLIGENCE --}}
|
||||||
@@ -130,36 +121,47 @@
|
|||||||
@endcan
|
@endcan
|
||||||
@endif
|
@endif
|
||||||
|
|
||||||
{{-- KONFIGURASI (Hanya tampil untuk yang memiliki akses ke modul-modul ini) --}}
|
{{-- KONFIGURASI (DROPDOWN) --}}
|
||||||
@if(Gate::allows('check-access', ['users', 'read']) || Gate::allows('check-access', ['roles', 'read']) || Gate::allows('check-access', ['logs', 'read']) || Gate::allows('check-access', ['settings', 'read']))
|
@if(Gate::allows('check-access', ['users', 'read']) || Gate::allows('check-access', ['roles', 'read']) || Gate::allows('check-access', ['logs', 'read']) || Gate::allows('check-access', ['settings', 'read']))
|
||||||
<div class="pt-8 pb-2 px-5 text-[9px] font-black text-rose-500 uppercase tracking-[0.3em] flex items-center gap-3">
|
<div class="pt-8 pb-2 px-5 text-[9px] font-black text-rose-500 uppercase tracking-[0.3em] flex items-center gap-3">
|
||||||
<span>Konfigurasi</span>
|
<span>Konfigurasi</span>
|
||||||
<div class="h-px bg-rose-50 flex-1"></div>
|
<div class="h-px bg-rose-50 flex-1"></div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@can('check-access', ['users', 'read'])
|
<div x-data="{ open: {{ request()->routeIs('admin.users.*') || request()->routeIs('admin.roles.*') || request()->routeIs('admin.settings.*') ? 'true' : 'false' }} }">
|
||||||
<x-sidebar-link :href="route('admin.users.index')" :active="request()->routeIs('admin.users.*')" icon="fa-users-cog">
|
<button @click="open = !open"
|
||||||
Manajemen User
|
class="w-full flex items-center gap-3 px-5 py-3 text-xs font-bold rounded-2xl transition-all {{ request()->routeIs('admin.*') ? 'bg-rose-50 text-rose-600' : 'text-slate-500 hover:bg-slate-50' }}">
|
||||||
</x-sidebar-link>
|
<i class="fas fa-cog w-5 text-center"></i>
|
||||||
@endcan
|
<span class="flex-1 text-left">Sistem Control</span>
|
||||||
|
<i class="fas fa-chevron-down text-[10px] transition-transform duration-200" :class="open ? 'rotate-180' : ''"></i>
|
||||||
|
</button>
|
||||||
|
|
||||||
@can('check-access', ['roles', 'read'])
|
<div x-show="open" x-cloak x-collapse class="mt-1 ml-4 pl-4 border-l border-rose-100 space-y-1">
|
||||||
<x-sidebar-link :href="route('admin.roles.index')" :active="request()->routeIs('admin.roles.*')" icon="fa-user-shield">
|
@can('check-access', ['users', 'read'])
|
||||||
Role Management
|
<x-sidebar-link :href="route('admin.users.index')" :active="request()->routeIs('admin.users.*')" icon="fa-users-cog">
|
||||||
</x-sidebar-link>
|
Manajemen User
|
||||||
@endcan
|
</x-sidebar-link>
|
||||||
|
@endcan
|
||||||
|
|
||||||
@can('check-access', ['logs', 'read'])
|
@can('check-access', ['roles', 'read'])
|
||||||
<x-sidebar-link :href="route('admin.logs.index')" :active="request()->routeIs('admin.logs.*')" icon="fa-history">
|
<x-sidebar-link :href="route('admin.roles.index')" :active="request()->routeIs('admin.roles.*')" icon="fa-user-shield">
|
||||||
Log Audit
|
Role Management
|
||||||
</x-sidebar-link>
|
</x-sidebar-link>
|
||||||
@endcan
|
@endcan
|
||||||
|
|
||||||
@can('check-access', ['settings', 'read'])
|
@can('check-access', ['logs', 'read'])
|
||||||
<x-sidebar-link :href="route('admin.settings.index')" :active="request()->routeIs('admin.settings.*')" icon="fa-sliders-h">
|
<x-sidebar-link :href="route('admin.logs.index')" :active="request()->routeIs('admin.logs.*')" icon="fa-history">
|
||||||
Pengaturan Sistem
|
Log Audit
|
||||||
</x-sidebar-link>
|
</x-sidebar-link>
|
||||||
@endcan
|
@endcan
|
||||||
|
|
||||||
|
@can('check-access', ['settings', 'read'])
|
||||||
|
<x-sidebar-link :href="route('admin.settings.index')" :active="request()->routeIs('admin.settings.*')" icon="fa-sliders-h">
|
||||||
|
Pengaturan Sistem
|
||||||
|
</x-sidebar-link>
|
||||||
|
@endcan
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
@endif
|
@endif
|
||||||
</nav>
|
</nav>
|
||||||
</aside>
|
</aside>
|
||||||
Reference in New Issue
Block a user