{{-- ================== وضع القائمة ================== --}} @if ($mode === 'list')

إدارة المهام

@if($canCreate) @endif
@forelse ($tasks as $t) @php $s = $statuses[$t->status] ?? ['label' => $t->status, 'class' => 'kt-badge-outline']; $catLabel = $categories[$t->category] ?? $t->category; @endphp @empty @endforelse
# رقم المهمة التصنيف العنوان الحالة التاريخ الإجراء
{{ $t->id }} {{ $t->task_number }} {{ $catLabel }} {{ \Illuminate\Support\Str::limit($t->title, 50) }} {{ $s['label'] }} {{ $t->created_at->timezone('Asia/Riyadh')->format('Y-m-d H:i') }}
لا توجد مهام.
{{-- ================== وضع التفاصيل ================== --}} @elseif ($mode === 'detail' && $currentTask) @php $s = $statuses[$currentTask['status']] ?? ['label' => $currentTask['status'], 'class' => 'kt-badge-outline']; $catLabel = $categories[$currentTask['category']] ?? $currentTask['category']; $comments = $currentTask['comments'] ?? []; $attachments = $currentTask['attachments'] ?? []; @endphp

تفاصيل المهمة #{{ $currentTask['task_number'] }}

@if($canCreate) @endif
{{-- العمود الرئيسي --}}
{{-- بيانات المهمة (للمدير فقط) --}} @if($isManager)

بيانات المهمة

رقم المهمة
{{ $currentTask['task_number'] }}
التصنيف
{{ $catLabel }}
الحالة
{{ $s['label'] }}
تاريخ الإنشاء
{{ \Carbon\Carbon::parse($currentTask['created_at'])->timezone('Asia/Riyadh')->format('Y-m-d H:i') }}
أنشئت بواسطة
{{ $currentTask['creator_name'] }}
العنوان
{{ $currentTask['title'] }}
الوصف
{{ $currentTask['description'] }}
@if($currentTask['client_name'] || $currentTask['client_email'] || $currentTask['client_phone'])
بيانات العميل
@if($currentTask['client_name'])
اسم العميل
{{ $currentTask['client_name'] }}
@endif @if($currentTask['client_email'])
البريد
{{ $currentTask['client_email'] }}
@endif @if($currentTask['client_phone'])
الهاتف
{{ $currentTask['client_phone'] }}
@endif
@endif
@else {{-- عرض مختصر لمنشئ المهمة --}}

المهمة #{{ $currentTask['task_number'] }}

العنوان
{{ $currentTask['title'] }}
الحالة: {{ $s['label'] }}
@endif {{-- التعليقات (يشوفها الكل) --}}

التعليقات

@if(count($comments) > 0)
@foreach($comments as $comment)
{{ $comment['user'] ?? '—' }} {{ $comment['date'] ?? '' }}
{{ $comment['text'] ?? '' }}
@if(!empty($comment['attachment_name'])) @endif
@endforeach
@else
لا توجد تعليقات بعد.
@endif {{-- إضافة تعليق (الكل يقدر) --}}
@error('newComment'){{ $message }}@enderror
جاري الإضافة...
{{-- المرفقات (الكل يشوفها ويقدر يرفق) --}}

المرفقات

@if(count($attachments) > 0)
@foreach($attachments as $idx => $att)
{{ $att['name'] ?? 'مرفق' }} {{ $att['user'] ?? '' }} - {{ $att['date'] ?? '' }} @if(!empty($att['size'])) - {{ number_format($att['size'] / 1024, 0) }} KB @endif
@if($isManager) @endif
@endforeach
@else
لا توجد مرفقات.
@endif {{-- رفع مرفق جديد --}}
@error('attachment'){{ $message }}@enderror
جاري تحميل الملف...
جاري رفع المرفق...
الحد الأقصى 10 ميجابايت
{{-- العمود الجانبي --}}
{{-- ملخص سريع --}}

ملخص سريع

رقم المهمة {{ $currentTask['task_number'] }}
التصنيف {{ $catLabel }}
الحالة {{ $s['label'] }}
أنشئت بواسطة {{ $currentTask['creator_name'] }}
التعليقات {{ count($comments) }}
المرفقات {{ count($attachments) }}
{{-- إدارة الحالة (مدراء المهام فقط) --}} @if($isManager)

تغيير الحالة

@if($currentTask['status'] !== 'in_progress') @endif @if($currentTask['status'] !== 'pending_reply') @endif @if($currentTask['status'] !== 'escalated') @endif @if($currentTask['status'] !== 'completed') @endif @if($currentTask['status'] !== 'new') @endif
جاري تحديث الحالة...
@endif
{{-- ================== وضع الإنشاء ================== --}} @elseif ($mode === 'create')

إنشاء مهمة جديدة

@error('newCategory'){{ $message }}@enderror
@error('newTitle'){{ $message }}@enderror
@error('newDescription'){{ $message }}@enderror
بيانات العميل (اختياري)
@error('newClientName'){{ $message }}@enderror
@error('newClientEmail'){{ $message }}@enderror
@error('newClientPhone'){{ $message }}@enderror
جاري إنشاء المهمة...
@endif