@extends('layouts.admin') @section('title', 'Dashboard') @section('heading', 'Work flow dashboard') @section('breadcrumb') @endsection @section('content') @php $cards = [ ['label' => 'Inbox', 'value' => $stats['inbox'], 'url' => route('admin.workflow.index', ['tab' => 'inbox']), 'color' => '#4d9eed'], ['label' => 'Created by me', 'value' => $stats['sent'], 'url' => route('admin.workflow.index', ['tab' => 'sent']), 'color' => '#7c4dff'], ['label' => 'Sent back', 'value' => $stats['sent_back'], 'url' => route('admin.workflow.index', ['tab' => 'sent_back']), 'color' => '#e0a045'], ['label' => 'Completed', 'value' => $stats['completed'], 'url' => route('admin.workflow.index', ['tab' => 'completed']), 'color' => '#3cba6f'], ['label' => 'Overdue', 'value' => $stats['overdue'], 'url' => route('admin.workflow.index'), 'color' => '#e95f71'], ['label' => 'High or urgent', 'value' => $stats['urgent_open'], 'url' => route('admin.workflow.index'), 'color' => '#ff6b6b'], ]; $barColors = [ 'in_progress' => '#4d9eed', 'pending' => '#8d939c', 'sent_back' => '#e0a045', 'completed' => '#3cba6f', 'cancelled' => '#6c727a', ]; $shortLabels = [ 'in_progress' => 'In progress', 'pending' => 'Pending', 'sent_back' => 'Sent back', 'completed' => 'Completed', 'cancelled' => 'Cancelled', ]; $chartLabels = []; $chartColors = []; foreach ($statusChart as $row) { $chartLabels[] = $shortLabels[$row['key']] ?? $row['label']; $chartColors[] = $barColors[$row['key']] ?? '#4d9eed'; } @endphp
@foreach($cards as $card) {{ $card['label'] }} {{ $card['value'] }} @endforeach
Tasks by status
@foreach($statusChart as $row) @php $color = $barColors[$row['key']] ?? '#4d9eed'; $width = $statusMax > 0 ? round(($row['total'] / $statusMax) * 100) : 0; @endphp
{{ $shortLabels[$row['key']] ?? $row['label'] }}
{{ $row['total'] }}
@endforeach
Status mix
Waiting on you
@include('admin.workflow.partials.task_table', ['tasks' => $inboxTasks, 'empty' => 'Nothing is waiting on you.', 'compact' => true])
Recent tasks
@include('admin.workflow.partials.task_table', ['tasks' => $recent, 'empty' => 'No tasks yet.', 'compact' => true])
@endsection @push('scripts') @endpush