Files

176 lines
12 KiB
PHP
Executable File

@props([
'title' => null,
])
<!DOCTYPE html>
<html lang="{{ str_replace('_', '-', app()->getLocale()) }}">
<head>
@include('partials.head')
@if(!empty($title))
<title>{{ $title }} · {{ config('app.name', 'Laravel') }}</title>
@endif
</head>
<body class="hd-app-body">
@php
$user = auth()->user();
$isAdmin = $user !== null && (
(bool) ($user->helpdesk_admin ?? false)
|| (method_exists($user, 'isHelpdeskAdmin') && $user->isHelpdeskAdmin())
);
$roleLabel = $isAdmin ? 'Administrator' : ((method_exists($user, 'isHelpdeskAgent') && $user->isHelpdeskAgent()) || (bool) ($user->helpdesk_agent ?? false) ? 'Agent' : 'User');
@endphp
<div class="hd-app-shell" data-hd-shell>
<header class="hd-topbar">
<div class="hd-topbar-brand">
<button class="hd-icon-button hd-mobile-menu-button" type="button" data-hd-sidebar-toggle aria-label="Toggle navigation"><i class="fa-solid fa-bars"></i></button>
<a href="{{ route('dashboard') }}" wire:navigate class="hd-brand-mark" aria-label="{{ config('app.name', 'Laravel') }}">
<img
src="{{ asset('site-icon-64.png') }}"
alt=""
class="hd-brand-icon"
onerror="this.onerror=null;this.src='{{ asset('favicon.ico') }}';"
>
</a>
<a href="{{ route('dashboard') }}" wire:navigate class="hd-brand-name">{{ config('app.name', 'Laravel') }}</a>
</div>
<div class="hd-topbar-main">
@if(Route::has('helpdesk.tickets.index'))
<form method="GET" action="{{ route('helpdesk.tickets.index') }}" class="hd-top-search">
<svg class="hd-svg-icon" viewBox="0 0 24 24" aria-hidden="true"><path d="M10.5 3a7.5 7.5 0 1 0 4.7 13.3L20.9 22l1.1-1.1-5.7-5.7A7.5 7.5 0 0 0 10.5 3zm0 2a5.5 5.5 0 1 1 0 11 5.5 5.5 0 0 1 0-11z"/></svg><input name="search" placeholder="Search tickets" aria-label="Search tickets">
</form>
@endif
<div class="hd-topbar-spacer"></div>
<details class="hd-account-menu">
<summary class="hd-account-button">
<span class="hd-user-avatar hd-user-avatar--gravatar">
<span class="hd-user-avatar-fallback">{{ $user->initials() }}</span>
<img
src="{{ $user->gravatarUrl(160) }}"
alt="{{ $user->name }}"
loading="lazy"
referrerpolicy="no-referrer"
onerror="this.style.display='none'"
>
</span>
<span class="hd-account-copy">
<strong>{{ $user->name }}</strong>
<small>{{ $roleLabel }}</small>
</span>
<i class="fa-solid fa-chevron-down hd-account-chevron"></i>
</summary>
<div class="hd-account-dropdown" role="menu">
<div class="hd-account-dropdown-user">
<span class="hd-user-avatar hd-user-avatar--gravatar hd-user-avatar--large">
<span class="hd-user-avatar-fallback">{{ $user->initials() }}</span>
<img
src="{{ $user->gravatarUrl(160) }}"
alt="{{ $user->name }}"
loading="lazy"
referrerpolicy="no-referrer"
onerror="this.style.display='none'"
>
</span>
<div class="hd-account-dropdown-copy">
<strong>{{ $user->name }}</strong>
<span>{{ $user->email }}</span>
<small>{{ $roleLabel }}</small>
</div>
</div>
<div class="hd-account-dropdown-divider"></div>
<nav class="hd-account-dropdown-nav" aria-label="Account">
@if(Route::has('profile.edit'))
<a href="{{ route('profile.edit') }}" wire:navigate role="menuitem">
<i class="fa-regular fa-user"></i>
<span>Profile</span>
</a>
@endif
@if(Route::has('helpdesk.settings'))
<a href="{{ route('helpdesk.settings') }}" wire:navigate role="menuitem">
<svg class="hd-svg-icon" viewBox="0 0 24 24" aria-hidden="true"><path d="M10.7 2h2.6l.6 2.3c.5.2 1 .5 1.5.9l2.3-.7 1.3 2.3-1.7 1.6c.1.5.2 1.1.2 1.6s-.1 1.1-.2 1.6l1.7 1.6-1.3 2.3-2.3-.7c-.5.4-1 .7-1.5.9l-.6 2.3h-2.6l-.6-2.3c-.5-.2-1-.5-1.5-.9l-2.3.7L5 13.2l1.7-1.6A6 6 0 0 1 6.5 10c0-.5.1-1.1.2-1.6L5 6.8l1.3-2.3 2.3.7c.5-.4 1-.7 1.5-.9L10.7 2zM12 7a3 3 0 1 0 0 6 3 3 0 0 0 0-6z"/></svg>
<span>Helpdesk Settings</span>
</a>
@endif
@if($isAdmin)
<a href="{{ url('/admin/users') }}" wire:navigate role="menuitem">
<svg class="hd-svg-icon" viewBox="0 0 24 24" aria-hidden="true"><path d="M9 11a4 4 0 1 0 0-8 4 4 0 0 0 0 8zm6-1a3 3 0 1 0 0-6 3 3 0 0 0 0 6zM2 20c0-4 3-7 7-7s7 3 7 7H2zm13.5-6.3c3.6.3 6.5 2.8 6.5 6.3h-4c0-2.4-.9-4.6-2.5-6.3z"/></svg>
<span>User Management</span>
</a>
@endif
</nav>
<div class="hd-account-dropdown-divider"></div>
<form method="POST" action="{{ route('logout') }}">
@csrf
<button class="hd-account-logout" type="submit" role="menuitem">
<i class="fa-solid fa-arrow-right-from-bracket"></i>
<span>Log out</span>
</button>
</form>
</div>
</details>
</div>
</header>
<aside class="hd-shell-sidebar" data-hd-sidebar>
<nav class="hd-shell-nav" aria-label="Primary navigation">
<div class="hd-nav-section">
<div class="hd-nav-heading">Platform</div>
<a
class="hd-nav-link hd-nav-link--dashboard {{ request()->routeIs('dashboard') ? 'is-active' : '' }}"
href="{{ route('dashboard') }}"
wire:navigate
>
<svg class="hd-svg-icon" viewBox="0 0 24 24" aria-hidden="true"><path d="M12 3 2.5 11h2.2v9h5.6v-5.5h3.4V20h5.6v-9h2.2L12 3z"/></svg>
<span>Dashboard</span>
</a>
</div>
<div class="hd-nav-section"><div class="hd-nav-heading">Helpdesk</div>
@if(Route::has('helpdesk.tickets.index'))<a class="hd-nav-link hd-nav-link--tickets {{ request()->routeIs('helpdesk.tickets.index', 'helpdesk.tickets.create', 'helpdesk.tickets.show', 'helpdesk.tickets.edit') ? 'is-active' : '' }}" href="{{ route('helpdesk.tickets.index') }}" wire:navigate><svg class="hd-svg-icon" viewBox="0 0 24 24" aria-hidden="true"><path d="M3 6.5h18v4a2 2 0 0 0 0 4v4H3v-4a2 2 0 0 0 0-4v-4zm7 2v8h1.5v-8H10z"/></svg><span>Tickets</span></a>@endif
@if(Route::has('helpdesk.tickets.archived'))<a class="hd-nav-link {{ request()->routeIs('helpdesk.tickets.archived') ? 'is-active' : '' }}" style="--hd-nav-accent:#f59e0b;--hd-nav-accent-rgb:245,158,11" href="{{ route('helpdesk.tickets.archived') }}" wire:navigate><svg class="hd-svg-icon" viewBox="0 0 24 24" aria-hidden="true"><path d="M3 4h18v4H3V4zm1 5h16v11H4V9zm5 3v2h6v-2H9z"/></svg><span>Archive</span></a>@endif
@if(Route::has('helpdesk.kanban'))<a class="hd-nav-link hd-nav-link--kanban {{ request()->routeIs('helpdesk.kanban') ? 'is-active' : '' }}" href="{{ route('helpdesk.kanban') }}" wire:navigate><svg class="hd-svg-icon" viewBox="0 0 24 24" aria-hidden="true"><path d="M3 4h18v16H3V4zm2 2v12h6V6H5zm8 0v12h6V6h-6z"/></svg><span>Kanban</span></a>@endif
@if(Route::has('helpdesk.settings'))<a class="hd-nav-link hd-nav-link--settings {{ request()->routeIs('helpdesk.settings*') ? 'is-active' : '' }}" href="{{ route('helpdesk.settings') }}" wire:navigate><svg class="hd-svg-icon" viewBox="0 0 24 24" aria-hidden="true"><path d="M10.7 2h2.6l.6 2.3c.5.2 1 .5 1.5.9l2.3-.7 1.3 2.3-1.7 1.6c.1.5.2 1.1.2 1.6s-.1 1.1-.2 1.6l1.7 1.6-1.3 2.3-2.3-.7c-.5.4-1 .7-1.5.9l-.6 2.3h-2.6l-.6-2.3c-.5-.2-1-.5-1.5-.9l-2.3.7L5 13.2l1.7-1.6A6 6 0 0 1 6.5 10c0-.5.1-1.1.2-1.6L5 6.8l1.3-2.3 2.3.7c.5-.4 1-.7 1.5-.9L10.7 2zM12 7a3 3 0 1 0 0 6 3 3 0 0 0 0-6z"/></svg><span>Settings</span></a>@endif
</div>
@if(config('helpdesk.legacy.enabled', false) && Route::has('helpdesk.legacy.tickets'))
<div class="hd-nav-section"><div class="hd-nav-heading">Legacy System</div>
<a class="hd-nav-link {{ request()->routeIs('helpdesk.legacy.tickets*') ? 'is-active' : '' }}" style="--hd-nav-accent:#64748b;--hd-nav-accent-rgb:100,116,139" href="{{ route('helpdesk.legacy.tickets') }}" wire:navigate><i class="fa-solid fa-clock-rotate-left" aria-hidden="true"></i><span>Legacy Tickets</span></a>
<a class="hd-nav-link {{ request()->routeIs('helpdesk.legacy.categories') ? 'is-active' : '' }}" style="--hd-nav-accent:#64748b;--hd-nav-accent-rgb:100,116,139" href="{{ route('helpdesk.legacy.categories') }}" wire:navigate><i class="fa-solid fa-folder-tree" aria-hidden="true"></i><span>Legacy Categories</span></a>
</div>
@endif
@if(Route::has('documentation.index') || Route::has('documentation.documents.index'))
<div class="hd-nav-section"><div class="hd-nav-heading">Documentation</div>
<a class="hd-nav-link hd-nav-link--documents {{ request()->routeIs('documentation.documents.*') || request()->routeIs('documentation.index') ? 'is-active' : '' }}" href="{{ Route::has('documentation.documents.index') ? route('documentation.documents.index') : route('documentation.index') }}" wire:navigate><svg class="hd-svg-icon" viewBox="0 0 24 24" aria-hidden="true"><path d="M6 2h8l4 4v16H6V2zm7 1.8V7h3.2L13 3.8zM9 11v1.5h6V11H9zm0 3.5V16h6v-1.5H9z"/></svg><span>Documents</span></a>
@if(Route::has('documentation.categories.index'))<a class="hd-nav-link hd-nav-link--categories {{ request()->routeIs('documentation.categories.*') ? 'is-active' : '' }}" href="{{ route('documentation.categories.index') }}" wire:navigate><svg class="hd-svg-icon" viewBox="0 0 24 24" aria-hidden="true"><path d="M2.5 5h7l2 2h10v12h-19V5z"/></svg><span>Categories</span></a>@endif
</div>
@endif
@if($isAdmin && Route::has('user-management.index'))
<div class="hd-nav-section"><div class="hd-nav-heading">Users</div>
<a class="hd-nav-link hd-nav-link--users {{ request()->routeIs('user-management.index') || request()->routeIs('user-management.create') || request()->routeIs('user-management.edit') ? 'is-active' : '' }}" href="{{ route('user-management.index') }}" wire:navigate><svg class="hd-svg-icon" viewBox="0 0 24 24" aria-hidden="true"><path d="M9 11a4 4 0 1 0 0-8 4 4 0 0 0 0 8zm6-1a3 3 0 1 0 0-6 3 3 0 0 0 0 6zM2 20c0-4 3-7 7-7s7 3 7 7H2zm13.5-6.3c3.6.3 6.5 2.8 6.5 6.3h-4c0-2.4-.9-4.6-2.5-6.3z"/></svg><span>Users</span></a>
<a class="hd-nav-link hd-nav-link--roles {{ request()->routeIs('user-management.roles') ? 'is-active' : '' }}" href="{{ route('user-management.roles') }}" wire:navigate><svg class="hd-svg-icon" viewBox="0 0 24 24" aria-hidden="true"><path d="M12 2 4 5v6c0 5.1 3.4 9.4 8 11 4.6-1.6 8-5.9 8-11V5l-8-3zm0 3v14.8C8.7 18.3 6 14.9 6 11V6.4L12 4.2V5z"/></svg><span>Roles & Permissions</span></a>
</div>
@endif
</nav>
<div class="hd-sidebar-resizer" data-hd-sidebar-resizer title="Drag to resize sidebar"><span></span></div>
</aside>
<button type="button" class="hd-sidebar-backdrop" data-hd-sidebar-toggle aria-label="Close navigation"></button>
<main class="hd-shell-main">{{ $slot }}</main>
</div>
@persist('toast')<flux:toast.group><flux:toast /></flux:toast.group>@endpersist
@fluxScripts
</body>
</html>