@extends('admin.layouts.app') @section('title', get_setting('site_name').' | '.($template ? __('Edit appraisal template') : __('New appraisal template'))) @section('content') @php $kpiJson = old('kpi_schema_json', $template ? json_encode($template->kpi_schema ?? [], JSON_PRETTY_PRINT | JSON_UNESCAPED_UNICODE) : json_encode([ ['id' => 'quality', 'label' => 'Quality of work', 'weight' => 30, 'input' => 'rating_1_5'], ], JSON_PRETTY_PRINT | JSON_UNESCAPED_UNICODE)); $evalJson = old('evaluation_schema_json', $template ? json_encode($template->evaluation_schema ?? [], JSON_PRETTY_PRINT | JSON_UNESCAPED_UNICODE) : json_encode([ ['id' => 'strengths', 'label' => 'Key strengths', 'input' => 'text'], ], JSON_PRETTY_PRINT | JSON_UNESCAPED_UNICODE)); $selCycles = old('cycles', $template ? ($template->cycles ?? []) : $defaultCycles); @endphp
{{ $template ? __('Edit template') : __('New template') }}
@csrf
@error('name')
{{ $message }}
@enderror
{{ __('Leave all checked to allow every cycle (same as “all”).') }} @foreach([ \App\Models\StaffAppraisalRecord::CYCLE_THREE_MONTH => __('3-month probation'), \App\Models\StaffAppraisalRecord::CYCLE_SIX_MONTH => __('6-month review'), \App\Models\StaffAppraisalRecord::CYCLE_ANNUAL => __('Annual'), ] as $val => $lab) @endforeach @error('cycles')
{{ $message }}
@enderror @error('cycles.*')
{{ $message }}
@enderror
{{ __('Each item: id, label, optional weight, input = rating_1_5 | number | text') }} @error('kpi_schema_json')
{{ $message }}
@enderror
{{ __('Each item: id, label, input = rating_1_5 | number | text') }} @error('evaluation_schema_json')
{{ $message }}
@enderror
{{ __('Cancel') }}
@endsection