{{-- Goals & KPIs table: status dot, metric ("18 of 40 graduates"), progress bar. The linked-milestone column only renders when at least one goal links a milestone. Expects: $goals: object[] - engine-enriched goal rows (goalProgress resolved incl. roll-ups) $showProjects: bool $emptyText: string --}} @php $showProjects = $showProjects ?? false; $goalStatusColors = [ 'status_ontrack' => 'var(--green)', 'status_atrisk' => 'var(--yellow)', 'status_miss' => 'var(--red)', ]; $hasMilestoneLinks = false; foreach ($goals as $goalRow) { if (!empty($goalRow->milestoneHeadline)) { $hasMilestoneLinks = true; break; } } $fmt = fn ($n) => \Illuminate\Support\Number::format((float) $n, maxPrecision: 1); @endphp @if (count($goals) === 0)
{{ $emptyText }}
@else @if ($showProjects)@endif @if ($hasMilestoneLinks)@endif @foreach ($goals as $goal) @if ($showProjects) @endif @if ($hasMilestoneLinks) @endif @endforeach
{{ __('label.goal') }}{{ __('label.project') }}{{ __('label.metric') }} {{ __('label.progress') }}{{ __('label.linked_milestone') }}
{{ $tpl->escape($goal->title) }} @if ($goal->setting === 'linkAndReport') @if (!empty($goal->childGoalCount)) {{ sprintf(__('text.fed_by_n_goals'), $goal->childGoalCount) }} @else {{ __('text.goal_rollup_tooltip') }} @endif @endif {{ $tpl->escape($goal->boardProjectName ?? $goal->projectName ?? '') }} {{ $fmt($goal->currentValue) }} of {{ $fmt($goal->endValue) }} {{ $tpl->escape($goal->metricType ?? '') }}
{{ round($goal->goalProgress) }}%
{{ $tpl->escape($goal->milestoneHeadline ?? '') }}
@endif