@extends('layouts.master') @section('title', 'Diary Dashboard') @push('styles') @endpush @section('content') {{-- Add Entry Modal (before content) --}} {{-- Task View Modal --}}
{{-- Breadcrumb --}} {{-- Header --}}

Diary Dashboard

{{ now()->format('D, d M Y') }}task & schedule overview
{{-- Alerts --}} @if(session('success')) @endif @if(session('error')) @endif @if(($overdueCount ?? 0) > 0) @endif {{-- Stat Cards --}}
{{ $todayCount ?? 0 }}
Today's Entries
View today
{{ $upcomingCount ?? 0 }}
Upcoming Entries
View upcoming
{{ $overdueCount ?? 0 }}
Overdue Entries
Needs attention
{{ $totalCount ?? 0 }}
Total Entries
View all
{{-- Main Grid --}}
{{-- Daily Tasks --}}
Daily Tasks
{{ optional($selectedDate ?? null)->format('D, d M Y') ?? now()->format('D, d M Y') }}
@if(isset($dailyEntries) && $dailyEntries->count() > 0)
@foreach($dailyEntries as $entry) @php $entryType = $entry['type'] ?? 'contextual'; $entryId = $entry['id'] ?? null; $taskTitle = $entry['title'] ?? 'Untitled'; $priority = $entry['priority'] ?? 'medium'; $status = $entry['status'] ?? 'pending'; $showUrl = $entryId ? route('modules.processing.diary.entry.show', ['type' => $entryType, 'id' => $entryId]) : '#'; $editUrl = $entryId ? route('modules.processing.diary.entry.edit', ['type' => $entryType, 'id' => $entryId]) : '#'; $printUrl = $entryId ? route('modules.processing.diary.entry.print', ['type' => $entryType, 'id' => $entryId]) : '#'; $destroyUrl = $entryId ? route('modules.processing.diary.entry.destroy', ['type' => $entryType, 'id' => $entryId]) : '#'; $payload = [ 'title' => $taskTitle, 'date' => $entry['formatted_date'] ?? '—', 'time' => $entry['formatted_time'] ?? '—', 'task_type' => $entry['task_type'] ?? null, 'client_case' => $entry['client_case'] ?? null, 'priority' => $priority, 'status' => $status, 'notes' => $entry['notes'] ?? null, 'showUrl' => $showUrl, 'editUrl' => $editUrl, 'printUrl' => $printUrl, 'destroyUrl' => $destroyUrl, ]; @endphp @endforeach
Date / Time Task Priority Status Actions
{{ $entry['formatted_date'] ?? '—' }}
{{ $entry['formatted_time'] ?? '—' }}
{{ Str::limit($taskTitle, 46) }}
{{ $entryType === 'quick' ? 'Quick' : ucwords(str_replace('-', ' ', $entry['task_type'] ?? 'Task')) }} @if(!empty($entry['client_case'])) — {{ Str::limit($entry['client_case'], 34) }} @endif
@if($priority == 'high') High @elseif($priority == 'medium') Medium @else Low @endif @php $s = $status; @endphp @if($s == 'completed') Completed @elseif($s == 'in-progress') In Progress @elseif($s == 'pending') Pending @else {{ ucfirst($s) }} @endif
@if($entryId)
@csrf @method('PATCH')
@endif
@csrf @method('DELETE')
@else

No tasks for this day

Add an entry to start tracking your daily tasks.

Add First Entry
@endif
{{-- Sidebar --}}
Completion Rate {{ $completionRate ?? 0 }}%
{{ $completedCount ?? 0 }} completed {{ $totalCount ?? 0 }} total
This Week Last 7 days
Status Breakdown
Task Distribution
@php $taskTypes = ['meeting','draft-review','call','follow-up','internal-task','assignment','other']; $typeCounts = []; foreach($taskTypes as $type) { $typeCounts[$type] = \App\Models\Diary::where('task_type', $type)->count(); } $maxCount = max(array_values($typeCounts) ?: [1]); $hasAny = collect($typeCounts)->sum() > 0; @endphp @if($hasAny) @foreach($taskTypes as $type) @if($typeCounts[$type] > 0)
{{ ucwords(str_replace('-',' ',$type)) }} {{ $typeCounts[$type] }}
@endif @endforeach @else

No task data available yet.

@endif
@endsection @push('scripts') @endpush