@extends('staff.layouts.app') @section('content') {{-- ✅ MAIN CONTAINER: pb-40 ensures content scrolls above the fixed reply bar --}}
{{-- ══ Compact Header ══ --}}

Homework Details

{{-- Flash Messages --}} @if(session('success'))
{{ session('success') }}
@endif @if(session('error'))
{{ session('error') }}
@endif {{-- ══ Main Card ══ --}}
{{ $homework->status }} {{ \Carbon\Carbon::parse($homework->created_at)->format('d M, Y h:i A') }}

{{ $homework->title ?: 'Untitled Broadcast' }}

{{ substr($homework->staff_name, 0, 1) }}

{{ $homework->staff_name }}

{{ $homework->designation }}

{{ $homework->message }}
@if(!empty($homework->attachments_list))

Attached Photos

@foreach($homework->attachments_list as $photo)
@endforeach
@endif
{{-- ══ Action Buttons ══ --}} @php $canEdit = $homework->status == 'pending' && ($isReviewer || $homework->sender_staff_id == session('staff_id')); $canReview = $isReviewer && $homework->status == 'pending'; $canDelete = $isReviewer && $homework->status == 'published'; @endphp @if($canEdit || $canReview || $canDelete)
@if($canEdit) Edit @endif @if($canReview)
@csrf @method('PATCH')
@csrf @method('PATCH')
@endif @if($canDelete)
@csrf @method('DELETE')
@endif
@endif {{-- ══ Targeted Audience ══ --}}

Targeted Audience ({{ $targets->count() }})

@if($targets->count() > 3) @endif
@foreach($targets as $index => $t) = 3) style="display:none;" @endif> @if($t->student_name) {{ $t->student_name }} @else {{ $t->class_name }} {{ $t->section_name ? '- '.$t->section_name : '' }} @endif @endforeach
@if($targets->count() > 3) @endif
{{-- ✅ CONVERSATION THREAD --}}

Communication Thread

@forelse($replies as $reply) @php $isTeacher = !empty($reply->staff_id); @endphp
{{ $isTeacher ? substr($reply->teacher_name ?? 'T', 0, 1) : substr($reply->student_name ?? 'S', 0, 1) }}

{{ $reply->message }}

@if($reply->attachment) Attachment @endif

{{ $isTeacher ? 'You' : $reply->student_name }} • {{ \Carbon\Carbon::parse($reply->created_at)->format('h:i A') }}

@empty

No replies yet.

@endforelse
{{-- ✅ FIXED REPLY BAR — Matches layout max-w-[420px] exactly --}}
@csrf
{{-- ══ DELETE CONFIRMATION POPUP (ONLY ONCE) ══ --}} @if($canDelete) @endif @endsection