@extends('layouts.app') @section('title', 'Staff Directory') @section('page-title', 'Staff Directory & Contacts') @section('content') @php $isAdmin = auth()->user()->role === 'admin'; @endphp
@if(session('success'))
{{ session('success') }}
@endif {{-- Header --}}

{{ $totalStaff }} staff members

@if($isAdmin) @endif
{{-- School Contact Card --}}

{{ $schoolSettings['school_name'] ?? 'School Name' }}

{{ $schoolSettings['school_address'] ?? '' }}

@if(!empty($schoolSettings['school_phone']))

Phone

{{ $schoolSettings['school_phone'] }}

@endif @if(!empty($schoolSettings['school_email']))

Email

{{ $schoolSettings['school_email'] }}

@endif
{{-- Staff grouped by category --}} @forelse($orderedStaff as $category => $members)

{{ \App\Models\StaffDirectory::categoryLabel($category) }}

{{ $members->count() }} {{ $members->count() === 1 ? 'member' : 'members' }}

@foreach($members as $staff)
{{-- Avatar --}}
{{ strtoupper(substr($staff->name, 0, 1)) }}{{ strtoupper(substr(explode(' ', $staff->name)[1] ?? '', 0, 1)) }}
{{-- Info --}}

{{ $staff->name }}

@if($staff->department) {{ $staff->department }} @endif

{{ $staff->designation }}

@if($staff->qualification)

{{ $staff->qualification }}

@endif
{{-- Contact --}}
@if($staff->show_phone && $staff->phone) {{ $staff->phone }} @endif @if($staff->show_email && $staff->email) Email @endif @if($isAdmin)
@csrf @method('DELETE')
@endif
@endforeach
@empty

No staff members in directory yet.

@if($isAdmin)

Click "Add Staff" to start building the directory.

@endif
@endforelse
{{-- Add Staff Modal (Admin only) --}} @if($isAdmin) @endif @endsection