Files
ladill-queue/resources/views/qms/admin/branches/index.blade.php
T
isaacclad 26c9edc131
Deploy Ladill Queue / deploy (push) Successful in 50s
Nest Branches and Team under Settings as Pro features.
Match Frontdesk: settings cards and nested routes, Pro-gated access,
and legacy /admin redirects to /settings/branches and /settings/team.
2026-07-16 09:48:32 +00:00

51 lines
2.6 KiB
PHP

@php
$canManageBranches = app(\App\Services\Qms\QmsPermissions::class)->can(
app(\App\Services\Qms\OrganizationResolver::class)->memberFor(auth()->user()),
'admin.branches.manage'
);
$canViewTeam = app(\App\Services\Qms\QmsPermissions::class)->can(
app(\App\Services\Qms\OrganizationResolver::class)->memberFor(auth()->user()),
'admin.members.view'
);
@endphp
<x-app-layout title="Branches">
<x-settings.page title="Branches" description="Organize locations and sites so queues, counters, and staff stay scoped to the right branch.">
<div class="mb-4 flex flex-wrap items-center justify-between gap-3">
<div class="flex flex-wrap items-center gap-2 text-sm">
<a href="{{ route('qms.settings.edit') }}" class="text-slate-500 hover:text-slate-800">Settings</a>
<span class="text-slate-300">/</span>
<span class="font-medium text-slate-900">Branches</span>
@if ($canViewTeam)
<a href="{{ route('qms.members.index') }}" class="ml-3 text-indigo-600 hover:text-indigo-800">Team</a>
@endif
</div>
@if ($canManageBranches)
<a href="{{ route('qms.branches.create') }}" class="btn-primary">Add branch</a>
@endif
</div>
@include('partials.flash')
<x-settings.card title="All branches" description="{{ number_format($heroStats['total']) }} total · {{ number_format($heroStats['active']) }} active · {{ number_format($heroStats['departments']) }} department(s)">
@forelse ($branches as $branch)
<div class="flex items-center justify-between gap-4 border-b border-slate-50 py-3 last:border-b-0">
<div>
<p class="font-medium text-slate-900">{{ $branch->name }}</p>
<p class="text-sm text-slate-500">
{{ $branch->code ?? 'No code' }}
· {{ $branch->departments_count }} department(s)
· {{ $branch->is_active ? 'Active' : 'Inactive' }}
</p>
</div>
@if ($canManageBranches)
<a href="{{ route('qms.branches.edit', $branch) }}" class="text-sm font-medium text-indigo-600 hover:text-indigo-800">Edit</a>
@endif
</div>
@empty
<p class="text-sm text-slate-500">No branches yet.</p>
@endforelse
</x-settings.card>
</x-settings.page>
</x-app-layout>