@extends('admin.layouts.app') @section('title', __('admin.projects.title')) @section('content')
@foreach([''=>'All','pending'=>'Pending','in_progress'=>'In Progress','completed'=>'Completed','cancelled'=>'Cancelled'] as $val=>$label) {{ $label }} @endforeach
@forelse($projects as $project) @php $total=$project->tasks->count(); $done=$project->tasks->where('completed',true)->count(); $pct=$total>0?round($done/$total*100):0; $badgeClass = match($project->status) { 'completed'=>'badge-active', 'cancelled'=>'badge-cancelled', 'in_progress'=>'badge-open', default=>'badge-pending' }; @endphp @empty @endforelse
{{ __('admin.projects.title_col') }}{{ __('common.table.client') }}{{ __('common.table.status') }}{{ __('admin.projects.progress') }}{{ __('common.table.due_date') }}{{ __('common.table.actions') }}
{{ $project->title }} @if($project->description)
{{ Str::limit($project->description,60) }}
@endif
{{ $project->client?->full_name ?? 'N/A' }} {{ ucfirst(str_replace('_',' ',$project->status)) }}
{{ $done }}/{{ $total }} tasks
{{ $project->due_date ? \Carbon\Carbon::parse($project->due_date)->format('d M Y') : '-' }}
{{ __('common.actions.view') }} {{ __('common.actions.edit') }}
@csrf @method('DELETE')
{{ __('admin.projects.no_projects') }}
{{ $projects->withQueryString()->links() }}
@endsection