diff --git a/resources/views/dashboard.blade.php b/resources/views/dashboard.blade.php index bf91c95..62f4ac3 100644 --- a/resources/views/dashboard.blade.php +++ b/resources/views/dashboard.blade.php @@ -1,359 +1,131 @@

- {{ __('Dashboard') }} + {{ __('Home') }}

-
+
- {{-- ============================================================ - ROW 1: Project stats (4 columns) - ============================================================ --}} -
+ {{-- Saludo --}} +
+

Hola, {{ $user?->first_name ?? auth()->user()->name }}

+

Un resumen rápido de lo tuyo.

+
- {{-- Proyectos activos --}} - -
-
-
-

Proyectos activos

-

- {{ $stats['active_projects'] }} - / {{ $stats['total_projects'] }} -

-
-
- -
+
+ + {{-- ───────────── Mis proyectos ───────────── --}} +
+ - - - {{-- Avance global --}} -
-
-
-
-

Avance global

-

{{ $stats['global_progress'] }}%

-
-
+ @forelse($projects as $project) + @php $pct = round($project->phases->avg('progress_percent') ?? 0); @endphp + +
+
{{ $project->name }}
+
-
-
- -
-
+ {{ $pct }}% + + @empty +

No tienes proyectos asignados.

+ @endforelse
- {{-- Fases con retraso --}} -
-
-
-
-

Fases con retraso

-

- {{ $stats['delayed_phases'] }} -

- @if($stats['delayed_phases'] > 0) -

Requiere atención

- @else -

Sin retrasos

+ {{-- ───────────── Mis tareas ───────────── --}} + + + @empty +

No tienes tareas pendientes. 🎉

+ @endforelse
- {{-- Elementos totales --}} -
-
-
-
-

Elementos totales

-

{{ $stats['total_features'] }}

-

{{ $stats['total_phases'] }} fases

-
-
- -
-
+ {{-- ───────────── Mis incidencias ───────────── --}} +
+
+

+ Incidencias asignadas + {{ $myIssuesCount }} +

+ @forelse($myIssues as $issue) + @php + $sLabel = ['open'=>'Abierto','in_review'=>'En revisión'][$issue->status] ?? $issue->status; + @endphp + +   +
+
{{ $issue->title }}
+
{{ $issue->project?->name ?? '—' }}
+
+ {{ $sLabel }} +
+ @empty +

No tienes incidencias asignadas.

+ @endforelse +
+
+ + {{-- ───────────── Notificaciones ───────────── --}} +
+
+

+ Notificaciones + @if($unreadCount){{ $unreadCount }}@endif +

+ @forelse($notifications as $note) + @php + $d = $note->data; + $url = (isset($d['project_id'], $d['issue_id'])) + ? route('projects.issues.show', [$d['project_id'], $d['issue_id']]) + : null; + @endphp + + +
+
{{ $d['message'] ?? 'Notificación' }}
+
{{ $note->created_at->diffForHumans() }}
+
+
+ @empty +

Sin notificaciones.

+ @endforelse
- - {{-- ============================================================ - ROW 2: Issues & Inspections (4 columns) - ============================================================ --}} -
- - {{-- Issues abiertos --}} -
-
-
-
-

Issues abiertos

-

{{ $stats['open_issues'] }}

- @if($stats['critical_issues'] > 0) -

{{ $stats['critical_issues'] }} críticos

- @else -

0 críticos

- @endif -
-
- -
-
-
-
- - {{-- Inspecciones pendientes --}} -
-
-
-
-

Insp. pendientes

-

{{ $stats['pending_inspections'] }}

-

Por realizar

-
-
- -
-
-
-
- - {{-- Inspecciones completadas --}} -
-
-
-
-

Insp. completadas

-

{{ $stats['completed_inspections'] }}

-

Aprobadas

-
-
- -
-
-
-
- - {{-- Inspecciones rechazadas --}} -
-
-
-
-

Insp. rechazadas

-

- {{ $stats['rejected_inspections'] }} -

-

Requieren revisión

-
-
- -
-
-
-
- -
- - {{-- ============================================================ - MAIN CONTENT: Two-column layout - ============================================================ --}} -
- - {{-- LEFT COLUMN (2/3): Recent projects --}} -
-
-
-
-

