Visitor management app with SSO, kiosk, badges, reports, and Gitea CI deploy to frontdesk.ladill.com. Co-authored-by: Cursor <cursoragent@cursor.com>
122 lines
7.8 KiB
PHP
122 lines
7.8 KiB
PHP
<x-app-layout title="Settings">
|
|
@php
|
|
$settings = $organization->settings ?? [];
|
|
@endphp
|
|
|
|
<h1 class="text-xl font-semibold text-slate-900">Settings</h1>
|
|
<p class="text-sm text-slate-500">{{ $organization->name }}</p>
|
|
|
|
<form method="POST" action="{{ route('frontdesk.settings.update') }}" class="mt-6 max-w-2xl space-y-6">
|
|
@csrf @method('PUT')
|
|
|
|
<section class="rounded-2xl border border-slate-200 bg-white p-5 space-y-4">
|
|
<h2 class="text-sm font-semibold text-slate-900">Organization</h2>
|
|
@if ($canManage)
|
|
<div>
|
|
<label class="block text-sm font-medium text-slate-700">Name</label>
|
|
<input type="text" name="name" value="{{ old('name', $organization->name) }}" 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>
|
|
<select name="timezone" class="mt-1 w-full rounded-lg border-slate-300 text-sm">
|
|
@foreach (timezone_identifiers_list() as $tz)
|
|
<option value="{{ $tz }}" @selected(old('timezone', $organization->timezone) === $tz)>{{ $tz }}</option>
|
|
@endforeach
|
|
</select>
|
|
</div>
|
|
@else
|
|
<dl class="text-sm space-y-2">
|
|
<div class="flex justify-between"><dt class="text-slate-500">Name</dt><dd>{{ $organization->name }}</dd></div>
|
|
<div class="flex justify-between"><dt class="text-slate-500">Timezone</dt><dd>{{ $organization->timezone }}</dd></div>
|
|
</dl>
|
|
@endif
|
|
</section>
|
|
|
|
@if ($canManage)
|
|
<section class="rounded-2xl border border-slate-200 bg-white p-5 space-y-4">
|
|
<h2 class="text-sm font-semibold text-slate-900">Reception & kiosk</h2>
|
|
<div class="grid gap-4 sm:grid-cols-2">
|
|
<div>
|
|
<label class="block text-sm font-medium text-slate-700">Badge expiry (hours)</label>
|
|
<input type="number" name="badge_expiry_hours" value="{{ old('badge_expiry_hours', $settings['badge_expiry_hours'] ?? 8) }}" min="1" max="24" class="mt-1 w-full rounded-lg border-slate-300 text-sm">
|
|
</div>
|
|
<div>
|
|
<label class="block text-sm font-medium text-slate-700">Kiosk inactivity reset (seconds)</label>
|
|
<input type="number" name="kiosk_reset_seconds" value="{{ old('kiosk_reset_seconds', $settings['kiosk_reset_seconds'] ?? 120) }}" min="30" max="600" class="mt-1 w-full rounded-lg border-slate-300 text-sm">
|
|
</div>
|
|
<div>
|
|
<label class="block text-sm font-medium text-slate-700">Contractor badge expiry (hours)</label>
|
|
<input type="number" name="contractor_badge_expiry_hours" value="{{ old('contractor_badge_expiry_hours', data_get($settings, 'type_badge_expiry_hours.contractor', 12)) }}" min="1" max="24" class="mt-1 w-full rounded-lg border-slate-300 text-sm">
|
|
</div>
|
|
</div>
|
|
<div>
|
|
<label class="block text-sm font-medium text-slate-700">Visitor policy</label>
|
|
<textarea name="visitor_policy" rows="4" class="mt-1 w-full rounded-lg border-slate-300 text-sm">{{ old('visitor_policy', $settings['visitor_policy'] ?? '') }}</textarea>
|
|
</div>
|
|
<div>
|
|
<p class="text-sm font-medium text-slate-700">Notification channels</p>
|
|
<div class="mt-2 flex flex-wrap gap-3">
|
|
@foreach ($notificationChannels as $key => $label)
|
|
<label class="flex items-center gap-2 text-sm">
|
|
<input type="checkbox" name="notification_channels[]" value="{{ $key }}"
|
|
@checked(in_array($key, old('notification_channels', $settings['notification_channels'] ?? ['email'])))>
|
|
{{ $label }}
|
|
</label>
|
|
@endforeach
|
|
</div>
|
|
</div>
|
|
<div>
|
|
<p class="text-sm font-medium text-slate-700">Notification events</p>
|
|
<div class="mt-2 grid gap-2 sm:grid-cols-2">
|
|
@foreach ($notificationEvents as $key => $label)
|
|
<label class="flex items-center gap-2 text-sm">
|
|
<input type="checkbox" name="notification_events[{{ $key }}]" value="1"
|
|
@checked(old("notification_events.{$key}", data_get($settings, "notification_events.{$key}", true)))>
|
|
{{ $label }}
|
|
</label>
|
|
@endforeach
|
|
</div>
|
|
</div>
|
|
<div>
|
|
<label class="block text-sm font-medium text-slate-700">Daily report recipients</label>
|
|
<input type="text" name="report_daily_recipients" value="{{ old('report_daily_recipients', implode(', ', $settings['report_daily_recipients'] ?? [])) }}" placeholder="admin@example.com, security@example.com" class="mt-1 w-full rounded-lg border-slate-300 text-sm">
|
|
<p class="mt-1 text-xs text-slate-500">Comma-separated emails for the daily summary report.</p>
|
|
</div>
|
|
</section>
|
|
|
|
<button type="submit" class="rounded-lg bg-teal-600 px-4 py-2 text-sm font-semibold text-white hover:bg-teal-700">Save settings</button>
|
|
@endif
|
|
</form>
|
|
|
|
<div class="mt-8 grid gap-4 lg:grid-cols-3">
|
|
@if ($canManage)
|
|
<a href="{{ route('frontdesk.branches.index') }}" class="rounded-2xl border border-slate-200 bg-white p-5 hover:border-teal-300">
|
|
<h3 class="font-semibold text-slate-900">Branches</h3>
|
|
<p class="mt-1 text-sm text-slate-500">{{ $branchCount }} branch{{ $branchCount === 1 ? '' : 'es' }}</p>
|
|
</a>
|
|
<a href="{{ route('frontdesk.members.index') }}" class="rounded-2xl border border-slate-200 bg-white p-5 hover:border-teal-300">
|
|
<h3 class="font-semibold text-slate-900">Team members</h3>
|
|
<p class="mt-1 text-sm text-slate-500">Manage roles and access</p>
|
|
</a>
|
|
@endif
|
|
<a href="{{ route('frontdesk.kiosk') }}" class="rounded-2xl border border-slate-200 bg-white p-5 hover:border-teal-300">
|
|
<h3 class="font-semibold text-slate-900">Kiosk mode</h3>
|
|
<p class="mt-1 text-sm text-slate-500">Open self-service check-in</p>
|
|
</a>
|
|
@if ($canManage)
|
|
<a href="{{ route('frontdesk.settings.badge') }}" class="rounded-2xl border border-slate-200 bg-white p-5 hover:border-teal-300">
|
|
<h3 class="font-semibold text-slate-900">Badge template</h3>
|
|
<p class="mt-1 text-sm text-slate-500">Layout, photo, and QR settings</p>
|
|
</a>
|
|
<a href="{{ route('frontdesk.integrations.edit') }}" class="rounded-2xl border border-slate-200 bg-white p-5 hover:border-teal-300">
|
|
<h3 class="font-semibold text-slate-900">Integrations</h3>
|
|
<p class="mt-1 text-sm text-slate-500">Webhooks and calendar feeds</p>
|
|
</a>
|
|
<a href="{{ route('frontdesk.devices.index') }}" class="rounded-2xl border border-slate-200 bg-white p-5 hover:border-teal-300">
|
|
<h3 class="font-semibold text-slate-900">Devices</h3>
|
|
<p class="mt-1 text-sm text-slate-500">Kiosks, printers, and hardware</p>
|
|
</a>
|
|
@endif
|
|
</div>
|
|
</x-app-layout>
|