Replace employee user_ref text field with Ladill user select.
Deploy Ladill Frontdesk / deploy (push) Successful in 40s
Deploy Ladill Frontdesk / deploy (push) Successful in 40s
Populate the dropdown from team members and linked hosts, show name and email labels, and block linking a user already tied to another employee. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -51,10 +51,7 @@
|
||||
</select>
|
||||
<p class="mt-1 text-xs text-slate-500">When stepped out, linked hosts show as unavailable to visitors.</p>
|
||||
</div>
|
||||
<div>
|
||||
<label class="block text-sm font-medium text-slate-700">Linked Ladill user (optional)</label>
|
||||
<input type="text" name="user_ref" value="{{ old('user_ref') }}" placeholder="User public ID" class="mt-1 w-full rounded-lg border-slate-300 font-mono text-sm">
|
||||
</div>
|
||||
@include('frontdesk.employees.partials.user-ref-select', ['selectedUserRef' => old('user_ref')])
|
||||
<button type="submit" class="btn-primary w-full">Save employee</button>
|
||||
</form>
|
||||
</div>
|
||||
|
||||
@@ -49,11 +49,7 @@
|
||||
@endforeach
|
||||
</select>
|
||||
</div>
|
||||
<div>
|
||||
<label class="block text-sm font-medium text-slate-700">Linked Ladill user (for mobile step-out)</label>
|
||||
<input type="text" name="user_ref" value="{{ old('user_ref', $employee->user_ref) }}" placeholder="User public ID" class="mt-1 w-full rounded-lg border-slate-300 font-mono text-sm">
|
||||
<p class="mt-1 text-xs text-slate-400">Enables the My presence portal for this employee.</p>
|
||||
</div>
|
||||
@include('frontdesk.employees.partials.user-ref-select', ['selectedUserRef' => old('user_ref', $employee->user_ref)])
|
||||
<label class="flex items-center gap-2 text-sm">
|
||||
<input type="checkbox" name="active" value="1" @checked(old('active', $employee->active)) class="rounded border-slate-300">
|
||||
Active (can use kiosk)
|
||||
|
||||
@@ -0,0 +1,26 @@
|
||||
@php
|
||||
$selectedUserRef = old('user_ref', $selectedUserRef ?? '');
|
||||
@endphp
|
||||
|
||||
<div>
|
||||
<label class="block text-sm font-medium text-slate-700">Linked Ladill user (optional)</label>
|
||||
<select name="user_ref" class="mt-1 w-full rounded-lg border-slate-300 text-sm">
|
||||
<option value="">None</option>
|
||||
@foreach ($linkableUsers as $linkableUser)
|
||||
<option value="{{ $linkableUser['user_ref'] }}"
|
||||
@selected($selectedUserRef === $linkableUser['user_ref'])
|
||||
@disabled($linkableUser['taken'] && $selectedUserRef !== $linkableUser['user_ref'])>
|
||||
{{ $linkableUser['label'] }}@if ($linkableUser['taken']) (linked to another employee) @endif
|
||||
</option>
|
||||
@endforeach
|
||||
</select>
|
||||
@if (count($linkableUsers) === 0)
|
||||
<p class="mt-1 text-xs text-amber-700">
|
||||
No Ladill users available yet.
|
||||
<a href="{{ route('frontdesk.members.create') }}" class="font-medium underline">Add a team member</a>
|
||||
so they can be linked here.
|
||||
</p>
|
||||
@else
|
||||
<p class="mt-1 text-xs text-slate-500">Enables the My presence portal when this person signs in with the selected Ladill account.</p>
|
||||
@endif
|
||||
</div>
|
||||
Reference in New Issue
Block a user