Proyectos recientes

- - Ver todos - -
- - @if($recentProjects->isEmpty()) -
- -

No hay proyectos disponibles

-
- @else -
- @foreach($recentProjects as $project) - @php - $avg = $project->phases->avg('progress_percent') ?? 0; - $statusConfig = match($project->status) { - 'in_progress' => ['badge' => 'badge-primary', 'bar' => 'bg-blue-500', 'label' => 'En progreso'], - 'completed' => ['badge' => 'badge-success', 'bar' => 'bg-green-500', 'label' => 'Completado'], - 'paused' => ['badge' => 'badge-warning', 'bar' => 'bg-yellow-500', 'label' => 'Pausado'], - 'planning' => ['badge' => 'badge-ghost', 'bar' => 'bg-gray-400', 'label' => 'Planificación'], - default => ['badge' => 'badge-ghost', 'bar' => 'bg-gray-400', 'label' => ucfirst(str_replace('_', ' ', $project->status))], - }; - @endphp -
-
-

- {{ $project->name }} -

- - {{ $statusConfig['label'] }} - -
- -
- - {{ $project->phases_count }} {{ $project->phases_count === 1 ? 'fase' : 'fases' }} -
- -
-
- Progreso - {{ round($avg) }}% -
-
-
-
-
- - -
- @endforeach -
- @endif -
-
-
- - {{-- RIGHT COLUMN (1/3): Issues + Inspections --}} -
- - {{-- Issues recientes --}} -
-
-
-

Issues recientes

- -
- - @if(isset($recentIssues) && $recentIssues->isNotEmpty()) -
- @foreach($recentIssues as $issue) - @php - $priorityConfig = match($issue->priority ?? 'medium') { - 'critical' => ['badge' => 'badge-error', 'label' => 'Crítico'], - 'high' => ['badge' => 'badge-warning', 'label' => 'Alto'], - 'medium' => ['badge' => 'badge-info', 'label' => 'Medio'], - 'low' => ['badge' => 'badge-ghost', 'label' => 'Bajo'], - default => ['badge' => 'badge-ghost', 'label' => ucfirst($issue->priority ?? '')], - }; - @endphp -
-
-
- {{ $priorityConfig['label'] }} -
-

{{ $issue->title }}

-

- @if($issue->feature) - {{ $issue->feature->name }} - @elseif($issue->project) - {{ $issue->project->name }} - @endif -

- @if($issue->reporter) -

- {{ $issue->reporter->name }} -

- @endif -
-
- @endforeach -
- @else -
- -

Sin issues abiertos

-
- @endif -
-
- - {{-- Inspecciones recientes --}} -
-
-
-

Inspecciones recientes

- -
- - @if($recentInspections->isNotEmpty()) -
- @foreach($recentInspections as $inspection) - @php - $inspStatusConfig = match($inspection->status ?? 'pending') { - 'completed' => ['badge' => 'badge-success', 'label' => 'Completada'], - 'pending' => ['badge' => 'badge-warning', 'label' => 'Pendiente'], - 'rejected' => ['badge' => 'badge-error', 'label' => 'Rechazada'], - 'in_progress' => ['badge' => 'badge-info', 'label' => 'En curso'], - default => ['badge' => 'badge-ghost', 'label' => ucfirst($inspection->status ?? '')], - }; - @endphp -
-
-
-

- {{ $inspection->template?->name ?? 'Inspección' }} -

- {{ $inspStatusConfig['label'] }} -
- @if($inspection->feature) -

- {{ $inspection->feature->name }} -

- @elseif($inspection->project) -

- {{ $inspection->project->name }} -

- @endif -

{{ $inspection->created_at->diffForHumans() }}

-
-
- @endforeach -
- @else -
- -

Sin inspecciones recientes

-
- @endif -
-
- -
- {{-- end right column --}} - -
- {{-- end main content --}} -
diff --git a/resources/views/livewire/layout/navigation.blade.php b/resources/views/livewire/layout/navigation.blade.php index ff34331..d9b101d 100644 --- a/resources/views/livewire/layout/navigation.blade.php +++ b/resources/views/livewire/layout/navigation.blade.php @@ -33,7 +33,7 @@ new class extends Component @@ -114,7 +114,7 @@ new class extends Component