Deploy Ladill Queue / deploy (push) Successful in 2m5s
Browsers abort the outer Save settings form when a Reinstall package form is nested inside it. Move reinstall outside the main form and harden update validation so package failures cannot block saving. Co-authored-by: Cursor <cursoragent@cursor.com>
175 lines
12 KiB
PHP
175 lines
12 KiB
PHP
<x-app-layout title="Settings">
|
|
<x-settings.page title="Organization settings" description="Configure branding, queue preferences, and access for {{ $organization->name }}.">
|
|
@if ($canManage)
|
|
<x-settings.card title="Plan & usage" description="Subscription limits for {{ $organization->name }}.">
|
|
<div class="flex flex-col gap-4 sm:flex-row sm:items-start sm:justify-between">
|
|
<p class="text-sm leading-6 text-slate-600">
|
|
@if ($isEnterprise)
|
|
<span class="font-medium text-indigo-700">Enterprise</span> — unlimited branches, full API, advanced analytics, billed per branch.
|
|
@elseif ($hasPaidPlan)
|
|
<span class="font-medium text-indigo-700">Pro</span> — multi-branch, team roles, advanced routing, and Ladill-provided kiosk hardware, billed per branch.
|
|
@else
|
|
<span class="font-medium text-slate-900">Free</span> — one branch, five queues, owner-only access. Multi-branch and team require Pro.
|
|
@endif
|
|
</p>
|
|
@if (! $hasPaidPlan)
|
|
<a href="{{ route('qms.pro.index') }}" class="btn-primary shrink-0 text-sm">Upgrade to Pro (GHS {{ number_format($proPriceMinor / 100, 0) }}/branch/mo)</a>
|
|
@else
|
|
<a href="{{ route('qms.pro.index') }}" class="btn-secondary shrink-0 text-sm">Manage plan</a>
|
|
@endif
|
|
</div>
|
|
</x-settings.card>
|
|
@endif
|
|
|
|
<form method="POST" action="{{ route('qms.settings.update') }}" enctype="multipart/form-data" class="space-y-6">
|
|
@csrf @method('PUT')
|
|
|
|
@if ($errors->any())
|
|
<div class="rounded-lg border border-red-200 bg-red-50 px-4 py-3 text-sm text-red-800">
|
|
<p class="font-medium">Could not save settings:</p>
|
|
<ul class="mt-1 list-disc pl-5">
|
|
@foreach ($errors->all() as $error)
|
|
<li>{{ $error }}</li>
|
|
@endforeach
|
|
</ul>
|
|
</div>
|
|
@endif
|
|
|
|
<x-settings.card title="Organization" description="Name, timezone, appointment mode, and notification preferences.">
|
|
<div class="space-y-4">
|
|
<div>
|
|
<label class="block text-sm font-medium text-slate-700">Organization name</label>
|
|
<input name="name" value="{{ $organization->name }}" @disabled(! $canManage) required class="mt-1 w-full rounded-lg border-slate-300 text-sm">
|
|
</div>
|
|
<div>
|
|
<label class="block text-sm font-medium text-slate-700">Timezone</label>
|
|
<input name="timezone" value="{{ $organization->timezone }}" @disabled(! $canManage) required class="mt-1 w-full rounded-lg border-slate-300 text-sm">
|
|
</div>
|
|
<div>
|
|
<label class="block text-sm font-medium text-slate-700">Appointment mode</label>
|
|
<select name="appointment_mode" @disabled(! $canManage) class="mt-1 w-full rounded-lg border-slate-300 text-sm">
|
|
@foreach ($appointmentModes as $v => $l)
|
|
<option value="{{ $v }}" @selected(($organization->settings['appointment_mode'] ?? 'hybrid') === $v)>{{ $l }}</option>
|
|
@endforeach
|
|
</select>
|
|
</div>
|
|
<div>
|
|
<label class="block text-sm font-medium text-slate-700">Industry package</label>
|
|
<select name="industry" @disabled(! $canManage) class="mt-1 w-full rounded-lg border-slate-300 text-sm">
|
|
@foreach ($industries as $v => $l)
|
|
<option value="{{ $v }}" @selected(($organization->settings['industry'] ?? '') === $v)>{{ $l }}</option>
|
|
@endforeach
|
|
</select>
|
|
@if ($activePackage)
|
|
<p class="mt-2 text-xs text-slate-500">{{ $activePackage->description() }}</p>
|
|
<p class="mt-1 text-xs text-slate-500">
|
|
Ticket entity: <span class="font-medium text-slate-700">{{ $activePackage->ticketEntity() }}</span>
|
|
· Stages installed: {{ count(data_get($packageMeta, 'stages_installed', [])) }}
|
|
@if (data_get($packageMeta, 'skipped_stages'))
|
|
· Skipped: {{ implode(', ', data_get($packageMeta, 'skipped_stages', [])) }}
|
|
@endif
|
|
</p>
|
|
@endif
|
|
</div>
|
|
<label class="flex items-center gap-2 text-sm">
|
|
<input type="checkbox" name="notifications_enabled" value="1" @checked($organization->settings['notifications_enabled'] ?? true) @disabled(! $canManage)>
|
|
Enable SMS/email queue notifications
|
|
</label>
|
|
@if ($canManage)
|
|
<div>
|
|
<label class="block text-sm font-medium text-slate-700">Company logo</label>
|
|
<p class="mt-1 text-xs text-slate-500">PNG, JPG, WebP, or SVG up to 2 MB. Shown in queue notification emails.</p>
|
|
@if (\App\Support\OrganizationBranding::hasCustomLogo($organization))
|
|
<img src="{{ \App\Support\OrganizationBranding::logoUrl($organization) }}"
|
|
alt="{{ $organization->name }}"
|
|
class="mt-3 h-12 w-auto max-w-xs rounded-lg border border-slate-200 bg-white object-contain p-2">
|
|
<label class="mt-3 flex items-center gap-2 text-sm text-slate-600">
|
|
<input type="checkbox" name="remove_logo" value="1" @checked(old('remove_logo'))>
|
|
Remove custom logo
|
|
</label>
|
|
@endif
|
|
<input type="file" name="logo" accept="image/png,image/jpeg,image/webp,image/svg+xml"
|
|
class="mt-3 block w-full text-sm text-slate-600 file:mr-3 file:rounded-lg file:border-0 file:bg-indigo-50 file:px-3 file:py-2 file:text-sm file:font-medium file:text-indigo-700">
|
|
</div>
|
|
@endif
|
|
</div>
|
|
</x-settings.card>
|
|
|
|
@if ($canViewBranches || $canViewTeam)
|
|
<x-settings.card title="Branches & team" description="Locations and staff access for this organization. Multi-branch and team require Queue Pro.">
|
|
<ul class="space-y-3">
|
|
@if ($canViewBranches)
|
|
<li>
|
|
<a href="{{ route('qms.branches.index') }}"
|
|
class="flex items-center justify-between rounded-xl border border-slate-100 bg-slate-50 px-4 py-3 text-sm text-slate-700 hover:text-indigo-700">
|
|
<span>
|
|
Branches
|
|
@if (! $hasBranchesFeature)
|
|
<span class="ml-2 rounded-full bg-amber-50 px-2 py-0.5 text-[10px] font-semibold uppercase tracking-wide text-amber-700">Pro</span>
|
|
@endif
|
|
<span class="mt-0.5 block text-xs text-slate-500">Locations and sites for queues and counters</span>
|
|
</span>
|
|
<span class="text-slate-400">→</span>
|
|
</a>
|
|
</li>
|
|
@endif
|
|
@if ($canViewTeam)
|
|
<li>
|
|
<a href="{{ route('qms.members.index') }}"
|
|
class="flex items-center justify-between rounded-xl border border-slate-100 bg-slate-50 px-4 py-3 text-sm text-slate-700 hover:text-indigo-700">
|
|
<span>
|
|
Team
|
|
@if (! $hasTeamFeature)
|
|
<span class="ml-2 rounded-full bg-amber-50 px-2 py-0.5 text-[10px] font-semibold uppercase tracking-wide text-amber-700">Pro</span>
|
|
@endif
|
|
<span class="mt-0.5 block text-xs text-slate-500">Invite colleagues and assign Queue roles</span>
|
|
</span>
|
|
<span class="text-slate-400">→</span>
|
|
</a>
|
|
</li>
|
|
@endif
|
|
</ul>
|
|
</x-settings.card>
|
|
@endif
|
|
|
|
<x-settings.card title="Integrations" description="Allow Ladill Care and Frontdesk to manage queues in-app via the Queue API. Both apps must also enable integration in their settings.">
|
|
<div class="space-y-2">
|
|
<label class="flex items-center gap-2 text-sm">
|
|
<input type="checkbox" name="care_integration_enabled" value="1" @checked(data_get($organization->settings, 'integrations.care_enabled')) @disabled(! $canManage)>
|
|
Ladill Care can manage queues
|
|
</label>
|
|
<label class="flex items-center gap-2 text-sm">
|
|
<input type="checkbox" name="frontdesk_integration_enabled" value="1" @checked(data_get($organization->settings, 'integrations.frontdesk_enabled')) @disabled(! $canManage)>
|
|
Ladill Frontdesk can manage queues
|
|
</label>
|
|
</div>
|
|
</x-settings.card>
|
|
|
|
@if ($canManage)
|
|
<div class="flex justify-end">
|
|
<button type="submit" class="btn-primary">Save settings</button>
|
|
</div>
|
|
@endif
|
|
</form>
|
|
|
|
{{-- Separate form: nested forms break Save settings in browsers --}}
|
|
@if ($canManage && $activePackage)
|
|
<div class="mt-6">
|
|
<x-settings.card title="Industry template" description="Re-sync departments, stages, service points, workflow, and announcement copy from the selected industry package. Existing tickets are kept.">
|
|
<div class="flex flex-col gap-3 sm:flex-row sm:items-center sm:justify-between">
|
|
<p class="text-sm text-slate-600">
|
|
{{ $activePackage->label() }} uses
|
|
<span class="font-medium text-slate-900">{{ count($activePackage->stages()) }}</span> workflow stages and
|
|
industry-specific terminology ({{ $activePackage->terminology()['ticket'] ?? 'Ticket' }}).
|
|
</p>
|
|
<form method="POST" action="{{ route('qms.settings.package.reinstall') }}">
|
|
@csrf
|
|
<button type="submit" class="btn-secondary shrink-0 text-sm">Reinstall package</button>
|
|
</form>
|
|
</div>
|
|
</x-settings.card>
|
|
</div>
|
|
@endif
|
|
</x-settings.page>
|
|
</x-app-layout>
|