Files
ladill-queue/resources/views/qms/admin/departments/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

52 lines
2.6 KiB
PHP

@php
$canManageDepartments = app(\App\Services\Qms\QmsPermissions::class)->can(
app(\App\Services\Qms\OrganizationResolver::class)->memberFor(auth()->user()),
'admin.departments.manage'
);
@endphp
<x-app-layout title="Departments">
<div class="space-y-6">
<x-qms.page-hero
badge="Reception · Service · Routing"
title="Departments"
description="Group queues and counters by department within each branch — reception, customer service, payments, and more."
:stats="[
['value' => number_format($heroStats['total']), 'label' => 'Departments'],
['value' => number_format($heroStats['active']), 'label' => 'Active'],
['value' => number_format($heroStats['branches']), 'label' => 'Branches'],
]">
@if ($canManageDepartments)
<x-slot name="actions">
<a href="{{ route('qms.departments.create') }}" class="btn-primary">New department</a>
</x-slot>
@endif
</x-qms.page-hero>
@include('partials.flash')
<div class="overflow-hidden rounded-2xl border border-slate-200 bg-white">
<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">Name</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">Type</th>
<th></th>
</tr></thead>
<tbody class="divide-y divide-slate-200">
@forelse ($departments as $department)
<tr>
<td class="px-4 py-3 text-sm">{{ $department->name }}</td>
<td class="px-4 py-3 text-sm">{{ $department->branch?->name }}</td>
<td class="px-4 py-3 text-sm">{{ $types[$department->type] ?? $department->type }}</td>
<td class="px-4 py-3 text-right"><a href="{{ route('qms.departments.edit', $department) }}" class="text-sm text-indigo-600">Edit</a></td>
</tr>
@empty
<tr><td colspan="4" class="px-6 py-12 text-center text-sm text-slate-500">No departments.</td></tr>
@endforelse
</tbody>
</table>
</div>
</div>
</x-app-layout>