Files
Kent-logistics-Laravel/resources/views/admin/layouts/app.blade.php
Abhishek Mali c4097ecbde employee update
2025-12-19 16:08:34 +05:30

399 lines
11 KiB
PHP

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="csrf-token" content="{{ csrf_token() }}">
<title>Admin Panel</title>
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/css/bootstrap.min.css" rel="stylesheet" />
<link href="https://cdn.jsdelivr.net/npm/bootstrap-icons@1.11.3/font/bootstrap-icons.css" rel="stylesheet" />
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap-icons@1.10.5/font/bootstrap-icons.css">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.5.1/css/all.min.css" integrity="sha512-DTOQO9RWCH3ppGqcWaEA1BIZOC6xxalwEsw9c2QQeAIftl+Vegovlnee1c9QX4TctnWMn13TZye+giMm8e2LwA==" crossorigin="anonymous" referrerpolicy="no-referrer" />
<style>
body {
margin: 0;
min-height: 100vh;
background: #f3f8ff;
font-family: 'Inter', Arial, sans-serif;
display: flex;
flex-direction: row;
transition: all 0.3s ease-in-out;
}
/* ✨ Sidebar Glass + Animated Highlight Effect */
.sidebar {
width: 200px;
height: 100vh;
background: linear-gradient(180deg, rgba(255, 255, 255, 0.9), rgba(232, 240, 255, 0.95)) !important;
box-shadow: 2px 0 25px rgba(0, 0, 0, 0.08);
backdrop-filter: blur(8px);
border-right: 1px solid rgba(180, 200, 255, 0.3);
z-index: 200;
padding-top: 8px;
flex-shrink: 0;
display: flex;
flex-direction: column;
transition: all 0.3s ease-in-out;
position: fixed;
top: 0;
left: 0;
}
/* Sidebar collapsed state */
.sidebar.collapsed {
transform: translateX(-100%);
opacity: 0;
visibility: hidden;
}
.sidebar .logo {
display: flex;
align-items: center;
justify-content: flex-start;
padding: 6px 0 6px 10px;
margin-bottom: 10px;
border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}
.sidebar .logo img {
height: 30px;
width: auto;
margin-right: 6px;
}
.sidebar .word {
color: #800000; font-size: 13px; line-height: 1.24;
}
/* 🔥 Sidebar Links */
.sidebar a {
display: flex;
align-items: center;
color: #2b5cb6 !important;
text-decoration: none;
padding: 11px 13px;
font-size: 0.97rem;
border-radius: 12px;
margin: 10px 10px 0 10px;
font-weight: 500;
position: relative;
overflow: hidden;
transition: all 0.25s ease;
z-index: 0;
}
/* Background Animation */
.sidebar a::before {
content: "";
position: absolute;
left: -100%;
top: 0;
width: 100%;
height: 100%;
background: linear-gradient(90deg, #a8c0ff, #3f2b96);
opacity: 0;
transition: all 0.4s ease;
border-radius: 12px;
z-index: -1;
}
.sidebar a:hover::before {
left: 0;
opacity: 0.12;
}
.sidebar a:hover {
transform: translateX(6px);
color: #1258e0 !important;
}
/* Icon bounce effect */
.sidebar a i {
margin-right: 8px;
font-size: 1.1rem;
transition: transform 0.2s, color 0.2s;
}
.sidebar a:hover i {
transform: scale(1.1);
color: #1258e0 !important;
}
/* Active link glow effect */
.sidebar a.active {
background: linear-gradient(90deg, rgba(80,120,255,0.15), rgba(120,180,255,0.2));
color: #1258e0 !important;
font-weight: 600;
box-shadow: 0 0 8px rgba(80,120,255,0.15);
border: 1px solid rgba(160, 190, 255, 0.4);
transform: scale(1.03);
}
.sidebar a.active::before {
left: 0;
opacity: 0.2;
}
/* Logout Button */
.sidebar form button {
border-radius: 12px;
margin-top: 12px;
font-weight: 500;
transition: 0.3s ease;
margin-bottom: 20px;
}
.sidebar form button:hover {
box-shadow: 0 3px 10px rgba(255, 0, 0, 0.3);
transform: scale(1.03);
}
/* 🧭 Main Content */
.main-content {
flex-grow: 1;
min-height: 100vh;
background: #f3f8ff;
display: flex;
flex-direction: column;
width: calc(100vw - 190px);
margin-left: 190px;
transition: all 0.3s ease-in-out;
}
/* Main content when sidebar is collapsed */
.main-content.expanded {
margin-left: 0;
width: 100vw;
}
/* Header hamburger button */
.header-toggle {
background: transparent;
border: none;
cursor: pointer;
padding: 8px;
margin-right: 15px;
display: flex;
align-items: center;
justify-content: center;
transition: transform 0.3s ease;
width: 40px;
height: 40px;
border-radius: 8px;
}
.header-toggle:hover {
transform: scale(1.1);
background: rgba(43, 92, 182, 0.1);
}
.header-toggle i {
font-size: 1.6rem;
color: #2b5cb6;
}
header {
display: flex;
justify-content: space-between;
align-items: center;
background: #fff;
padding: 10px 18px !important;
position: relative;
height: 65px;
width: 100%;
box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}
.header-left {
display: flex;
align-items: center;
}
.content-wrapper {
padding: 18px 16px 16px 16px;
flex-grow: 1;
overflow-y: auto;
}
.dropdown-user-profile-name {
font-size: 1.06rem;
font-weight: 500;
}
/* ================================
HEADER NOTIFICATION BADGE FIX
================================ */
/* Target ONLY badge inside bell icon */
header .bi-bell {
position: relative;
}
/* Override broken global badge styles */
header .bi-bell .badge {
width: 22px !important;
height: 22px !important;
min-width: 22px !important;
padding: 0 !important;
font-size: 12px !important;
line-height: 22px !important;
border-radius: 50% !important;
display: inline-flex !important;
align-items: center;
justify-content: center;
animation: none !important;
box-shadow: 0 0 0 2px #ffffff;
}
</style>
</head>
<body>
<div class="sidebar">
<div class="logo">
<img src="{{ asset('images/kent_logo2.png') }}" alt="Kent Logo">
<div class="word"><strong>KENT</strong><br /><small>International Pvt. Ltd.</small></div>
</div>
{{-- Dashboard (requires order.view) --}}
@can('order.view')
<a href="{{ route('admin.dashboard') }}" class="{{ request()->routeIs('admin.dashboard') ? 'active' : '' }}">
<i class="bi bi-house"></i> Dashboard
</a>
@endcan
{{-- Shipments --}}
@can('shipment.view')
<a href="{{ route('admin.shipments') }}" class="{{ request()->routeIs('admin.shipments') ? 'active' : '' }}">
<i class="bi bi-truck"></i> Shipments
</a>
@endcan
{{-- Invoice --}}
@can('invoice.view')
<a href="{{ route('admin.invoices.index') }}" class="{{ request()->routeIs('admin.invoices.index') ? 'active' : '' }}">
<i class="bi bi-receipt"></i> Invoice
</a>
@endcan
{{-- Customers --}}
@can('customer.view')
<a href="{{ route('admin.customers.index') }}" class="{{ request()->routeIs('admin.customers.index') ? 'active' : '' }}">
<i class="bi bi-people"></i> Customers
</a>
@endcan
{{-- Reports --}}
@can('report.view')
<a href="{{ route('admin.reports') }}" class="{{ request()->routeIs('admin.reports') ? 'active' : '' }}">
<i class="bi bi-graph-up"></i> Reports
</a>
@endcan
{{-- Chat Support (NO PERMISSION REQUIRED) --}}
<a href="{{ route('admin.chat_support') }}" class="{{ request()->routeIs('admin.chat_support') ? 'active' : '' }}">
<i class="bi bi-chat-dots"></i> Chat Support
</a>
{{-- Orders --}}
@can('orders.view')
<a href="{{ route('admin.orders') }}" class="{{ request()->routeIs('admin.orders') ? 'active' : '' }}">
<i class="bi bi-bag"></i> Orders
</a>
@endcan
{{-- Requests --}}
@can('request.view')
<a href="{{ route('admin.requests') }}" class="{{ request()->routeIs('admin.requests') ? 'active' : '' }}">
<i class="bi bi-envelope"></i> Requests
</a>
@endcan
<!-- {{-- Profile Update Requests --}}
@can('request.update_profile')
<a href="{{ route('admin.profile.requests') }}">
<i class="bi bi-person-lines-fill"></i> Profile Update Requests
</a>
@endcan -->
{{-- Staff (NO PERMISSION REQUIRED) --}}
<a href="{{ route('admin.staff.index') }}" class="{{ request()->routeIs('admin.staff.*') ? 'active' : '' }}">
<i class="bi bi-person-badge"></i> Staff
</a>
{{-- Account Section --}}
@can('account.view')
<a href="{{ route('admin.account') }}" class="{{ request()->routeIs('admin.account') ? 'active' : '' }}">
<i class="bi bi-gear"></i> Account
</a>
@endcan
{{-- Mark List --}}
@can('mark_list.view')
<a href="{{ route('admin.marklist.index') }}" class="{{ request()->routeIs('admin.marklist.index') ? 'active' : '' }}">
<i class="bi bi-list-check"></i> Mark List
</a>
@endcan
</div>
<div class="main-content">
<header>
<div class="header-left">
<button class="header-toggle" id="headerToggle">
<i class="bi bi-list"></i>
</button>
<h5 class="mb-0">@yield('page-title')</h5>
</div>
<div class="d-flex align-items-center gap-3">
<i class="bi bi-bell position-relative fs-4">
<span class="position-absolute top-0 start-100 translate-middle badge rounded-pill bg-danger">2</span>
</i>
<div class="dropdown">
<a href="#" class="d-flex align-items-center text-decoration-none dropdown-toggle" data-bs-toggle="dropdown">
<img src="https://i.pravatar.cc/40" class="rounded-circle me-2" width="35" height="35">
<span class="dropdown-user-profile-name">{{ Auth::guard('admin')->user()->name ?? 'User' }}</span>
</a>
<ul class="dropdown-menu dropdown-menu-end">
<li><a class="dropdown-item" href="{{ route('admin.profile') }}"><i class="bi bi-person-circle me-2"></i>Profile</a></li>
<li><hr class="dropdown-divider"></li>
<li>
<form method="POST" action="{{ route('admin.logout') }}">
@csrf
<button class="dropdown-item" type="submit"><i class="bi bi-box-arrow-right me-2"></i>Logout</button>
</form>
</li>
</ul>
</div>
</div>
</header>
<div class="content-wrapper">
@yield('content')
</div>
</div>
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/js/bootstrap.bundle.min.js"></script>
@vite(['resources/js/app.js'])
@yield('scripts') <!-- REQUIRED FOR CHAT TO WORK -->
<script>
document.addEventListener('DOMContentLoaded', function() {
const headerToggle = document.getElementById('headerToggle');
const sidebar = document.querySelector('.sidebar');
const mainContent = document.querySelector('.main-content');
// Function to toggle sidebar
function toggleSidebar() {
sidebar.classList.toggle('collapsed');
mainContent.classList.toggle('expanded');
}
// Header toggle button click event
if (headerToggle) {
headerToggle.addEventListener('click', toggleSidebar);
}
});
</script>
</body>
</html>