feat: add webshop offline maintenance mode with admin toggle and red maintenance screen
This commit is contained in:
@@ -76,6 +76,27 @@
|
||||
|
||||
<!-- Right Actions -->
|
||||
<div class="flex items-center space-x-3">
|
||||
@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-xl bg-rose-600 hover:bg-rose-500 text-white text-xs font-black transition flex items-center space-x-1.5 shadow-lg shadow-rose-600/30 animate-pulse cursor-pointer" title="Klik om de webshop weer direct online te zetten">
|
||||
<span class="w-2 h-2 rounded-full bg-white"></span>
|
||||
<span>Webshop: OFFLINE</span>
|
||||
</button>
|
||||
@else
|
||||
<button type="submit" class="px-2.5 sm:px-3 py-1.5 rounded-xl bg-slate-800 hover:bg-rose-950/40 text-slate-300 hover:text-rose-400 text-xs font-bold transition flex items-center space-x-1.5 border border-slate-700 cursor-pointer" title="Klik om de webshop direct offline te zetten voor bezoekers">
|
||||
<span class="w-2 h-2 rounded-full bg-emerald-400"></span>
|
||||
<span class="hidden sm:inline">Webshop: Online</span>
|
||||
<span class="text-[10px] text-slate-500 hover:text-rose-300">(Zet Offline)</span>
|
||||
</button>
|
||||
@endif
|
||||
</form>
|
||||
|
||||
<a href="{{ route('home') }}" target="_blank" class="px-3 py-1.5 rounded-xl bg-slate-800 hover:bg-slate-700 text-slate-200 text-xs font-bold transition flex items-center space-x-1.5 border border-slate-700">
|
||||
<span>Naar Webshop</span>
|
||||
<i data-lucide="external-link" class="w-3.5 h-3.5"></i>
|
||||
@@ -118,6 +139,24 @@
|
||||
</div>
|
||||
</header>
|
||||
|
||||
<!-- Prominent Offline Alert Banner -->
|
||||
@if($isShopOffline ?? (\App\Models\Setting::get('shop_offline', '0') === '1'))
|
||||
<div class="bg-gradient-to-r from-rose-700 via-rose-600 to-rose-700 text-white px-4 py-3 text-xs font-bold border-b-2 border-rose-800 shadow-xl 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.5">
|
||||
<span class="w-3 h-3 rounded-full bg-white animate-ping shrink-0"></span>
|
||||
<span class="px-2 py-0.5 rounded-md bg-white text-rose-800 font-black text-[10px] uppercase tracking-wider shrink-0">Offline Actief</span>
|
||||
<span>De webshop staat momenteel <strong>OFFLINE</strong> voor bezoekers. Bezoekers zien de grote rode onderhoudsbanner. 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-4 py-1.5 bg-white hover:bg-slate-100 text-rose-700 font-black rounded-xl text-xs transition shadow-md cursor-pointer flex items-center space-x-1.5">
|
||||
<span class="w-2 h-2 rounded-full bg-emerald-500"></span>
|
||||
<span>Zet Webshop 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-6 sm:py-8">
|
||||
|
||||
|
||||
@@ -25,6 +25,27 @@
|
||||
</head>
|
||||
<body class="min-h-full flex flex-col bg-[#FBFBFA] text-slate-800 selection:bg-amber-300 selection:text-slate-900" x-data="{ mobileMenuOpen: false }">
|
||||
|
||||
<!-- Admin Offline Preview Notice -->
|
||||
@if(\App\Models\Setting::get('shop_offline', '0') === '1' && auth()->check() && auth()->user()->isAdmin())
|
||||
<div class="bg-rose-600 text-white px-4 py-2 text-xs font-black flex flex-col sm:flex-row items-center justify-between sticky top-0 z-50 border-b border-rose-700 shadow-lg gap-2">
|
||||
<div class="flex items-center space-x-2">
|
||||
<span class="w-2.5 h-2.5 rounded-full bg-white animate-pulse"></span>
|
||||
<span>⚠️ OFFLINE BEHEERDERS-PREVIEW: De webshop staat momenteel OFFLINE voor gewone bezoekers. Alleen jij als beheerder ziet deze pagina.</span>
|
||||
</div>
|
||||
<div class="flex items-center space-x-2">
|
||||
<a href="{{ route('admin.content.index') }}" class="px-2.5 py-1 rounded-lg bg-rose-700 hover:bg-rose-800 text-white text-[11px] font-bold transition">
|
||||
Naar Beheer
|
||||
</a>
|
||||
<form action="{{ route('admin.toggle-offline') }}" method="POST" class="inline">
|
||||
@csrf
|
||||
<button type="submit" class="px-3 py-1 rounded-lg bg-white text-rose-700 hover:bg-rose-50 text-[11px] font-black shadow transition">
|
||||
Zet Nu Weer Online
|
||||
</button>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
@endif
|
||||
|
||||
<!-- Top Announcement Bar (Inschakelbaar en bewerkbaar via Admin) -->
|
||||
@if(setting('announcement_enabled', '1') == '1')
|
||||
<div class="bg-slate-900 text-white text-xs py-2 px-3 sm:px-4 font-bold border-b border-slate-800">
|
||||
|
||||
Reference in New Issue
Block a user