{{-- Header --}}
← Back
{{ $kpiSetId ? 'Edit KPI Set' : 'Create New KPI Set' }} {{ $kpiSetId ? 'Update the KPI set details and selection' : 'Define a new KPI set for a specific year and purpose' }}
{{-- Success Message --}} @if (session()->has('success')) {{ session('success') }} @endif
{{-- Basic Information Card --}}
Basic Information
{{-- Year Field --}} Year * @error('year') {{ $message }} @enderror {{-- Name Field --}} Name * @error('name') {{ $message }} @enderror Full identifier will be: {{ $year }}-{{ $name ?: 'name' }}
{{-- KPI Selection Card --}}
Select KPIs Choose the KPIs to include in this set (organized by Projects and Activities) @error('selectedKpis') {{ $message }} @enderror {{-- Projects --}} @foreach ($projects as $project)
{{-- Project Header --}}
📁 {{ $project->name }} {{ $project->groups->count() }} Activities
{{-- Activities in this Project --}}
@foreach ($project->groups as $group)
{{-- Activity Header --}}
{{ $group->name }} {{ $group->kpis->count() }} KPIs
{{-- Activity KPIs Table --}} @forelse ($group->kpis as $kpi) @empty @endforelse
Title Description Unit Max Value Target
{{ $kpi->title }} {{ Str::limit($kpi->description, 80) }} {{ ucfirst($kpi->unit ?? 'number') }} {{ $kpi->max_value ?? '-' }} {{ $kpi->default_target ?? '-' }}
No KPIs in this activity
@endforeach
@endforeach {{-- Ungrouped Activities --}} @if ($ungroupedGroups->count() > 0)
{{-- Ungrouped Activities Header --}}
Ungrouped Activities {{ $ungroupedGroups->count() }}
@foreach ($ungroupedGroups as $group)
{{-- Activity Header --}}
{{ $group->name }} {{ $group->kpis->count() }} KPIs
{{-- Activity KPIs Table --}} @foreach ($group->kpis as $kpi) @endforeach
Title Description Unit Max Value Target
{{ $kpi->title }} {{ Str::limit($kpi->description, 80) }} {{ ucfirst($kpi->unit ?? 'number') }} {{ $kpi->max_value ?? '-' }} {{ $kpi->default_target ?? '-' }}
@endforeach
@endif {{-- Ungrouped KPIs --}} @if ($ungroupedKpis->count() > 0)
{{-- Ungrouped Header --}}
Ungrouped KPIs {{ $ungroupedKpis->count() }}
{{-- Ungrouped KPIs Table --}} @foreach ($ungroupedKpis as $kpi) @endforeach
Title Description Unit Max Value Target
{{ $kpi->title }} {{ Str::limit($kpi->description, 80) }} {{ ucfirst($kpi->unit ?? 'number') }} {{ $kpi->max_value ?? '-' }} {{ $kpi->default_target ?? '-' }}
@endif {{-- Empty State --}} @if ($projects->count() === 0 && $ungroupedGroups->count() === 0 && $ungroupedKpis->count() === 0)
No KPIs Available Please create KPIs first before creating a KPI Set
@endif
{{-- Action Buttons --}}
Cancel
{{ count($selectedKpis) }} KPI(s) selected {{ $kpiSetId ? 'Update KPI Set' : 'Create KPI Set' }}