Files
jouwdriedee/resources/views/layouts/admin.blade.php
T

225 lines
15 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 }">
<!-- 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">
<!-- Brand / Logo -->
<div class="flex items-center space-x-6">
<a href="{{ route('admin.content.index') }}" class="flex items-center space-x-2.5 group">
<img src="/images/logo.svg" alt="Jouwdriedee.nl" class="h-7 w-auto">
<span class="px-2 py-0.5 rounded-md bg-slate-100 text-slate-600 font-medium text-[11px] tracking-wide">Studio CMS</span>
</a>
<!-- Desktop Nav Links -->
<nav class="hidden md:flex items-center space-x-1 text-xs font-medium">
<a href="{{ route('admin.content.index') }}" class="px-3 py-1.5 rounded-lg transition flex items-center space-x-1.5 {{ request()->routeIs('admin.content.*') ? 'bg-slate-900 text-white font-semibold' : '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>
<a href="{{ route('admin.products.index') }}" class="px-3 py-1.5 rounded-lg transition flex items-center space-x-1.5 {{ request()->routeIs('admin.products.*') ? 'bg-slate-900 text-white font-semibold' : 'text-slate-600 hover:text-slate-900 hover:bg-slate-100' }}">
<i data-lucide="box" class="w-3.5 h-3.5"></i>
<span>Producten</span>
</a>
@php
$draftBadgeCount = \App\Models\Product::where('status', 'draft')->count();
@endphp
<a href="{{ route('admin.makerworld.staging') }}" class="px-3 py-1.5 rounded-lg transition flex items-center space-x-1.5 {{ request()->routeIs('admin.makerworld.staging*') ? 'bg-slate-900 text-white font-semibold' : 'text-slate-600 hover:text-slate-900 hover:bg-slate-100' }}">
<i data-lucide="layers" class="w-3.5 h-3.5"></i>
<span>Artikel Beheer</span>
@if($draftBadgeCount > 0)
<span class="ml-1 px-1.5 py-0.2 rounded-full text-[10px] font-semibold {{ request()->routeIs('admin.makerworld.staging*') ? 'bg-white text-slate-900' : 'bg-slate-200 text-slate-800' }}">
{{ $draftBadgeCount }}
</span>
@endif
</a>
<a href="{{ route('admin.categories.index') }}" class="px-3 py-1.5 rounded-lg transition flex items-center space-x-1.5 {{ request()->routeIs('admin.categories.*') ? 'bg-slate-900 text-white font-semibold' : 'text-slate-600 hover:text-slate-900 hover:bg-slate-100' }}">
<i data-lucide="folder-tree" class="w-3.5 h-3.5"></i>
<span>Categorieën</span>
</a>
<a href="{{ route('admin.orders.index') }}" class="px-3 py-1.5 rounded-lg transition flex items-center space-x-1.5 {{ request()->routeIs('admin.orders.*') ? 'bg-slate-900 text-white font-semibold' : '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>
@php
$unreadCommCount = \App\Models\Communication::where('status', 'new')->count();
@endphp
<a href="{{ route('admin.communications.index') }}" class="px-3 py-1.5 rounded-lg transition flex items-center space-x-1.5 {{ request()->routeIs('admin.communications.*') ? 'bg-slate-900 text-white font-semibold' : 'text-slate-600 hover:text-slate-900 hover:bg-slate-100' }}">
<i data-lucide="message-square" class="w-3.5 h-3.5"></i>
<span>Communicatie</span>
@if($unreadCommCount > 0)
<span class="ml-1 px-1.5 py-0.2 rounded-full text-[10px] font-bold {{ request()->routeIs('admin.communications.*') ? 'bg-white text-slate-900' : 'bg-sky-500 text-white animate-pulse' }}">
{{ $unreadCommCount }}
</span>
@endif
</a>
<a href="{{ route('admin.customers.index') }}" class="px-3 py-1.5 rounded-lg transition flex items-center space-x-1.5 {{ request()->routeIs('admin.customers.*') ? 'bg-slate-900 text-white font-semibold' : '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</span>
</a>
<a href="{{ route('admin.makerworld.index') }}" class="px-3 py-1.5 rounded-lg transition flex items-center space-x-1.5 {{ request()->routeIs('admin.makerworld.index*') ? 'bg-slate-900 text-white font-semibold' : 'text-slate-600 hover:text-slate-900 hover:bg-slate-100' }}">
<i data-lucide="download-cloud" class="w-3.5 h-3.5"></i>
<span>MakerWorld Sync</span>
</a>
</nav>
</div>
<!-- Right Actions -->
<div class="flex items-center space-x-2.5">
@php
$isShopOffline = \App\Models\Setting::get('shop_offline', '0') === '1';
@endphp
<!-- Webshop Offline / Online Status Switcher -->
<form action="{{ route('admin.toggle-offline') }}" method="POST" class="inline">
@csrf
@if($isShopOffline)
<button type="submit" class="px-3 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>Webshop: Offline</span>
</button>
@else
<button type="submit" class="px-2.5 sm:px-3 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">Webshop: Live</span>
<span class="text-[10px] text-slate-400">(Offline zetten)</span>
</button>
@endif
</form>
<a href="{{ route('home') }}" target="_blank" class="px-3 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">
<span>Webshop</span>
<i data-lucide="external-link" class="w-3.5 h-3.5 text-slate-400"></i>
</a>
<!-- Mobile trigger -->
<button @click="mobileNav = !mobileNav" type="button" class="md: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 -->
<div x-show="mobileNav" x-cloak class="md:hidden border-t border-slate-200/80 bg-white px-4 py-3 space-y-1 text-xs font-medium shadow-md">
<a href="{{ route('admin.content.index') }}" class="block px-3 py-2 rounded-lg {{ request()->routeIs('admin.content.*') ? 'bg-slate-100 text-slate-900 font-semibold' : 'text-slate-600 hover:bg-slate-50' }}">
Layout & Teksten
</a>
<a href="{{ route('admin.products.index') }}" class="block px-3 py-2 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="block px-3 py-2 rounded-lg {{ request()->routeIs('admin.makerworld.staging*') ? 'bg-slate-100 text-slate-900 font-semibold' : 'text-slate-600 hover:bg-slate-50' }}">
Artikel Beheer (Geïmporteerd)
@if(($draftBadgeCount ?? 0) > 0)
<span class="ml-2 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-2 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.orders.index') }}" class="block px-3 py-2 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="block px-3 py-2 rounded-lg {{ request()->routeIs('admin.communications.*') ? 'bg-slate-100 text-slate-900 font-semibold' : 'text-slate-600 hover:bg-slate-50' }}">
Communicatie
@if(($unreadCommCount ?? 0) > 0)
<span class="ml-2 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-2 rounded-lg {{ request()->routeIs('admin.customers.*') ? 'bg-slate-100 text-slate-900 font-semibold' : 'text-slate-600 hover:bg-slate-50' }}">
Klanten &amp; Profielen
</a>
<a href="{{ route('admin.makerworld.index') }}" class="block px-3 py-2 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>
</header>
<!-- Offline Alert Banner -->
@if($isShopOffline ?? (\App\Models\Setting::get('shop_offline', '0') === '1'))
<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('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 &bull; Direct gekoppeld aan live webshop
</footer>
</body>
</html>