📋 {{ __('Inspection templates') }}

{{ __('Global catalogue, reusable across all projects.') }}

@if($showForm)
{{ __('Template name') }}
{{ __('Description') }}

{{ __('Form fields') }}

@foreach($form['fields'] as $index => $field)
{{ __('Group / section') }}
{{ __('Internal name') }}
{{ __('Visible label') }}
{{ __('Question / check') }}
{{ __('Field type') }}
{{ __('Required') }}
@if(in_array($field['type'], ['integer', 'decimal', 'percentage']))
{{ __('Min') }} / {{ __('Max') }} / {{ __('Step') }}
@elseif($field['type'] === 'select')
{{ __('Options (comma separated)') }}
@endif
{{ __('Comments / help') }}
@endforeach
@endif {{-- Tabla --}}
@forelse($templates as $template) @empty @endforelse
{{ __('Name') }} {{ __('Description') }} {{ __('Fields') }} {{ __('Used in projects') }} {{ __('Actions') }}
{{ $template->name }} {{ $template->description ?? '-' }} {{ count($template->fields ?? []) }} {{ $template->projects()->count() }}
{{ __('No templates yet (table)') }}
{{-- MODAL: Importar desde CSV/Excel --}} @if($showImportFileModal)

{{ __('Import from CSV/Excel') }}

{{ __('Columns: name, label, type, required, options, min, max, step') }}.

@error('importTemplateName'){{ $message }}@enderror
@error('importFile'){{ $message }}@enderror
@if($importError)
{{ $importError }}
@endif
@if(!empty($importPreviewFields))

{{ count($importPreviewFields) }} {{ __('fields detected') }}:

@foreach($importPreviewFields as $f) @endforeach
{{ __('Label') }}{{ __('Name') }}{{ __('Type') }}{{ __('Required') }}
{{ $f['label'] }}{{ $f['name'] }}{{ $f['type'] }}{{ !empty($f['required']) ? '✓' : '' }}
@endif
@endif