structure updates

This commit is contained in:
Mark Gregory
2026-08-26 11:09:27 +01:00
parent 7fcef01be4
commit 8404c6e40f
13 changed files with 843 additions and 758 deletions
@@ -15,17 +15,24 @@
<p class="mt-1 max-w-3xl text-xs font-medium leading-5 text-blue-100/90 sm:text-sm">{{ $description }}</p>
</div>
<span class="inline-flex h-8 w-8 shrink-0 items-center justify-center rounded-xl border border-white/10 bg-white/10 text-blue-100 shadow-inner">
<i class="fa-solid fa-sliders text-xs" aria-hidden="true"></i>
</span>
<div class="flex shrink-0 items-center gap-2">
@isset($actions)
{{ $actions }}
@endisset
<span class="inline-flex h-8 w-8 shrink-0 items-center justify-center rounded-xl border border-white/10 bg-white/10 text-blue-100 shadow-inner">
<i class="fa-solid fa-sliders text-xs" aria-hidden="true"></i>
</span>
</div>
</div>
</div>
<div class="border-b border-zinc-200 bg-zinc-50 px-3 py-3 dark:border-zinc-800 dark:bg-zinc-950/45 sm:px-4">
<div class="mx-auto max-w-7xl rounded-xl border border-zinc-200 bg-white p-3 shadow-sm dark:border-zinc-700 dark:bg-zinc-900/90 sm:p-4 [&_input:not([type='checkbox']):not([type='radio']):not([type='color'])]:min-h-9 [&_textarea]:min-h-20 [&_textarea]:leading-6">
{{ $form }}
@isset($form)
<div class="border-b border-zinc-200 bg-zinc-50 px-3 py-3 dark:border-zinc-800 dark:bg-zinc-950/45 sm:px-4">
<div class="mx-auto max-w-7xl rounded-xl border border-zinc-200 bg-white p-3 shadow-sm dark:border-zinc-700 dark:bg-zinc-900/90 sm:p-4 [&_input:not([type='checkbox']):not([type='radio']):not([type='color'])]:min-h-9 [&_textarea]:min-h-20 [&_textarea]:leading-6">
{{ $form }}
</div>
</div>
</div>
@endisset
<div class="bg-white dark:bg-zinc-900">
{{ $slot }}
@@ -223,73 +223,114 @@
@if ($section === 'teams')
<x-helpdesk.settings-section title="Teams"
description="Create support teams, assign users and organise projects.">
<x-slot:form>
<form wire:submit.prevent="saveTeam" class="grid gap-3 xl:grid-cols-12">
<div class="xl:col-span-3">
</div>
<div class="xl:col-span-3">
<flux:input wire:model="teamForm.name" label="Name" />
</div>
<div class="xl:col-span-3">
<flux:input wire:model="teamForm.slug" label="Slug" placeholder="auto-generated" />
</div>
<x-helpdesk.colour-select class="xl:col-span-12" model="teamForm.color" label="Badge colour" :options="$colourOptions" />
<div class="xl:col-span-12">
<flux:textarea wire:model="teamForm.description" label="Description" rows="3" />
</div>
<div class="xl:col-span-12">
<div class="rounded-xl border border-zinc-700/80 bg-zinc-950/35 p-4">
<div class="mb-3 flex flex-wrap items-center justify-between gap-2">
<div>
<div class="text-sm font-semibold text-zinc-100">Team members</div>
<div class="mt-0.5 text-xs text-zinc-500">Select one or more users to assign to this team.</div>
</div>
<div class="rounded-full bg-blue-500/10 px-2.5 py-1 text-xs font-semibold text-blue-300">
{{ count($teamForm['user_ids'] ?? []) }} selected
</div>
</div>
<x-slot:actions>
<flux:button
size="sm"
type="button"
wire:click="openCreateTeamModal"
variant="primary"
class="!h-9 !rounded-lg !px-3 !text-xs !font-semibold !bg-green-600 !text-white hover:!bg-green-700 focus:!ring-green-400/60"
>
<i class="fa-solid fa-plus mr-1" aria-hidden="true"></i>
Create team
</flux:button>
</x-slot:actions>
<div class="grid gap-2 sm:grid-cols-2 xl:grid-cols-3">
@forelse ($teamUsers as $teamUser)
<label class="flex cursor-pointer items-center gap-3 rounded-lg border border-zinc-700 bg-zinc-900/60 p-3 transition hover:border-blue-500/60 hover:bg-zinc-900">
<input
type="checkbox"
wire:model="teamForm.user_ids"
value="{{ $teamUser->id }}"
class="h-4 w-4 rounded border-zinc-600 bg-zinc-950 text-blue-600 focus:ring-blue-500"
>
<div class="min-w-0 flex-1">
<div class="truncate text-sm font-semibold text-zinc-100">{{ $teamUser->name }}</div>
<div class="truncate text-xs text-zinc-500">{{ $teamUser->email }}</div>
</div>
@if ($teamUser->helpdesk_admin)
<span class="rounded-full bg-purple-500/10 px-2 py-0.5 text-[10px] font-bold uppercase text-purple-300">Admin</span>
@elseif ($teamUser->helpdesk_agent)
<span class="rounded-full bg-blue-500/10 px-2 py-0.5 text-[10px] font-bold uppercase text-blue-300">Agent</span>
@endif
</label>
@empty
<div class="text-sm text-zinc-500">No users are available.</div>
@endforelse
</div>
<x-helpdesk.team-table :items="$teams" />
<flux:modal
name="helpdesk-team-editor"
wire:model="teamModalOpen"
class="w-full max-w-5xl"
@close="closeTeamModal"
>
<form wire:submit="saveTeam" class="space-y-5">
<div class="flex items-start justify-between gap-4 border-b border-zinc-200 pb-4 dark:border-zinc-700">
<div>
<flux:heading size="lg">
{{ filled($teamForm['id'] ?? null) ? 'Edit team' : 'Create team' }}
</flux:heading>
<flux:subheading class="mt-1">
Configure team details and choose the users who belong to it.
</flux:subheading>
</div>
</div>
<label class="flex min-h-9 items-center gap-2 rounded-lg border border-zinc-200 bg-white px-3 py-2 text-xs font-semibold text-zinc-700 shadow-sm dark:border-zinc-700 dark:bg-zinc-950/60 dark:text-zinc-200 xl:col-span-4">
<div class="grid gap-4 md:grid-cols-2">
<flux:input wire:model="teamForm.name" label="Name" />
<flux:input wire:model="teamForm.slug" label="Slug" placeholder="auto-generated" />
</div>
<x-helpdesk.colour-select model="teamForm.color" label="Badge colour" :options="$colourOptions" />
<flux:textarea wire:model="teamForm.description" label="Description" rows="3" />
<div class="rounded-xl border border-zinc-200 bg-zinc-50 p-4 dark:border-zinc-700 dark:bg-zinc-950/55">
<div class="mb-3 flex flex-wrap items-center justify-between gap-2">
<div>
<div class="text-sm font-semibold text-zinc-900 dark:text-zinc-100">Team members</div>
<div class="mt-0.5 text-xs text-zinc-500">Select one or more users to assign to this team.</div>
</div>
<div class="rounded-full bg-blue-500/10 px-2.5 py-1 text-xs font-semibold text-blue-600 dark:text-blue-300">
{{ count($teamForm['user_ids'] ?? []) }} selected
</div>
</div>
<div class="grid max-h-72 gap-2 overflow-y-auto pr-1 sm:grid-cols-2 xl:grid-cols-3">
@forelse ($teamUsers as $teamUser)
<label class="flex cursor-pointer items-center gap-3 rounded-lg border border-zinc-200 bg-white p-3 transition hover:border-blue-500/60 dark:border-zinc-700 dark:bg-zinc-900/70 dark:hover:border-blue-500/60">
<input
type="checkbox"
wire:model="teamForm.user_ids"
value="{{ $teamUser->id }}"
class="h-4 w-4 rounded border-zinc-600 bg-zinc-950 text-blue-600 focus:ring-blue-500"
>
<div class="min-w-0 flex-1">
<div class="truncate text-sm font-semibold text-zinc-900 dark:text-zinc-100">{{ $teamUser->name }}</div>
<div class="truncate text-xs text-zinc-500">{{ $teamUser->email }}</div>
</div>
@if ($teamUser->helpdesk_admin)
<span class="rounded-full bg-purple-500/10 px-2 py-0.5 text-[10px] font-bold uppercase text-purple-600 dark:text-purple-300">Admin</span>
@elseif ($teamUser->helpdesk_agent)
<span class="rounded-full bg-blue-500/10 px-2 py-0.5 text-[10px] font-bold uppercase text-blue-600 dark:text-blue-300">Agent</span>
@endif
</label>
@empty
<div class="text-sm text-zinc-500">No users are available.</div>
@endforelse
</div>
</div>
<label class="flex min-h-10 items-center gap-2 rounded-lg border border-zinc-200 bg-white px-3 py-2 text-sm font-semibold text-zinc-700 shadow-sm dark:border-zinc-700 dark:bg-zinc-950/60 dark:text-zinc-200">
<input type="checkbox" wire:model="teamForm.is_default"
class="rounded border-zinc-300 bg-zinc-950 text-blue-600 focus:ring-blue-500">
Default team for new tickets
</label>
<div class="flex flex-wrap items-center gap-2 xl:col-span-12">
<flux:button size="sm" type="submit" variant="primary"
class="!h-9 !rounded-lg !px-3 !text-xs !font-semibold !bg-green-600 !text-white hover:!bg-green-700 focus:!ring-green-400/60">Save team
@error('teamForm.name')
<div class="rounded-lg border border-red-500/30 bg-red-500/10 px-3 py-2 text-sm text-red-600 dark:text-red-300">{{ $message }}</div>
@enderror
@error('teamForm.slug')
<div class="rounded-lg border border-red-500/30 bg-red-500/10 px-3 py-2 text-sm text-red-600 dark:text-red-300">{{ $message }}</div>
@enderror
@error('teamForm.color')
<div class="rounded-lg border border-red-500/30 bg-red-500/10 px-3 py-2 text-sm text-red-600 dark:text-red-300">{{ $message }}</div>
@enderror
@error('teamForm.user_ids.*')
<div class="rounded-lg border border-red-500/30 bg-red-500/10 px-3 py-2 text-sm text-red-600 dark:text-red-300">{{ $message }}</div>
@enderror
<div class="flex flex-wrap justify-end gap-2 border-t border-zinc-200 pt-4 dark:border-zinc-700">
<flux:button type="button" variant="ghost" wire:click="closeTeamModal">
Cancel
</flux:button>
<flux:button size="sm" type="button" wire:click="resetTeamForm" variant="ghost"
class="!h-9 !rounded-lg !px-3 !text-xs !font-semibold !bg-amber-500 !text-white hover:!bg-amber-600 focus:!ring-amber-300/60">Reset
<flux:button type="submit" variant="primary"
class="!bg-green-600 !text-white hover:!bg-green-700">
{{ filled($teamForm['id'] ?? null) ? 'Save changes' : 'Create team' }}
</flux:button>
</div>
</form>
</x-slot:form>
<x-helpdesk.team-table :items="$teams" />
</flux:modal>
</x-helpdesk.settings-section>
@endif
@@ -3,9 +3,37 @@
<title>{{ filled($title ?? null) ? $title.' - '.config('app.name', 'Laravel') : config('app.name', 'Laravel') }}</title>
<link rel="icon" href="/favicon.ico" sizes="any"><link rel="icon" href="/favicon.svg" type="image/svg+xml"><link rel="apple-touch-icon" href="/apple-touch-icon.png">
@fonts
@vite([
'resources/themes/backend/assets/css/app.css',
'resources/themes/backend/assets/js/passkeys.js',
'resources/themes/backend/assets/js/layout.js',
])
@php
$viteAssets = [
'resources/themes/backend/assets/css/app.css',
'resources/themes/backend/assets/js/passkeys.js',
'resources/themes/backend/assets/js/layout.js',
];
$moduleStatuses = [];
$moduleStatusFile = base_path('modules_statuses.json');
if (is_file($moduleStatusFile)) {
$moduleStatuses = json_decode((string) file_get_contents($moduleStatusFile), true) ?: [];
}
foreach (glob(base_path('Modules/*'), GLOB_ONLYDIR) ?: [] as $moduleDirectory) {
$moduleName = basename($moduleDirectory);
if (array_key_exists($moduleName, $moduleStatuses) && ! $moduleStatuses[$moduleName]) {
continue;
}
foreach (['Resources/assets/css/app.css', 'Resources/assets/js/app.js'] as $entry) {
$absoluteEntry = $moduleDirectory.DIRECTORY_SEPARATOR.str_replace('/', DIRECTORY_SEPARATOR, $entry);
if (is_file($absoluteEntry)) {
$viteAssets[] = str_replace('\\', '/', substr($absoluteEntry, strlen(base_path()) + 1));
}
}
}
$viteAssets = array_values(array_unique($viteAssets));
@endphp
@vite($viteAssets)
@fluxAppearance