206 lines
12 KiB
PHP
Executable File
206 lines
12 KiB
PHP
Executable File
@php
|
|
$title = $title ?? null;
|
|
@endphp
|
|
|
|
<!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">
|
|
<i class="fa-solid fa-gear" aria-hidden="true"></i>
|
|
<span>Helpdesk Settings</span>
|
|
</a>
|
|
@endif
|
|
|
|
@if($isAdmin)
|
|
<a href="{{ url('/admin/users') }}" wire:navigate role="menuitem">
|
|
<i class="fa-solid fa-users" aria-hidden="true"></i>
|
|
<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
|
|
>
|
|
<i class="fa-solid fa-gauge-high" aria-hidden="true"></i>
|
|
<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><i class="fa-solid fa-ticket" aria-hidden="true"></i><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><i class="fa-solid fa-box-archive" aria-hidden="true"></i><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><i class="fa-solid fa-table-columns" aria-hidden="true"></i><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><i class="fa-solid fa-gear" aria-hidden="true"></i><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>
|
|
|
|
<a
|
|
class="hd-nav-link"
|
|
style="--hd-nav-accent:#64748b;--hd-nav-accent-rgb:100,116,139"
|
|
href="https://helpdesk.old.mpba.dev"
|
|
target="_blank"
|
|
rel="noopener noreferrer"
|
|
>
|
|
<i class="fa-solid fa-arrow-up-right-from-square" aria-hidden="true"></i>
|
|
<span>Old Helpdesk</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><i class="fa-solid fa-file-lines" aria-hidden="true"></i><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><i class="fa-solid fa-folder" aria-hidden="true"></i><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><i class="fa-solid fa-users" aria-hidden="true"></i><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><i class="fa-solid fa-shield-halved" aria-hidden="true"></i><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>
|