{{-- 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)
| {{ __('label.goal') }} | @if ($showProjects){{ __('label.project') }} | @endif{{ __('label.metric') }} | {{ __('label.progress') }} | @if ($hasMilestoneLinks){{ __('label.linked_milestone') }} | @endif
|---|---|---|---|---|
| {{ $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 | @if ($showProjects){{ $tpl->escape($goal->boardProjectName ?? $goal->projectName ?? '') }} | @endif{{ $fmt($goal->currentValue) }} of {{ $fmt($goal->endValue) }} {{ $tpl->escape($goal->metricType ?? '') }} |
|
@if ($hasMilestoneLinks)
{{ $tpl->escape($goal->milestoneHeadline ?? '') }} | @endif