369 lines
24 KiB
PHP
369 lines
24 KiB
PHP
<!DOCTYPE html>
|
|
<html lang="nl" class="h-full bg-slate-50 text-slate-800 antialiased">
|
|
<head>
|
|
<meta charset="utf-8">
|
|
<meta name="viewport" content="width=device-width, initial-scale=1">
|
|
<title>@yield('title', 'Admin Dashboard | Jouwdriedee.nl')</title>
|
|
<link rel="icon" type="image/svg+xml" href="/images/logo-icon.svg">
|
|
|
|
<!-- Modern Typography: Plus Jakarta Sans -->
|
|
<link rel="preconnect" href="https://fonts.googleapis.com">
|
|
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
|
|
<link href="https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@300;400;500;600;700;800&display=swap" rel="stylesheet">
|
|
|
|
@vite(['resources/css/app.css', 'resources/js/app.js'])
|
|
|
|
<style>
|
|
body {
|
|
font-family: 'Plus Jakarta Sans', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
|
|
letter-spacing: -0.01em;
|
|
}
|
|
h1, h2, h3, h4, .font-heading {
|
|
font-family: 'Plus Jakarta Sans', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
|
|
letter-spacing: -0.025em;
|
|
}
|
|
</style>
|
|
</head>
|
|
<body class="min-h-full flex flex-col bg-slate-50/70 text-slate-800 selection:bg-slate-900 selection:text-white" x-data="{ mobileNav: false, catalogOpen: false, relationsOpen: false }">
|
|
|
|
<!-- Admin Header (Sleek, Minimalist, SaaS Style) -->
|
|
<header class="bg-white/85 backdrop-blur-md border-b border-slate-200/70 sticky top-0 z-30">
|
|
<div class="max-w-7xl mx-auto px-4 sm:px-6 lg:px-8">
|
|
<div class="flex items-center justify-between h-16 gap-4">
|
|
|
|
<!-- Brand / Logo (Always strictly shrink-0 so it never overlaps or wraps) -->
|
|
<div class="flex items-center space-x-3 shrink-0">
|
|
<a href="{{ route('admin.content.index') }}" class="flex items-center space-x-2 shrink-0 group">
|
|
<img src="/images/logo.svg" alt="Jouwdriedee.nl" class="h-6 w-auto shrink-0">
|
|
<span class="px-2 py-0.5 rounded-md bg-slate-100 text-slate-600 font-semibold text-[10px] tracking-wider uppercase shrink-0 whitespace-nowrap">Studio CMS</span>
|
|
</a>
|
|
</div>
|
|
|
|
<!-- Desktop Compact Nav Links with Grouped Dropdowns -->
|
|
@php
|
|
$draftBadgeCount = 0;
|
|
try {
|
|
if (\Illuminate\Support\Facades\Schema::hasTable('products')) {
|
|
$draftBadgeCount = \App\Models\Product::where('status', 'draft')->count();
|
|
}
|
|
} catch (\Throwable $e) {
|
|
$draftBadgeCount = 0;
|
|
}
|
|
|
|
$unreadCommCount = 0;
|
|
try {
|
|
if (\Illuminate\Support\Facades\Schema::hasTable('communications')) {
|
|
$unreadCommCount = \App\Models\Communication::where('status', 'new')->count();
|
|
}
|
|
} catch (\Throwable $e) {
|
|
$unreadCommCount = 0;
|
|
}
|
|
|
|
$isCatalogActive = request()->routeIs(['admin.products.*', 'admin.makerworld.*', 'admin.categories.*']);
|
|
$isRelationsActive = request()->routeIs(['admin.communications.*', 'admin.customers.*']);
|
|
@endphp
|
|
|
|
<nav class="hidden lg:flex items-center space-x-1.5 text-xs font-medium">
|
|
<!-- 1. Layout & Teksten -->
|
|
<a href="{{ route('admin.content.index') }}" class="px-3 py-1.5 rounded-lg transition flex items-center space-x-1.5 whitespace-nowrap {{ request()->routeIs('admin.content.*') ? 'bg-slate-900 text-white font-semibold shadow-2xs' : 'text-slate-600 hover:text-slate-900 hover:bg-slate-100' }}">
|
|
<i data-lucide="palette" class="w-3.5 h-3.5"></i>
|
|
<span>Layout & Teksten</span>
|
|
</a>
|
|
|
|
<!-- 2. Assortiment (Grouped Dropdown) -->
|
|
<div class="relative shrink-0" @click.outside="catalogOpen = false">
|
|
<button
|
|
type="button"
|
|
@click="catalogOpen = !catalogOpen; relationsOpen = false"
|
|
class="px-3 py-1.5 rounded-lg transition flex items-center space-x-1.5 cursor-pointer whitespace-nowrap {{ $isCatalogActive ? 'bg-slate-900 text-white font-semibold shadow-2xs' : 'text-slate-600 hover:text-slate-900 hover:bg-slate-100' }}"
|
|
>
|
|
<i data-lucide="box" class="w-3.5 h-3.5"></i>
|
|
<span>Assortiment</span>
|
|
@if($draftBadgeCount > 0)
|
|
<span class="px-1.5 py-0.2 rounded-full text-[10px] font-semibold {{ $isCatalogActive ? 'bg-white text-slate-900' : 'bg-slate-200 text-slate-800' }}">
|
|
{{ $draftBadgeCount }}
|
|
</span>
|
|
@endif
|
|
<i data-lucide="chevron-down" class="w-3 h-3 text-slate-400 transition-transform duration-200" :class="catalogOpen ? 'rotate-180' : ''"></i>
|
|
</button>
|
|
|
|
<!-- Dropdown Menu -->
|
|
<div
|
|
x-show="catalogOpen"
|
|
x-cloak
|
|
x-transition:enter="transition ease-out duration-100"
|
|
x-transition:enter-start="opacity-0 scale-95"
|
|
x-transition:enter-end="opacity-100 scale-100"
|
|
x-transition:leave="transition ease-in duration-75"
|
|
x-transition:leave-start="opacity-100 scale-100"
|
|
x-transition:leave-end="opacity-0 scale-95"
|
|
class="absolute left-0 mt-1.5 w-60 rounded-xl bg-white border border-slate-200/80 shadow-lg py-1.5 z-40 text-xs"
|
|
>
|
|
<a href="{{ route('admin.products.index') }}" class="px-3 py-2 flex items-center justify-between hover:bg-slate-50 transition {{ request()->routeIs('admin.products.*') ? 'bg-slate-50 text-slate-900 font-semibold' : 'text-slate-700' }}">
|
|
<div class="flex items-center space-x-2.5">
|
|
<i data-lucide="box" class="w-3.5 h-3.5 text-slate-400"></i>
|
|
<div>
|
|
<div class="font-medium text-slate-900">Producten</div>
|
|
<div class="text-[11px] text-slate-500">Actieve winkelartikelen</div>
|
|
</div>
|
|
</div>
|
|
</a>
|
|
|
|
<a href="{{ route('admin.makerworld.staging') }}" class="px-3 py-2 flex items-center justify-between hover:bg-slate-50 transition {{ request()->routeIs('admin.makerworld.staging*') ? 'bg-slate-50 text-slate-900 font-semibold' : 'text-slate-700' }}">
|
|
<div class="flex items-center space-x-2.5">
|
|
<i data-lucide="layers" class="w-3.5 h-3.5 text-slate-400"></i>
|
|
<div>
|
|
<div class="font-medium text-slate-900">Artikel Beheer</div>
|
|
<div class="text-[11px] text-slate-500">MakerWorld items beoordelen</div>
|
|
</div>
|
|
</div>
|
|
@if($draftBadgeCount > 0)
|
|
<span class="px-1.5 py-0.5 rounded-full text-[10px] font-semibold bg-amber-100 text-amber-800">
|
|
{{ $draftBadgeCount }}
|
|
</span>
|
|
@endif
|
|
</a>
|
|
|
|
<div class="my-1 border-t border-slate-100"></div>
|
|
|
|
<a href="{{ route('admin.categories.index') }}" class="px-3 py-2 flex items-center space-x-2.5 hover:bg-slate-50 transition {{ request()->routeIs('admin.categories.*') ? 'bg-slate-50 text-slate-900 font-semibold' : 'text-slate-700' }}">
|
|
<i data-lucide="folder-tree" class="w-3.5 h-3.5 text-slate-400"></i>
|
|
<div>
|
|
<div class="font-medium text-slate-900">Categorieën</div>
|
|
<div class="text-[11px] text-slate-500">Winkelindeling beheren</div>
|
|
</div>
|
|
</a>
|
|
|
|
<a href="{{ route('admin.makerworld.index') }}" class="px-3 py-2 flex items-center space-x-2.5 hover:bg-slate-50 transition {{ request()->routeIs('admin.makerworld.index*') ? 'bg-slate-50 text-slate-900 font-semibold' : 'text-slate-700' }}">
|
|
<i data-lucide="download-cloud" class="w-3.5 h-3.5 text-slate-400"></i>
|
|
<div>
|
|
<div class="font-medium text-slate-900">MakerWorld Sync</div>
|
|
<div class="text-[11px] text-slate-500">Collecties & automatische check</div>
|
|
</div>
|
|
</a>
|
|
</div>
|
|
</div>
|
|
|
|
<!-- 3. Bestellingen (Direct Link) -->
|
|
<a href="{{ route('admin.orders.index') }}" class="px-3 py-1.5 rounded-lg transition flex items-center space-x-1.5 whitespace-nowrap {{ request()->routeIs('admin.orders.*') ? 'bg-slate-900 text-white font-semibold shadow-2xs' : 'text-slate-600 hover:text-slate-900 hover:bg-slate-100' }}">
|
|
<i data-lucide="shopping-cart" class="w-3.5 h-3.5"></i>
|
|
<span>Bestellingen</span>
|
|
</a>
|
|
|
|
<!-- 4. Klanten & Communicatie (Grouped Dropdown) -->
|
|
<div class="relative shrink-0" @click.outside="relationsOpen = false">
|
|
<button
|
|
type="button"
|
|
@click="relationsOpen = !relationsOpen; catalogOpen = false"
|
|
class="px-3 py-1.5 rounded-lg transition flex items-center space-x-1.5 cursor-pointer whitespace-nowrap {{ $isRelationsActive ? 'bg-slate-900 text-white font-semibold shadow-2xs' : 'text-slate-600 hover:text-slate-900 hover:bg-slate-100' }}"
|
|
>
|
|
<i data-lucide="users" class="w-3.5 h-3.5"></i>
|
|
<span>Klanten & Communicatie</span>
|
|
@if($unreadCommCount > 0)
|
|
<span class="px-1.5 py-0.2 rounded-full text-[10px] font-bold {{ $isRelationsActive ? 'bg-white text-slate-900' : 'bg-sky-500 text-white animate-pulse' }}">
|
|
{{ $unreadCommCount }}
|
|
</span>
|
|
@endif
|
|
<i data-lucide="chevron-down" class="w-3 h-3 text-slate-400 transition-transform duration-200" :class="relationsOpen ? 'rotate-180' : ''"></i>
|
|
</button>
|
|
|
|
<!-- Dropdown Menu -->
|
|
<div
|
|
x-show="relationsOpen"
|
|
x-cloak
|
|
x-transition:enter="transition ease-out duration-100"
|
|
x-transition:enter-start="opacity-0 scale-95"
|
|
x-transition:enter-end="opacity-100 scale-100"
|
|
x-transition:leave="transition ease-in duration-75"
|
|
x-transition:leave-start="opacity-100 scale-100"
|
|
x-transition:leave-end="opacity-0 scale-95"
|
|
class="absolute left-0 mt-1.5 w-64 rounded-xl bg-white border border-slate-200/80 shadow-lg py-1.5 z-40 text-xs"
|
|
>
|
|
<a href="{{ route('admin.communications.index') }}" class="px-3 py-2 flex items-center justify-between hover:bg-slate-50 transition {{ request()->routeIs('admin.communications.*') ? 'bg-slate-50 text-slate-900 font-semibold' : 'text-slate-700' }}">
|
|
<div class="flex items-center space-x-2.5">
|
|
<i data-lucide="message-square" class="w-3.5 h-3.5 text-slate-400"></i>
|
|
<div>
|
|
<div class="font-medium text-slate-900">Communicatie & Vragen</div>
|
|
<div class="text-[11px] text-slate-500">Contactberichten & antwoorden</div>
|
|
</div>
|
|
</div>
|
|
@if($unreadCommCount > 0)
|
|
<span class="px-1.5 py-0.5 rounded-full text-[10px] font-bold bg-sky-500 text-white animate-pulse">
|
|
{{ $unreadCommCount }}
|
|
</span>
|
|
@endif
|
|
</a>
|
|
|
|
<div class="my-1 border-t border-slate-100"></div>
|
|
|
|
<a href="{{ route('admin.customers.index') }}" class="px-3 py-2 flex items-center space-x-2.5 hover:bg-slate-50 transition {{ request()->routeIs('admin.customers.*') ? 'bg-slate-50 text-slate-900 font-semibold' : 'text-slate-700' }}">
|
|
<i data-lucide="users" class="w-3.5 h-3.5 text-slate-400"></i>
|
|
<div>
|
|
<div class="font-medium text-slate-900">Klanten & Profielen</div>
|
|
<div class="text-[11px] text-slate-500">Geregistreerden & gastbestellers</div>
|
|
</div>
|
|
</a>
|
|
</div>
|
|
</div>
|
|
</nav>
|
|
|
|
<!-- Right Actions -->
|
|
<div class="flex items-center space-x-2 shrink-0">
|
|
@php
|
|
$isShopOffline = false;
|
|
try {
|
|
if (\Illuminate\Support\Facades\Schema::hasTable('settings')) {
|
|
$isShopOffline = \App\Models\Setting::get('shop_offline', '0') === '1';
|
|
}
|
|
} catch (\Throwable $e) {
|
|
$isShopOffline = false;
|
|
}
|
|
@endphp
|
|
|
|
<!-- Webshop Offline / Online Status Switcher (Compact) -->
|
|
<form action="{{ route('admin.toggle-offline') }}" method="POST" class="inline">
|
|
@csrf
|
|
@if($isShopOffline)
|
|
<button type="submit" class="px-2.5 py-1.5 rounded-lg bg-rose-500 hover:bg-rose-600 text-white text-xs font-semibold transition flex items-center space-x-1.5 shadow-2xs cursor-pointer" title="Klik om de webshop weer direct online te zetten">
|
|
<span class="w-1.5 h-1.5 rounded-full bg-white animate-pulse"></span>
|
|
<span>Offline</span>
|
|
</button>
|
|
@else
|
|
<button type="submit" class="px-2.5 py-1.5 rounded-lg bg-slate-50 hover:bg-slate-100 text-slate-700 text-xs font-medium transition flex items-center space-x-1.5 border border-slate-200/80 cursor-pointer" title="Klik om de webshop direct offline te zetten voor bezoekers">
|
|
<span class="w-1.5 h-1.5 rounded-full bg-emerald-500"></span>
|
|
<span class="hidden sm:inline">Live</span>
|
|
</button>
|
|
@endif
|
|
</form>
|
|
|
|
<a href="{{ route('home') }}" target="_blank" class="p-1.5 sm:px-2.5 sm:py-1.5 rounded-lg text-slate-600 hover:text-slate-900 hover:bg-slate-100 text-xs font-medium transition flex items-center space-x-1.5 border border-transparent hover:border-slate-200" title="Bekijk Live Webshop">
|
|
<span class="hidden sm:inline">Webshop</span>
|
|
<i data-lucide="external-link" class="w-3.5 h-3.5 text-slate-400"></i>
|
|
</a>
|
|
|
|
<!-- Mobile trigger (Shown on screens below lg) -->
|
|
<button @click="mobileNav = !mobileNav" type="button" class="lg:hidden p-1.5 rounded-lg text-slate-600 hover:bg-slate-100">
|
|
<i data-lucide="menu" class="w-5 h-5"></i>
|
|
</button>
|
|
</div>
|
|
|
|
</div>
|
|
</div>
|
|
|
|
<!-- Mobile Drawer (Clean, Grouped Sections) -->
|
|
<div x-show="mobileNav" x-cloak class="lg:hidden border-t border-slate-200/80 bg-white px-4 py-3 space-y-3 text-xs font-medium shadow-md">
|
|
<div>
|
|
<span class="text-[10px] font-semibold uppercase tracking-wider text-slate-400 px-3 block mb-1">Content & Layout</span>
|
|
<a href="{{ route('admin.content.index') }}" class="block px-3 py-1.5 rounded-lg {{ request()->routeIs('admin.content.*') ? 'bg-slate-100 text-slate-900 font-semibold' : 'text-slate-600 hover:bg-slate-50' }}">
|
|
Layout & Teksten
|
|
</a>
|
|
</div>
|
|
|
|
<div>
|
|
<span class="text-[10px] font-semibold uppercase tracking-wider text-slate-400 px-3 block mb-1">Assortiment</span>
|
|
<div class="space-y-0.5">
|
|
<a href="{{ route('admin.products.index') }}" class="block px-3 py-1.5 rounded-lg {{ request()->routeIs('admin.products.*') ? 'bg-slate-100 text-slate-900 font-semibold' : 'text-slate-600 hover:bg-slate-50' }}">
|
|
Producten
|
|
</a>
|
|
<a href="{{ route('admin.makerworld.staging') }}" class="flex items-center justify-between px-3 py-1.5 rounded-lg {{ request()->routeIs('admin.makerworld.staging*') ? 'bg-slate-100 text-slate-900 font-semibold' : 'text-slate-600 hover:bg-slate-50' }}">
|
|
<span>Artikel Beheer (Geïmporteerd)</span>
|
|
@if(($draftBadgeCount ?? 0) > 0)
|
|
<span class="px-1.5 py-0.5 rounded-full text-[10px] font-semibold bg-slate-200 text-slate-800">
|
|
{{ $draftBadgeCount }}
|
|
</span>
|
|
@endif
|
|
</a>
|
|
<a href="{{ route('admin.categories.index') }}" class="block px-3 py-1.5 rounded-lg {{ request()->routeIs('admin.categories.*') ? 'bg-slate-100 text-slate-900 font-semibold' : 'text-slate-600 hover:bg-slate-50' }}">
|
|
Categorieën
|
|
</a>
|
|
<a href="{{ route('admin.makerworld.index') }}" class="block px-3 py-1.5 rounded-lg {{ request()->routeIs('admin.makerworld.*') ? 'bg-slate-100 text-slate-900 font-semibold' : 'text-slate-600 hover:bg-slate-50' }}">
|
|
MakerWorld Sync
|
|
</a>
|
|
</div>
|
|
</div>
|
|
|
|
<div>
|
|
<span class="text-[10px] font-semibold uppercase tracking-wider text-slate-400 px-3 block mb-1">Verkoop & Klanten</span>
|
|
<div class="space-y-0.5">
|
|
<a href="{{ route('admin.orders.index') }}" class="block px-3 py-1.5 rounded-lg {{ request()->routeIs('admin.orders.*') ? 'bg-slate-100 text-slate-900 font-semibold' : 'text-slate-600 hover:bg-slate-50' }}">
|
|
Bestellingen
|
|
</a>
|
|
<a href="{{ route('admin.communications.index') }}" class="flex items-center justify-between px-3 py-1.5 rounded-lg {{ request()->routeIs('admin.communications.*') ? 'bg-slate-100 text-slate-900 font-semibold' : 'text-slate-600 hover:bg-slate-50' }}">
|
|
<span>Communicatie</span>
|
|
@if(($unreadCommCount ?? 0) > 0)
|
|
<span class="px-1.5 py-0.5 rounded-full text-[10px] font-bold bg-sky-500 text-white">
|
|
{{ $unreadCommCount }}
|
|
</span>
|
|
@endif
|
|
</a>
|
|
<a href="{{ route('admin.customers.index') }}" class="block px-3 py-1.5 rounded-lg {{ request()->routeIs('admin.customers.*') ? 'bg-slate-100 text-slate-900 font-semibold' : 'text-slate-600 hover:bg-slate-50' }}">
|
|
Klanten & Profielen
|
|
</a>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</header>
|
|
|
|
<!-- Offline Alert Banner -->
|
|
@if(!empty($isShopOffline))
|
|
<div class="bg-rose-500 text-white px-4 py-2.5 text-xs font-medium border-b border-rose-600 shadow-sm flex flex-col sm:flex-row items-center justify-between gap-3 sticky top-16 z-20">
|
|
<div class="flex items-center space-x-2">
|
|
<span class="w-2 h-2 rounded-full bg-white animate-pulse shrink-0"></span>
|
|
<span>De webshop staat momenteel <strong>OFFLINE</strong> voor bezoekers (rode onderhoudsbanner actief). Alleen jij als beheerder kunt de website bezoeken.</span>
|
|
</div>
|
|
<form action="{{ route('admin.toggle-offline') }}" method="POST" class="shrink-0">
|
|
@csrf
|
|
<button type="submit" class="px-3 py-1 bg-white hover:bg-slate-50 text-rose-700 font-semibold rounded-md text-xs transition shadow-2xs cursor-pointer flex items-center space-x-1.5">
|
|
<span>Zet Nu Weer Online</span>
|
|
</button>
|
|
</form>
|
|
</div>
|
|
@endif
|
|
|
|
<!-- Main Admin Container -->
|
|
<main class="flex-1 max-w-7xl w-full mx-auto px-4 sm:px-6 lg:px-8 py-8 sm:py-10">
|
|
|
|
<!-- Flash Alerts -->
|
|
@if(session('success'))
|
|
<div class="mb-6 p-4 rounded-xl bg-emerald-50/80 border border-emerald-200/60 text-emerald-800 text-xs font-medium flex items-center justify-between shadow-2xs">
|
|
<div class="flex items-center space-x-2.5">
|
|
<i data-lucide="check-circle" class="w-4 h-4 text-emerald-600 shrink-0"></i>
|
|
<span>{{ session('success') }}</span>
|
|
</div>
|
|
<a href="{{ route('home') }}" target="_blank" class="px-2.5 py-1 rounded-md bg-emerald-600 hover:bg-emerald-700 text-white font-medium text-[11px] transition shrink-0">
|
|
Bekijk Live Shop
|
|
</a>
|
|
</div>
|
|
@endif
|
|
|
|
@if(session('warning'))
|
|
<div class="mb-6 p-4 rounded-xl bg-amber-50/80 border border-amber-200/60 text-amber-800 text-xs font-medium flex items-center space-x-2.5 shadow-2xs">
|
|
<i data-lucide="alert-triangle" class="w-4 h-4 text-amber-600 shrink-0"></i>
|
|
<span>{{ session('warning') }}</span>
|
|
</div>
|
|
@endif
|
|
|
|
@if(session('info'))
|
|
<div class="mb-6 p-4 rounded-xl bg-blue-50/80 border border-blue-200/60 text-blue-800 text-xs font-medium flex items-center space-x-2.5 shadow-2xs">
|
|
<i data-lucide="info" class="w-4 h-4 text-blue-600 shrink-0"></i>
|
|
<span>{{ session('info') }}</span>
|
|
</div>
|
|
@endif
|
|
|
|
@if(session('error'))
|
|
<div class="mb-6 p-4 rounded-xl bg-rose-50/80 border border-rose-200/60 text-rose-800 text-xs font-medium flex items-center space-x-2.5 shadow-2xs">
|
|
<i data-lucide="alert-circle" class="w-4 h-4 text-rose-600 shrink-0"></i>
|
|
<span>{{ session('error') }}</span>
|
|
</div>
|
|
@endif
|
|
|
|
@yield('content')
|
|
</main>
|
|
|
|
<footer class="border-t border-slate-200/60 py-4 text-center text-[11px] text-slate-400 bg-white">
|
|
Jouwdriedee.nl Beheerpaneel • Direct gekoppeld aan live webshop
|
|
</footer>
|
|
|
|
</body>
|
|
</html>
|