Deploy Ladill Frontdesk / deploy (push) Successful in 55s
Add warning, danger, and link button styles plus x-btn and x-danger-zone components so ghost text actions match the primary pill UI across edit screens and tables. Co-authored-by: Cursor <cursoragent@cursor.com>
73 lines
3.9 KiB
PHP
73 lines
3.9 KiB
PHP
<x-app-layout title="My presence">
|
|
@php
|
|
$presence = $employee->presence;
|
|
$status = $presence->status;
|
|
@endphp
|
|
<div class="mx-auto max-w-lg">
|
|
<h1 class="text-xl font-semibold text-slate-900">My presence</h1>
|
|
<p class="text-sm text-slate-500">{{ $organization->name }}</p>
|
|
|
|
@if (session('success'))
|
|
<p class="mt-4 rounded-xl bg-emerald-50 px-4 py-3 text-sm text-emerald-800">{{ session('success') }}</p>
|
|
@endif
|
|
|
|
<div class="mt-6 rounded-2xl border border-slate-200 bg-white p-6">
|
|
<p class="text-sm font-medium text-indigo-600">{{ $statusLabel }}</p>
|
|
<h2 class="mt-1 text-2xl font-bold text-slate-900">{{ $employee->full_name }}</h2>
|
|
@if ($presence->destination)
|
|
<p class="mt-2 text-sm text-slate-600">{{ $presence->destination }}</p>
|
|
@endif
|
|
@if ($presence->expected_return_at)
|
|
<p class="mt-1 text-xs text-slate-400">Expected back {{ $presence->expected_return_at->format('M j, g:i A') }}</p>
|
|
@endif
|
|
|
|
@if ($status === 'off_site')
|
|
<p class="mt-6 text-sm text-slate-500">Sign in at the reception kiosk when you arrive.</p>
|
|
@endif
|
|
|
|
@if ($status === 'on_site')
|
|
<form method="POST" action="{{ route('frontdesk.employee.portal.action') }}" class="mt-6 space-y-4" x-data="{ stepOutReason: 'lunch' }">
|
|
@csrf
|
|
<input type="hidden" name="action" value="step_out">
|
|
<div>
|
|
<label class="block text-sm font-medium text-slate-700">Reason</label>
|
|
<select name="step_out_reason" x-model="stepOutReason" class="mt-1 w-full rounded-lg border-slate-300 text-sm">
|
|
@foreach ($stepOutReasons as $key => $label)
|
|
<option value="{{ $key }}">{{ $label }}</option>
|
|
@endforeach
|
|
</select>
|
|
</div>
|
|
<div>
|
|
<label class="block text-sm font-medium text-slate-700">Destination</label>
|
|
<input type="text" name="destination" class="mt-1 w-full rounded-lg border-slate-300 text-sm" placeholder="Where are you going?">
|
|
<p x-show="stepOutReason === 'other'" x-cloak class="mt-1.5 text-xs text-amber-700">Required when reason is Other.</p>
|
|
</div>
|
|
<div>
|
|
<label class="block text-sm font-medium text-slate-700">Expected return</label>
|
|
<input type="datetime-local" name="expected_return_at" class="mt-1 w-full rounded-lg border-slate-300 text-sm">
|
|
</div>
|
|
<button type="submit" class="btn-primary w-full">Step out</button>
|
|
</form>
|
|
<form method="POST" action="{{ route('frontdesk.employee.portal.action') }}" class="mt-3">
|
|
@csrf
|
|
<input type="hidden" name="action" value="sign_out">
|
|
<x-btn type="submit" variant="secondary" class="w-full">Sign out for the day</x-btn>
|
|
</form>
|
|
@endif
|
|
|
|
@if ($status === 'stepped_out')
|
|
<form method="POST" action="{{ route('frontdesk.employee.portal.action') }}" class="mt-6">
|
|
@csrf
|
|
<input type="hidden" name="action" value="step_in">
|
|
<button type="submit" class="btn-primary w-full">I'm back</button>
|
|
</form>
|
|
<form method="POST" action="{{ route('frontdesk.employee.portal.action') }}" class="mt-3">
|
|
@csrf
|
|
<input type="hidden" name="action" value="sign_out">
|
|
<x-btn type="submit" variant="secondary" class="w-full">Sign out for the day</x-btn>
|
|
</form>
|
|
@endif
|
|
</div>
|
|
</div>
|
|
</x-app-layout>
|