Add hero section to Watchlist index with entry stats and CTAs.
Deploy Ladill Frontdesk / deploy (push) Successful in 31s
Deploy Ladill Frontdesk / deploy (push) Successful in 31s
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -1,66 +1,82 @@
|
||||
<x-app-layout title="Watchlist">
|
||||
<div class="flex items-center justify-between">
|
||||
<div>
|
||||
<h1 class="text-xl font-semibold text-slate-900">Watchlist</h1>
|
||||
<p class="text-sm text-slate-500">Flagged and blocked visitors</p>
|
||||
</div>
|
||||
@if ($canManage)
|
||||
<a href="{{ route('frontdesk.watchlist.create') }}" class="btn-primary">Add entry</a>
|
||||
@endif
|
||||
</div>
|
||||
|
||||
<form method="GET" class="mt-4 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>
|
||||
<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
|
||||
@endforeach
|
||||
</select>
|
||||
<button type="submit" class="rounded-lg border border-slate-200 px-4 py-2 text-sm">Filter</button>
|
||||
</form>
|
||||
</x-slot>
|
||||
</x-frontdesk.page-hero>
|
||||
|
||||
<div class="mt-4 overflow-hidden rounded-2xl border border-slate-200 bg-white">
|
||||
<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)
|
||||
<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>
|
||||
<button type="submit" class="rounded-lg border border-slate-200 px-4 py-2 text-sm">Filter</button>
|
||||
</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>
|
||||
<td class="px-4 py-3 font-medium">
|
||||
@if ($entry->visitor)
|
||||
<a href="{{ route('frontdesk.visitors.show', $entry->visitor) }}" class="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)
|
||||
<form method="POST" action="{{ route('frontdesk.watchlist.destroy', $entry) }}" onsubmit="return confirm('Remove this watchlist entry?')">
|
||||
@csrf @method('DELETE')
|
||||
<button type="submit" class="text-sm text-red-600 hover:text-red-800">Remove</button>
|
||||
</form>
|
||||
@endif
|
||||
</td>
|
||||
<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>
|
||||
@empty
|
||||
<tr><td colspan="5" class="px-4 py-8 text-center text-slate-400">No watchlist entries.</td></tr>
|
||||
@endforelse
|
||||
</tbody>
|
||||
</table>
|
||||
</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="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)
|
||||
<form method="POST" action="{{ route('frontdesk.watchlist.destroy', $entry) }}" onsubmit="return confirm('Remove this watchlist entry?')">
|
||||
@csrf @method('DELETE')
|
||||
<button type="submit" class="text-sm text-red-600 hover:text-red-800">Remove</button>
|
||||
</form>
|
||||
@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>
|
||||
|
||||
<div class="mt-4">{{ $entries->links() }}</div>
|
||||
</x-app-layout>
|
||||
|
||||
Reference in New Issue
Block a user