{{ trans('admin.user_details') }}

{{ trans('admin.detailed_profile_description') }} {{ $user->name }}

@if (isset($editUrl)) {{ trans('admin.edit') }} @endif @if (isset($toggleUrl))
@csrf
@endif
@if ($user->profile_photo) {{ $user->name }} @else
@endif

{{ $user->name }}

{{ $user->email }}

{{ ucfirst($user->role ?? 'employer') }} @if ($user->hasDepartment()) {{ $user->getDepartment() }} @endif
{{ trans('admin.phone') }}
{{ $user->phone ?? '-' }}
{{ trans('admin.joined') }}
{{ $user->created_at ? $user->created_at->format('M j, Y') : '-' }}
{{ trans('admin.last_login') }}
{{ $user->last_login_at ? $user->last_login_at->diffForHumans() . ' (' . $user->last_login_at->format('M j, Y H:i') . ')' : trans('admin.never') }}
{{ trans('admin.status') }}
@if ($user->is_active) {{ trans('admin.active') }} @else {{ trans('admin.suspended') }} @endif
@if (!$user->is_active && $user->suspension_reason)
{{ trans('admin.suspension_reason') }}
{{ $user->suspension_reason }}
@if ($user->suspension_end_date)

{{ trans('admin.ends') }}: {{ $user->suspension_end_date->format('M j, Y') }}

@endif
@endif

{{ trans('admin.recent_activity') }}

{{ trans('admin.showing_latest_5') }}
@php $recent = $recentSubmissions ?? ($user->relationLoaded('submissions') ? $user->submissions->sortByDesc('created_at')->take(5) : $user->submissions()->latest()->take(5)->get()); @endphp @if ($recent && $recent->count()) @foreach ($recent as $sub)
S

{{ $sub->name ?? ($sub->email ?? 'Submission') }}

{{ $sub->created_at ? $sub->created_at->diffForHumans() : '-' }}

@if (isset($sub->pdf_path) && $sub->pdf_path) {{ trans('admin.view') }} @else - @endif
@endforeach @else
{{ trans('admin.no_recent_activity') }}
@endif

{{ trans('admin.danger_zone') }}

{{ trans('admin.danger_zone_description') }}

{{ trans('admin.account_actions') }}

{{ trans('admin.account_actions_description') }}

@php $currentEmployer = auth()->user(); $canToggle = false; if ($currentEmployer) { if ($currentEmployer->isSuperAdmin()) { $canToggle = $currentEmployer->id !== $user->id && !$user->isSuperAdmin(); } elseif ($currentEmployer->isDepartmentAdmin()) { $canToggle = $currentEmployer->id !== $user->id && !$user->isSuperAdmin() && $user->isEmployer() && $user->department_id === $currentEmployer->department_id; } } @endphp
{{-- DEMOTE (only superadmin can demote department admins) --}} @if (auth()->user()->isSuperAdmin() && $user->isDepartmentAdmin()) @endif {{-- PROMOTE (only superadmin can promote non-admins) --}} @if (auth()->user()->isSuperAdmin() && !$user->isDepartmentAdmin() && auth()->id() !== $user->id && !$user->isSuperAdmin()) @endif {{-- SUSPEND/ACTIVATE (based on permissions) --}} @if ($canToggle) @endif {{-- SUPERADMIN: Reset password for department_admin / employer --}} @if (auth()->user()->isSuperAdmin() && auth()->id() !== $user->id && !$user->isSuperAdmin()) @endif
{{-- DEMOTE MODAL --}} @if (auth()->user()->isSuperAdmin() && $user->isDepartmentAdmin()) @endif {{-- PROMOTE MODAL --}} @if (auth()->user()->isSuperAdmin() && !$user->isDepartmentAdmin() && auth()->id() !== $user->id && !$user->isSuperAdmin()) @endif {{-- TOGGLE / SUSPEND MODAL --}} @if ($canToggle) @endif {{-- RESET PASSWORD MODAL --}} @if (auth()->user()->isSuperAdmin() && auth()->id() !== $user->id && !$user->isSuperAdmin()) @endif