{{-- "Mes tâches" — cross-project task list for the current person, with tabs (Aujourd'hui / En retard / À venir / À valider / Inbox), all backed by real queries (see the "Mes tâches" data-retrieval section of Dashboard.php and HasMyTaskLists). $activeTaskTab, $myElements and the todoTasks()/todoCount()/overdueCount()/ upcomingCount()/toValidateCount()/inboxCount()/toggleDone() methods all come from the page class (App\Filament\App\Pages\Dashboard), inherited into scope the same way every ambient variable is on ViewProject's partials. --}} @php $tabs = [ ['key' => 'todo', 'label' => 'Aujourd\'hui', 'count' => $this->todoCount()], ['key' => 'overdue', 'label' => 'En retard', 'count' => $this->overdueCount()], ['key' => 'upcoming', 'label' => 'À venir', 'count' => $this->upcomingCount()], ['key' => 'to_validate', 'label' => 'À valider', 'count' => $this->toValidateCount()], ['key' => 'inbox', 'label' => 'À ranger', 'count' => $this->inboxCount()], ]; $key_selected = array_search($activeTaskTab, array_column($tabs, 'todo')); @endphp @foreach ($tabs as $tab) @if ($activeTaskTab=== $tab['key']) {{ $tab['label'] }} @endif @endforeach @foreach ($tabs as $tab) $activeTaskTab === $tab['key'], 'text-gray-800 dark:text-gray-200' => $activeTaskTab !== $tab['key'], ]) > {{ $tab['label'] }} @endforeach
@forelse ($this->currentTabTasks() as $task) @php $isDone = $task->status->category === 'done'; $isToday = $task->due_date && ($task->due_date->toDateString() == Carbon\Carbon::today()->toDateString()); $isOverdue = $task->due_date && ($task->due_date->toDateString() <= Carbon\Carbon::today()->subDay()->toDateString()) && ! in_array($task->status->category, ['done', 'cancelled'], true); $projectColor = $task->projectColorOrNeutral(); @endphp
@php $isMeeting = $task->type->code === 'meeting'; $canToggleDone = ! $isMeeting || $task->meeting?->organizer_id === $this->currentPersonId(); @endphp @if ($canToggleDone) @else @endif @if (in_array($task->type->code, ['meeting'], true) && $task->meeting->starts_at != null) {{ $task->meeting->starts_at->format('H:i') }} @endif {{-- Same technique as today-task-row.blade.php: this flex-col/md:flex-row wrapper is what lets the badge/ date reflow onto their own line below `md`. The title row underneath is its own always-inline flex group (not responsive) so the type dot stays glued to the title on every breakpoint instead of wrapping onto its own line; it also carries the `flex-1` that used to live on the old spacer span, so the meta group below still lands flush against the row's right edge on desktop. --}}
$isDone, 'text-gray-700 dark:text-gray-200' => ! $isDone, ]) > {{ $task->title }} @if (in_array($task->type->code, ['chantier', 'milestone'], true)) @endif
@if (!$task->assignees->isNotEmpty()) Me l'assigner En cours @endif @if ($task->type->code === 'meeting' && $task->meeting?->organizer) @php $color = $task->meeting->organizer->avatar_color ?? '#9CA3AF'; @endphp {{ $task->meeting->organizer->initials ?? '?' }} @endif @if ($projectColor) {{ $task->projectCodeOrUnfiled() }} @else {{ $task->projectCodeOrUnfiled() }} @endif $isOverdue, 'text-gray-400 dark:text-gray-500' => ! $isOverdue, ]) > {{ $this->relativeDateLabel($task->due_date) ?? '—' }}
@empty
Aucune tâche à faire — bien joué 🎉
@endforelse