{{ __('Workflow templates') }}

{{ __('Create, edit, activate, or remove reusable task workflows.') }}

@if(session('success'))
{{ session('success') }}
@endif @if(session('warning'))
{{ session('warning') }}
@endif @if(session('error')) @endif
@forelse($templates as $template) @empty @endforelse
{{ __('Template name') }}{{ __('steps') }}{{ __('Tasks') }}{{ __('Status') }}{{ __('Actions') }}
{{ $template->name }}
{{ $template->description }}
@foreach($template->steps as $step)
{{ $loop->iteration }}. {{ $step->title }} · {{ __('Administration') }}: {{ $step->administrate?->name ?? $template->administrate?->name ?? __('N/A') }} · {{ $step->duration_days }} {{ __('working days') }} · {{ $step->checklistItems->count() }} {{ __('Checklist items') }} · {{ $step->visibility === 'private' ? __('Private') : __('General') }}
@endforeach
{{ $template->steps_count }}{{ $template->workflows_count }} {{ $template->is_active ? __('Active') : __('Inactive') }}
@if(! $template->workflows_count)@endif
{{ __('No workflow templates found.') }}

{{ $editingId ? __('Edit workflow template') : __('Create workflow template') }}

@if($editingId && $templates->firstWhere('id', $editingId)?->workflows_count)
{{ __('Existing tasks keep their saved workflow steps. Changes here apply to newly started workflows.') }}
@endif
@error('name'){{ $message }}@enderror
@foreach($steps as $index => $step)

{{ __('Step') }} {{ $index + 1 }}

@if(count($steps) > 1)@endif
@error("steps.$index.administrate_id"){{ $message }}@enderror
@error("steps.$index.assignee_ids.*"){{ $message }}@enderror
@if($index > 0)
@error("steps.$index.depends_on"){{ $message }}@enderror
@error("steps.$index.depends_on_checklist_items"){{ $message }}@enderror
@endif

{{ __('Checklist items') }}

@foreach($step['checklist_items'] ?? [] as $itemIndex => $item)
@error("steps.$index.checklist_items.$itemIndex.title"){{ $message }}@enderror
@endforeach
@endforeach
\n