{{-- Header --}}
KPI Management Manage projects, activities, and KPI definitions
Add Project Add Activity Create New KPI
{{-- Search --}}
{{-- Success/Error Messages --}} @if (session()->has('success')) {{ session('success') }} @endif @if (session()->has('error')) {{ session('error') }} @endif {{-- Projects --}} @foreach ($this->projects as $project)
{{-- Project Header --}}
▶ ▼ 📁 {{ $project->name }} {{ $project->groups->count() }} Activities
↑ ↓ Edit Delete
{{-- Activities in this Project --}}
@forelse ($project->groups as $group)
{{-- Activity Header --}}
▶ ▼ {{ $group->name }} {{ $group->kpis->count() }} KPIs
↑ ↓ @foreach ($this->allProjects as $targetProject) @if ($targetProject->id !== $project->id) @endif @endforeach Edit Delete
{{-- KPIs Table --}}
@forelse ($group->kpis as $kpi) @empty @endforelse
Title Description Unit Max Value Target Actions
{{ $kpi->title }} {{ Str::limit($kpi->description, 80) }} {{ ucfirst($kpi->unit ?? 'number') }} {{ $kpi->max_value ?? '-' }} {{ $kpi->default_target ?? '-' }}
↑ ↓ @foreach ($this->allGroups as $targetGroup) @if ($targetGroup->id !== $group->id) @endif @endforeach Edit Delete
No KPIs in this activity
@empty
No activities in this project yet
@endforelse
@endforeach {{-- Ungrouped Activities --}} @if ($this->ungroupedGroups->count() > 0)
{{-- Ungrouped Activities Header --}}
▶ ▼ Ungrouped Activities {{ $this->ungroupedGroups->count() }}
@foreach ($this->ungroupedGroups as $group)
{{-- Activity Header --}}
▶ ▼ {{ $group->name }} {{ $group->kpis->count() }} KPIs
↑ ↓ @foreach ($this->allProjects as $targetProject) @endforeach Edit Delete
{{-- KPIs Table --}} @foreach ($group->kpis as $kpi) @endforeach
Title Description Unit Max Value Target Actions
{{ $kpi->title }} {{ Str::limit($kpi->description, 80) }} {{ ucfirst($kpi->unit ?? 'number') }} {{ $kpi->max_value ?? '-' }} {{ $kpi->default_target ?? '-' }}
↑ ↓ @foreach ($this->allGroups as $targetGroup) @if ($targetGroup->id !== $group->id) @endif @endforeach Edit Delete
@endforeach
@endif {{-- Ungrouped KPIs --}} @if ($this->ungroupedKpis->count() > 0)
{{-- Ungrouped Header --}}
Ungrouped KPIs {{ $this->ungroupedKpis->count() }}
{{-- Ungrouped KPIs Table --}} @foreach ($this->ungroupedKpis as $kpi) @endforeach
Title Description Unit Max Value Target Actions
{{ $kpi->title }} {{ Str::limit($kpi->description, 80) }} {{ ucfirst($kpi->unit ?? 'number') }} {{ $kpi->max_value ?? '-' }} {{ $kpi->default_target ?? '-' }}
↑ ↓ @foreach ($this->allGroups as $targetGroup) @endforeach Edit Delete
@endif {{-- Empty State --}} @if ($this->projects->count() === 0 && $this->ungroupedGroups->count() === 0 && $this->ungroupedKpis->count() === 0)
No Projects, Activities or KPIs Yet Get started by creating a project, activity, or your first KPI
@endif {{-- Create/Edit Project Modal --}} @if ($showProjectForm)
{{ $editingProjectId ? 'Edit Project' : 'Create New Project' }} {{ $editingProjectId ? 'Update the project name' : 'Create a new project for organizing activities' }}
Project Name * @error('projectName') {{ $message }} @enderror
Cancel {{ $editingProjectId ? 'Update Project' : 'Create Project' }}
@endif {{-- Create/Edit Activity Modal --}} @if ($showGroupForm)
{{ $editingGroupId ? 'Edit Activity' : 'Create New Activity' }} {{ $editingGroupId ? 'Update the activity details' : 'Create a new activity for organizing KPIs' }}
Activity Name * @error('groupName') {{ $message }} @enderror Project @foreach ($this->allProjects as $project) @endforeach @error('groupProjectId') {{ $message }} @enderror
Cancel {{ $editingGroupId ? 'Update Activity' : 'Create Activity' }}
@endif {{-- Create/Edit KPI Modal --}} @if ($showForm)
{{ $editingKpiId ? 'Edit KPI' : 'Create New KPI' }} {{ $editingKpiId ? 'Update the KPI details' : 'Define a new master KPI' }}
{{-- Title Field --}} KPI Title * @error('title') {{ $message }} @enderror {{-- Description Field --}} Description @error('description') {{ $message }} @enderror {{-- Unit Field (Radio) --}} Unit *
@error('unit') {{ $message }} @enderror
{{-- Max Value Field --}} Max Value @error('maxValue') {{ $message }} @enderror @if ($unit === 'percent') Maximum value is 100 for percentage-based KPIs @endif {{-- Default Target Field --}} Default Target @error('defaultTarget') {{ $message }} @enderror {{-- Project Field --}} Project (Optional) @foreach ($this->allProjects as $project) @endforeach @error('projectId') {{ $message }} @enderror Select a project to filter activities, or leave empty to see all {{-- Activity Field --}} Activity @foreach ($this->filteredGroups as $group) @endforeach @error('groupId') {{ $message }} @enderror
Cancel {{ $editingKpiId ? 'Update KPI' : 'Create KPI' }}
@endif {{-- Delete Confirmation Modal --}} @if ($deleteId) Confirm Deletion Are you sure you want to delete this KPI? This will also delete all associated year instances, department assignments, and progress data. This action cannot be undone.
Cancel Delete
@endif