Files
ladill-frontdesk/resources/views/frontdesk/watchlist/index.blade.php
T
isaaccladandCursor 8f555bf2bf
Deploy Ladill Frontdesk / deploy (push) Successful in 43s
Replace native browser confirms with Ladill confirm dialogs.
Visits, devices, and admin destructive actions now use the shared modal UI.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-07-12 17:51:22 +00:00

90 lines
5.0 KiB
PHP

<x-app-layout title="Watchlist">
<div class="space-y-6">
<x-frontdesk.page-hero
badge="Security · Approvals · Blocked visitors"
title="Watchlist"
description="Flag visitors who need approval before entry or block them from checking in at your reception desks and kiosks."
:stats="[
['value' => number_format($heroStats['total']), 'label' => 'Entries'],
['value' => number_format($heroStats['requires_approval']), 'label' => 'Needs approval'],
['value' => number_format($heroStats['blacklisted']), 'label' => 'Blacklisted'],
]">
<x-slot name="actions">
<a href="{{ route('frontdesk.visitors.index') }}" class="btn-secondary">Visitor database</a>
@if ($canManage)
<a href="{{ route('frontdesk.watchlist.create') }}" class="btn-primary">
<svg class="h-4 w-4" fill="none" stroke="currentColor" stroke-width="2" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" d="M12 4.5v15m7.5-7.5h-15"/></svg>
Add entry
</a>
@endif
</x-slot>
</x-frontdesk.page-hero>
<form method="GET" class="flex flex-wrap gap-2">
<input type="search" name="q" value="{{ request('q') }}" placeholder="Search name or company…" class="rounded-lg border-slate-300 text-sm">
<select name="status" class="rounded-lg border-slate-300 text-sm">
<option value="">All statuses</option>
@foreach ($statuses as $key => $label)
@if ($key !== 'allowed')
<option value="{{ $key }}" @selected(request('status') === $key)>{{ $label }}</option>
@endif
@endforeach
</select>
<x-btn type="submit" variant="secondary" size="sm">Filter</x-btn>
</form>
<div class="overflow-hidden rounded-2xl border border-slate-200 bg-white">
<div class="border-b border-slate-100 px-6 py-4">
<h2 class="text-sm font-semibold text-slate-900">Watchlist entries</h2>
</div>
<table class="min-w-full divide-y divide-slate-100 text-sm">
<thead class="bg-slate-50 text-left text-xs uppercase text-slate-500">
<tr>
<th class="px-4 py-3">Name</th>
<th class="px-4 py-3">Company</th>
<th class="px-4 py-3">Status</th>
<th class="px-4 py-3">Reason</th>
<th class="px-4 py-3"></th>
</tr>
</thead>
<tbody class="divide-y divide-slate-50">
@forelse ($entries as $entry)
<tr>
<td class="px-4 py-3 font-medium">
@if ($entry->visitor)
<a href="{{ route('frontdesk.visitors.show', $entry->visitor) }}" class="btn-link btn-link-plain font-medium text-slate-900 hover:text-indigo-700">{{ $entry->full_name }}</a>
@else
{{ $entry->full_name }}
@endif
</td>
<td class="px-4 py-3 text-slate-600">{{ $entry->company ?? '—' }}</td>
<td class="px-4 py-3 capitalize">{{ str_replace('_', ' ', $entry->status) }}</td>
<td class="px-4 py-3 text-slate-500">{{ Str::limit($entry->reason, 60) ?: '—' }}</td>
<td class="px-4 py-3">
@if ($canManage)
<x-confirm-dialog
:name="'remove-watchlist-'.$entry->id"
title="Remove this watchlist entry?"
:action="route('frontdesk.watchlist.destroy', $entry)"
method="DELETE"
confirm-label="Remove entry"
>
<x-slot:trigger>
<x-btn type="button" variant="danger" size="sm">Remove</x-btn>
</x-slot:trigger>
</x-confirm-dialog>
@endif
</td>
</tr>
@empty
<tr><td colspan="5" class="px-4 py-8 text-center text-slate-400">No watchlist entries.</td></tr>
@endforelse
</tbody>
</table>
@if ($entries->hasPages())
<div class="border-t border-slate-100 px-5 py-3">{{ $entries->links() }}</div>
@endif
</div>
</div>
</x-app-layout>