Files
ladill-queue/resources/views/qms/queues/index.blade.php
T
isaaccladandCursor bf879d6abe
Deploy Ladill Queue / deploy (push) Successful in 36s
Add hero sections to Queue index pages and soften analytics cards.
Introduce shared x-qms.page-hero with summary stats across queues,
tickets, counters, admin pages, and insights; remove bordered cards on
Analytics, Reports, Feedback, and Branches list views.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-07-06 07:32:10 +00:00

90 lines
5.5 KiB
PHP

@php
$canManageQueues = app(\App\Services\Qms\QmsPermissions::class)->can(
app(\App\Services\Qms\OrganizationResolver::class)->memberFor(auth()->user()),
'queues.manage'
);
@endphp
<x-app-layout title="Queues">
<div class="space-y-6">
<x-qms.page-hero
badge="Service lines · Prefixes · Routing"
title="Service queues"
description="Configure queues for reception, counters, and departments — each with its own ticket prefix and routing strategy."
:stats="[
['value' => number_format($heroStats['total']), 'label' => 'Queues'],
['value' => number_format($heroStats['active']), 'label' => 'Active'],
['value' => number_format($heroStats['paused']), 'label' => 'Paused'],
]">
@if ($canManageQueues)
<x-slot name="actions">
<a href="{{ route('qms.queues.create') }}" class="btn-primary">New queue</a>
</x-slot>
@endif
</x-qms.page-hero>
@if (session('success'))
<div class="rounded-lg bg-emerald-50 px-4 py-3 text-sm text-emerald-800">{{ session('success') }}</div>
@endif
<div class="overflow-hidden rounded-2xl border border-slate-200 bg-white">
@if ($queues->isEmpty())
<div class="px-6 py-12 text-center text-sm text-slate-500">
No queues yet. Create your first service queue to start issuing tickets.
</div>
@else
<table class="min-w-full divide-y divide-slate-200">
<thead class="bg-slate-50">
<tr>
<th class="px-4 py-3 text-left text-xs font-semibold uppercase text-slate-500">Queue</th>
<th class="px-4 py-3 text-left text-xs font-semibold uppercase text-slate-500">Branch</th>
<th class="px-4 py-3 text-left text-xs font-semibold uppercase text-slate-500">Prefix</th>
<th class="px-4 py-3 text-left text-xs font-semibold uppercase text-slate-500">Strategy</th>
<th class="px-4 py-3 text-left text-xs font-semibold uppercase text-slate-500">Status</th>
<th class="px-4 py-3"></th>
</tr>
</thead>
<tbody class="divide-y divide-slate-200">
@foreach ($queues as $queue)
<tr>
<td class="px-4 py-3">
<div class="flex items-center gap-2">
<span class="h-3 w-3 rounded-full" style="background-color: {{ $queue->color }}"></span>
<span class="text-sm font-medium text-slate-900">
<a href="{{ route('qms.queues.show', $queue) }}" class="hover:text-indigo-600">{{ $queue->name }}</a>
</span>
</div>
</td>
<td class="px-4 py-3 text-sm text-slate-600">{{ $queue->branch?->name }}</td>
<td class="px-4 py-3 text-sm font-mono text-slate-600">{{ $queue->prefix }}</td>
<td class="px-4 py-3 text-sm text-slate-600">{{ config('qms.queue_strategies.'.$queue->strategy, $queue->strategy) }}</td>
<td class="px-4 py-3">
<div class="flex items-center gap-2">
@if ($queue->is_paused)
<span class="inline-flex rounded-full bg-amber-50 px-2 py-0.5 text-xs font-medium text-amber-700">Paused</span>
<form method="POST" action="{{ route('qms.queues.resume', $queue) }}" class="inline">@csrf<button class="text-xs text-indigo-600">Resume</button></form>
@elseif ($queue->is_active)
<span class="inline-flex rounded-full bg-emerald-50 px-2 py-0.5 text-xs font-medium text-emerald-700">Active</span>
<form method="POST" action="{{ route('qms.queues.pause', $queue) }}" class="inline">@csrf<button class="text-xs text-amber-600">Pause</button></form>
@else
<span class="inline-flex rounded-full bg-slate-100 px-2 py-0.5 text-xs font-medium text-slate-600">Inactive</span>
@endif
</div>
</td>
<td class="px-4 py-3 text-right">
@if(app(\App\Services\Qms\QmsPermissions::class)->can(app(\App\Services\Qms\OrganizationResolver::class)->memberFor(auth()->user()), 'rules.view'))
<a href="{{ route('qms.rules.index', $queue) }}" class="text-xs text-indigo-600">Rules</a>
@endif
</td>
</tr>
@endforeach
</tbody>
</table>
<div class="border-t border-slate-200 px-4 py-3">
{{ $queues->links() }}
</div>
@endif
</div>
</div>
</x-app-layout>