{{-- Aperçu — détail d'un projet (JOS-20), volet compact. Split en deux par `$isParticipant` : le bloc "commun à tous" (titre, statut, description, dates, participants) rend pour tout utilisateur authentifié (`ProjectPolicy::viewSummary()`), le reste (chantiers, métriques, commentaires) est réservé aux participants du projet — voir HasProjectDetail pour le détail de chaque règle. --}} @php $project = $this->project(); $isParticipant = $this->isParticipant(); $statusColor = match ($project->status) { 'active' => 'primary', 'on_hold' => 'warning', 'archived' => 'gray', default => 'gray', }; $statusLabel = match ($project->status) { 'draft' => 'Brouillon', 'active' => 'Actif', 'on_hold' => 'En pause', 'archived' => 'Archivé', }; @endphp
{{-- Favori et suivi côte à côte — voir `element-detail.blade.php`. --}}
@livewire('toggle-favorite', [ 'favoritableType' => \App\Models\Project::class, 'favoritableId' => $project->id, ], key('fav-project-'.$project->id)) @livewire('toggle-follow', [ 'followableType' => \App\Models\Project::class, 'followableId' => $project->id, ], key('follow-project-'.$project->id))
{{-- Titre + code + statut --}}

{{ $project->name }}

{{ $project->code }}
{{ $statusLabel }} {{-- Description — jamais éditable ici, même pour un owner (spec JOS-20). --}}
Description
@if ($project->description) {{-- `description` is stored as HTML (ProjectForm's field is a RichEditor, same as ProjectElement's). Sanitized at render time — Filament's own RichEditor docblock warns never to echo this raw, the wire payload can be forged by any client regardless of what the toolbar allows. No @tailwindcss/typography plugin installed, relies on the browser's own default styling for

/

{{-- Dates --}}
Début {{ $project->start_date?->translatedFormat('j M Y') ?? '—' }} Échéance {{ $project->target_end_date?->translatedFormat('j M Y') ?? '—' }}
{{-- Participants — visibles de tous, y compris les non-membres (spec JOS-20). --}}
Participants
@foreach ($project->people as $person)
{{ $person->initials }} {{ $person->full_name }} $person->pivot->role === 'owner', 'bg-warning-50 text-warning-700 dark:bg-warning-500/10 dark:text-warning-400' => $person->pivot->role === 'manager', 'bg-gray-100 text-gray-500 dark:bg-white/5 dark:text-gray-400' => ! in_array($person->pivot->role, ['owner', 'manager'], true), ]) > {{ $person->pivot->role }}
@endforeach
@if (! $isParticipant) {{-- Non-membre : uniquement les métriques agrégées + une demande d'accès en préparation. --}}
En chiffres
{{ $this->chantierCount() }}
chantiers
{{ $this->totalCount() }}
tâches au total
@else {{-- Participant : chantiers + métriques complètes. --}} @php $chantiers = $this->chantiers(); @endphp
Chantiers @if ($chantiers->isNotEmpty()) {{ $chantiers->count() }} @endif
@if ($chantiers->isEmpty())

Il n'y a pas de chantier défini sur ce projet.

@else
@foreach ($chantiers as $chantier) @endforeach
@endif
Mes tâches
{{ $this->myTodoCount() }}
à faire
{{ $this->myWaitingCount() }}
en attente
{{ $this->myBlockedCount() }}
bloqués
{{ $this->myOverdueCount() }}
en retard
Toutes les tâches
{{ $this->progressPercent() }}%
{{ $this->doneCount() }} / {{ $this->totalCount() }} terminées
{{-- `style="background-color: var(--primary-500)"`, not a `bg-primary-500` class: that exact unprefixed utility isn't used literally anywhere else in the app, so Tailwind never generated it into the compiled CSS — the bar rendered with a transparent fill. Every other dynamic-color bit in this app already goes through `var(--*-500)` for the same reason (see the chantier status dots above). --}}
{{ $this->blockedCount() }}
bloqués
{{-- Compteur cliquable vers la page projet — pas de fil ni de bouton "Ajouter" ici (demandé explicitement). La page projet elle-même n'a pas encore de section Commentaires (JOS-50, à venir) : ce lien pointe simplement sur le projet pour l'instant, et commencera à ancrer sur la section dès que JOS-50 l'ajoutera — aucun changement à refaire ici à ce moment-là. --}} @php $commentsCount = $this->commentsCount(); @endphp @if ($commentsCount > 0) {{ $commentsCount }} {{ $commentsCount > 1 ? 'commentaires' : 'commentaire' }} @endif @endif