{{-- Open — one employee, a tab per concern. Obvizio's user edit page, over Worklance data (see Admin\UserProfileController). Each tab saves on its own. --}} @extends('layouts.app') @php $initials = collect(preg_split('/\s+/', trim($user->name))) ->filter()->take(2)->map(fn ($p) => mb_strtoupper(mb_substr($p, 0, 1)))->implode(''); $inactive = $user->status === \App\Support\EmployeeStatus::INACTIVE; $lastSeen = $activity['last_seen']; $presence = 'bg-secondary'; if ($lastSeen) { $mins = $lastSeen->diffInMinutes(now()); $presence = $mins <= 15 ? 'bg-green' : ($mins <= 60 ? 'bg-yellow' : 'bg-secondary'); } $role = $user->roles->first(); // key => [label, Tabler icon, accent, applies to this person] $tabs = [ 'overview' => ['Overview', 'ti-home', 'var(--tblr-primary)', true], 'profile' => ['Profile', 'ti-user', 'var(--tblr-azure)', true], 'placement' => ['Placement', 'ti-briefcase', 'var(--tblr-indigo)', true], 'teams' => ['Teams', 'ti-users-group', 'var(--tblr-purple)', true], 'access' => ['Access', 'ti-lock', 'var(--tblr-orange)', true], 'schedule' => ['Schedule', 'ti-calendar-time', 'var(--tblr-teal)', true], 'activity' => ['Activity', 'ti-activity', 'var(--tblr-lime)', true], ]; @endphp @section('header')
Administration · Users

{{ $user->name }}

All users
@endsection @section('content') {{-- Hero ---------------------------------------------------------------- --}}
{{ $initials ?: '?' }}
{{ $user->name }} {{ $user->designation ?: 'No position' }} @if ($user->department) · {{ $user->department }} @endif · {{ $user->email }} {{ $inactive ? 'Inactive' : 'Active' }} @if ($label = $user->accessLabel()) {{ $label }} @endif @if ($user->workspace_role) {{ $user->workspace_role }} @endif @if ($user->employee_id) {{ $user->employee_id }} @endif {{ $user->isWorkspaceSourced() ? 'Workspace' : 'Native' }} @if ($user->company) {{ $user->company->name }} @endif
@if (auth()->user()->canAccess(\App\Support\Permissions::QUICK_LOGIN) && ! $user->isSuperAdmin() && ! $user->is(auth()->user())) @php $quickLoginRefusal = \App\Support\Impersonation::refusal(auth()->user(), $user); @endphp
@csrf {{-- A disabled button swallows hover, so the reason rides on the wrapper. --}}
@endif @if (auth()->user()->canAccess(\App\Support\Permissions::SCREENSHOTS)) Screenshots @endif @if (auth()->user()->canAccess(\App\Support\Permissions::TIMESHEET)) Timesheet @endif
@if ($errors->any())
@foreach ($errors->all() as $error)
{{ $error }}
@endforeach
@endif {{-- Tabs ---------------------------------------------------------------- --}}

Manage user

@foreach ($tabs as $key => [$label, $icon, $accent, $applies]) @continue(! $applies) {{ $label }} @endforeach
@foreach ($tabs as $key => [$label, $icon, $accent, $applies]) @continue(! $applies)
@include('admin.users.tabs._' . $key)
@endforeach
@endsection @push('styles') @endpush @push('scripts') @endpush