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

@if(session()->has('message'))
{{ session('message') }}
@endif {{-- Formulario de creación/edición con diseño de dos columnas --}} @if($showForm)
{{-- Nombre del template --}} {{-- Descripción --}} {{-- Fase asociada (opcional) --}} {{-- Plantilla global (disponible en todos los proyectos) --}}
{{ __('Template name') }}
{{ __('Description') }}
{{ __('Associated phase (optional)') }}
{{ __('Global template') }}
{{-- Campos dinámicos --}}

{{ __('Form fields') }}

@foreach($form['fields'] as $index => $field)
{{-- Fila: grupo / sección --}}
{{ __('Group / section') }}
{{-- Fila: nombre interno --}}
{{ __('Internal name') }}
{{-- Fila: etiqueta --}}
{{ __('Visible label') }}
{{-- Fila: pregunta / revisar (texto corto) --}}
{{ __('Question / check') }}
{{-- Fila: tipo --}}
{{ __('Field type') }}
{{-- Fila: requerido y botón eliminar --}}
{{ __('Required') }}
{{-- Campos adicionales según tipo --}} @if(in_array($field['type'], ['integer', 'decimal', 'percentage']))
{{ __('Min') }} / {{ __('Max') }} / {{ __('Step') }}
@elseif($field['type'] === 'select')
{{ __('Options (comma separated)') }}
@endif {{-- Fila: comentarios / ayuda (texto largo) --}}
{{ __('Comments / help') }}
@endforeach
@endif {{-- Tabla de templates existentes --}}
@forelse($templates as $template) @empty @endforelse
{{ __('Name') }} {{ __('Description') }} {{ __('Phase') }} {{ __('Fields') }} {{ __('Actions') }}
{{ $template->name }} @if(is_null($template->project_id)) {{ __('Global') }} @endif {{ $template->description ?? '-' }} {{ $template->phase ? $template->phase->name : __('Global project') }} {{ count($template->fields) }}
{{ __('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
{{ __('Uploading…') }}
@error('importFile'){{ $message }}@enderror
@if($importError)
{{ $importError }}
@endif
{{-- Vista previa de campos detectados --}} @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 {{-- ════════════════════════════════════════════════════════════ MODAL: Importar desde otro proyecto ════════════════════════════════════════════════════════════ --}} @if($showImportProjectModal)

{{ __('Import from another project') }}

@if($importProjectId) @if(count($importableTemplates))
@foreach($importableTemplates as $t) @endforeach
@else

{{ __('This project has no templates.') }}

@endif @endif
@endif