@php $stageMeta = [ 'pre_production' => ['chip' => 'bg-indigo-50 text-indigo-600', 'icon' => 'flag'], 'production' => ['chip' => 'bg-sky-50 text-sky-600', 'icon' => 'cog-6-tooth'], 'pre_delivery' => ['chip' => 'bg-emerald-50 text-emerald-600','icon' => 'shield-check'], ]; @endphp
@if ($canManage) {{ __('New Template') }} @endif @if ($templates->isEmpty()) @if ($canManage) {{ __('New Template') }} @endif @else
@foreach ($templates as $template) @endforeach
@if ($selected)

{{ $selected->name }}

@if ($selected->job_category_id === null) {{ __('Applies to every job in addition to any category template.') }} @else {{ __('Applies to jobs in :cat (plus the baseline).', ['cat' => $selected->category?->name ?? __('this category')]) }} @endif

@if ($canManage)
@endif
@if ($canManage)
{{ __('Add check') }}
@endif
@foreach ($stageOrder as $stage) @php $stageItems = $items[$stage] ?? collect(); $meta = $stageMeta[$stage] ?? $stageMeta['production']; @endphp @if ($stageItems->isNotEmpty())

{{ $stageLabels[$stage] ?? $stage }}

    @foreach ($stageItems as $item)
  • {{ $item->label }} @if ($item->is_required) {{ __('Required') }} @else {{ __('Optional') }} @endif {{ $respMeta[$item->responsible]['label'] ?? ucfirst($item->responsible) }} @if ($item->requires_approval){{ __('· approval') }}@endif @if ($item->requires_evidence){{ __('· evidence') }}@endif
    @if ($item->description)

    {{ $item->description }}

    @endif
    @if ($canManage)
    @endif
  • @endforeach
@endif @endforeach @if ($items->isEmpty())

{{ __('No checks yet. Add the first one.') }}

@endif
@else {{ __('Select a template to manage its checks.') }} @endif
@endif
{{ $editingTemplateId ? __('Edit Template') : __('New Template') }}

{{ __('Category templates stack on top of the baseline.') }}

{{ __('Cancel') }} {{ __('Save') }}
{{ $editingItemId ? __('Edit Check') : __('Add Check') }}
{{ __('Cancel') }} {{ __('Save') }}