166 lines
8.8 KiB
PHP
166 lines
8.8 KiB
PHP
<!DOCTYPE html>
|
|
<html lang="{{ str_replace('_', '-', app()->getLocale()) }}">
|
|
<head>
|
|
<meta charset="utf-8">
|
|
<meta name="viewport" content="width=device-width, initial-scale=1">
|
|
<meta name="csrf-token" content="{{ csrf_token() }}">
|
|
|
|
<title>@hasSection('title')@yield('title') — @endif{{ config('app.name', 'PreRegister') }}</title>
|
|
|
|
<link rel="preconnect" href="https://fonts.bunny.net">
|
|
<link href="https://fonts.bunny.net/css?family=figtree:400,500,600&display=swap" rel="stylesheet" />
|
|
|
|
@vite(['resources/css/app.css', 'resources/js/app.js'])
|
|
</head>
|
|
<body class="font-sans antialiased bg-slate-100 text-slate-900" x-data="{ sidebarOpen: false }">
|
|
@php
|
|
$adminFlashSuccess = session('status');
|
|
$adminFlashError = session('error');
|
|
$inlinePageFlash = request()->routeIs(['admin.pages.edit', 'admin.pages.create']);
|
|
$showSuccessToast = $adminFlashSuccess !== null && ! $inlinePageFlash;
|
|
@endphp
|
|
@if ($showSuccessToast || $adminFlashError !== null)
|
|
<div
|
|
class="pointer-events-none fixed bottom-4 right-4 z-[100] flex w-full max-w-sm flex-col gap-2 px-4 sm:px-0"
|
|
aria-live="polite"
|
|
>
|
|
@foreach (array_filter([
|
|
$showSuccessToast ? ['type' => 'success', 'message' => $adminFlashSuccess] : null,
|
|
$adminFlashError !== null ? ['type' => 'error', 'message' => $adminFlashError] : null,
|
|
]) as $toast)
|
|
<div
|
|
x-data="{ visible: true }"
|
|
x-show="visible"
|
|
x-transition:enter="transition ease-out duration-200"
|
|
x-transition:enter-start="translate-y-2 opacity-0"
|
|
x-transition:enter-end="translate-y-0 opacity-100"
|
|
x-transition:leave="transition ease-in duration-150"
|
|
x-transition:leave-start="translate-y-0 opacity-100"
|
|
x-transition:leave-end="translate-y-2 opacity-0"
|
|
x-init="setTimeout(() => visible = false, 6500)"
|
|
class="pointer-events-auto flex items-start gap-3 rounded-lg border px-4 py-3 text-sm shadow-lg {{ $toast['type'] === 'success' ? 'border-emerald-200 bg-emerald-50 text-emerald-900' : 'border-red-200 bg-red-50 text-red-900' }}"
|
|
role="{{ $toast['type'] === 'success' ? 'status' : 'alert' }}"
|
|
>
|
|
<p class="min-w-0 flex-1 leading-snug">{{ $toast['message'] }}</p>
|
|
<button
|
|
type="button"
|
|
class="shrink-0 rounded p-0.5 opacity-70 hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-indigo-500"
|
|
@click="visible = false"
|
|
aria-label="{{ __('Dismiss notification') }}"
|
|
>
|
|
<svg class="h-4 w-4" fill="none" stroke="currentColor" viewBox="0 0 24 24" aria-hidden="true">
|
|
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M6 18L18 6M6 6l12 12"/>
|
|
</svg>
|
|
</button>
|
|
</div>
|
|
@endforeach
|
|
</div>
|
|
@endif
|
|
{{-- Mobile overlay --}}
|
|
<div
|
|
x-show="sidebarOpen"
|
|
x-transition.opacity
|
|
class="fixed inset-0 z-40 bg-slate-900/60 lg:hidden"
|
|
style="display: none;"
|
|
@click="sidebarOpen = false"
|
|
aria-hidden="true"
|
|
></div>
|
|
|
|
<div class="min-h-screen lg:flex">
|
|
{{-- Sidebar --}}
|
|
<aside
|
|
class="fixed inset-y-0 left-0 z-50 flex w-64 flex-col border-r border-slate-800 bg-slate-900 shadow-xl transition-transform duration-200 lg:static lg:translate-x-0"
|
|
:class="sidebarOpen ? 'translate-x-0' : '-translate-x-full lg:translate-x-0'"
|
|
aria-label="{{ __('Main navigation') }}"
|
|
>
|
|
<div class="flex h-16 shrink-0 items-center justify-between border-b border-slate-800 px-4">
|
|
<a href="{{ route('admin.dashboard') }}" class="text-lg font-semibold tracking-tight text-white">
|
|
{{ config('app.name', 'PreRegister') }}
|
|
</a>
|
|
<button
|
|
type="button"
|
|
class="rounded-lg p-2 text-slate-400 hover:bg-slate-800 hover:text-white lg:hidden"
|
|
@click="sidebarOpen = false"
|
|
aria-label="{{ __('Close menu') }}"
|
|
>
|
|
<svg class="h-5 w-5" fill="none" stroke="currentColor" viewBox="0 0 24 24" aria-hidden="true">
|
|
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M6 18L18 6M6 6l12 12"/>
|
|
</svg>
|
|
</button>
|
|
</div>
|
|
|
|
<nav class="flex flex-1 flex-col gap-1 p-3">
|
|
<x-admin.sidebar-link
|
|
:href="route('admin.dashboard')"
|
|
:active="request()->routeIs('admin.dashboard')"
|
|
>
|
|
<svg class="h-5 w-5 shrink-0 opacity-70 group-hover:opacity-100" fill="none" stroke="currentColor" viewBox="0 0 24 24" aria-hidden="true">
|
|
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M4 6a2 2 0 012-2h2a2 2 0 012 2v2a2 2 0 01-2 2H6a2 2 0 01-2-2V6zM14 6a2 2 0 012-2h2a2 2 0 012 2v2a2 2 0 01-2 2h-2a2 2 0 01-2-2V6zM4 16a2 2 0 012-2h2a2 2 0 012 2v2a2 2 0 01-2 2H6a2 2 0 01-2-2v-2zM14 16a2 2 0 012-2h2a2 2 0 012 2v2a2 2 0 01-2 2h-2a2 2 0 01-2-2v-2z"/>
|
|
</svg>
|
|
{{ __('Dashboard') }}
|
|
</x-admin.sidebar-link>
|
|
|
|
<x-admin.sidebar-link
|
|
:href="route('admin.pages.index')"
|
|
:active="request()->routeIs('admin.pages.*')"
|
|
>
|
|
<svg class="h-5 w-5 shrink-0 opacity-70 group-hover:opacity-100" fill="none" stroke="currentColor" viewBox="0 0 24 24" aria-hidden="true">
|
|
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z"/>
|
|
</svg>
|
|
{{ __('Pages') }}
|
|
</x-admin.sidebar-link>
|
|
|
|
@if (auth()->user()->isSuperadmin())
|
|
<x-admin.sidebar-link
|
|
:href="route('admin.users.index')"
|
|
:active="request()->routeIs('admin.users.*')"
|
|
>
|
|
<svg class="h-5 w-5 shrink-0 opacity-70 group-hover:opacity-100" fill="none" stroke="currentColor" viewBox="0 0 24 24" aria-hidden="true">
|
|
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M12 4.354a4 4 0 110 5.292M15 21H3v-1a6 6 0 0112 0v1zm0 0h6v-1a6 6 0 00-9-5.197M13 7a4 4 0 11-8 0 4 4 0 018 0z"/>
|
|
</svg>
|
|
{{ __('Users') }}
|
|
</x-admin.sidebar-link>
|
|
@endif
|
|
</nav>
|
|
|
|
<div class="border-t border-slate-800 p-3">
|
|
<div class="mb-2 truncate px-3 text-xs text-slate-500">{{ auth()->user()->email }}</div>
|
|
<x-admin.sidebar-link :href="route('admin.profile.edit')" :active="request()->routeIs('admin.profile.*')" class="mb-1">
|
|
{{ __('Profile') }}
|
|
</x-admin.sidebar-link>
|
|
<form method="POST" action="{{ route('logout') }}">
|
|
@csrf
|
|
<button
|
|
type="submit"
|
|
class="flex w-full items-center gap-3 rounded-lg px-3 py-2 text-left text-sm font-medium text-slate-300 transition hover:bg-slate-800/80 hover:text-white"
|
|
>
|
|
{{ __('Log out') }}
|
|
</button>
|
|
</form>
|
|
</div>
|
|
</aside>
|
|
|
|
{{-- Main column --}}
|
|
<div class="flex min-w-0 flex-1 flex-col">
|
|
<header class="sticky top-0 z-30 flex h-16 items-center gap-4 border-b border-slate-200 bg-white px-4 shadow-sm lg:hidden">
|
|
<button
|
|
type="button"
|
|
class="rounded-lg p-2 text-slate-600 hover:bg-slate-100"
|
|
@click="sidebarOpen = true"
|
|
aria-label="{{ __('Open menu') }}"
|
|
>
|
|
<svg class="h-6 w-6" fill="none" stroke="currentColor" viewBox="0 0 24 24" aria-hidden="true">
|
|
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M4 6h16M4 12h16M4 18h16"/>
|
|
</svg>
|
|
</button>
|
|
<span class="truncate font-semibold text-slate-900">@yield('mobile_title', config('app.name', 'PreRegister'))</span>
|
|
</header>
|
|
|
|
<main class="flex-1 p-4 sm:p-6 lg:p-8">
|
|
@yield('content')
|
|
</main>
|
|
</div>
|
|
</div>
|
|
</body>
|
|
</html>
|