{{-- One users table, rendered once per tab. @param \Illuminate\Support\Collection $rows @param string $kind 'workspace' | 'native' — only changes the empty state, since the tab itself already says which kind these are (that's why there's no Source column any more). --}}
@forelse ($rows as $user) @empty @endforelse
Name Email Role Access Timesheet Total Activity
{{-- `form=` rather than wrapping the table: each row's actions cell already contains a delete
, and nested forms are invalid HTML (the browser drops the inner one). This binds the box to the footer form sitting outside the table. --}}
{{ $user->name }} {{-- Only reachable via the All / Inactive filter, so the badge is the whole reason the row is visible. --}} @if ($user->status === \App\Support\EmployeeStatus::INACTIVE) Inactive @endif {{-- Mirrored from the workspace; blank for native accounts. --}} @if ($user->designation || $user->department)
{{ collect([$user->designation, $user->department])->filter()->implode(' · ') }}
@endif
{{ $user->email }} {{ $user->roles->first()?->label ?? $user->roles->first()?->name ?? '—' }} {{-- Access is the role; this says what it amounts to. --}} @if ($user->isSuperAdmin()) Super Admin @elseif ($user->canUsePortal()) @php $everyone = $user->canAccess(\App\Support\Permissions::VIEW_ALL); @endphp Portal · {{ $everyone ? 'everyone' : ($user->canAccess(\App\Support\Permissions::VIEW_TEAM) ? 'their teams' : 'self') }} @else Desktop @endif {{-- A switch rather than a badge: it is flicked from the list, and posts on change so there is nothing to save. --}} @csrf @method('PATCH') @php $totalSec = (int) ($user->time_intervals_sum_active_seconds ?? 0); @endphp {{ \App\Support\Duration::hhmm($totalSec) }} Open @if ($kind === 'workspace') {{-- Diagnosis: what is this employee's desktop showing, and has the workspace moved on since it synced? --}} {{-- Opened declaratively (data-bs-toggle) like every other modal here: Tabler's bundle exposes no `bootstrap` global, so the JS API isn't available. --}} @endif
@if ($kind === 'workspace') No workspace users mirrored into this company yet — use “Sync Workspace Users”. @else No native users in this company yet — create one with “New User”. @endif
@if ($rows->isNotEmpty()) {{-- The target of every checkbox above (see the `form=` note there). One button for the whole tab rather than a Send Invite per row: people are onboarded a team at a time. Both buttons send the same ticked rows; Send Portal Invite goes to its own action via `formaction`. --}} @php $teamsReady = $activeCompany?->usesMicrosoft() && $activeCompany->hasMicrosoftBotConnected(); @endphp @endif