@section('title') {{ trans('general.import') }} @parent @stop
{{-- Livewire requires a 'master'
, above --}}
{{-- alert --}} @if($message != '')
@if($message_type == 'success') @endif {{-- title --}} {{ $message }}
@endif @if($this->showFmcsRestrictionNotice)
{{ trans('general.fmcs_import_restriction_note') }}
@endif @if($import_errors)
{{ trans('general.warning', ['warning'=> trans('general.errors_importing')]) }}
@foreach($import_errors AS $key => $actual_import_errors) @foreach($actual_import_errors AS $table => $error_bag) {{-- general messages such as "The selected file is invalid" are simple strings --}} @if(is_string($error_bag)) @elseif(is_array($error_bag)) @foreach($error_bag as $field => $error_list) @endforeach @endif @endforeach @endforeach
{{ trans('general.item') }} {{ trans('admin/custom_fields/general.field') }} {{ trans('general.error') }}
{{ $error_bag }}
{{ $key }} {{ $field }} {{ implode(", ",$error_list) }}
@endif
@if ($this->files->isEmpty()) {{-- Nothing to list yet. Hide the whole table so an empty doesn't render as a stub, and point the user at the upload widget in the sidebar. --}}

{{ trans('general.no_import_files_yet') }}

@else @if (count($selectedIds) > 0)
@endif @foreach($this->files as $currentFile) @endforeach
{{ trans('general.file_name') }} {{ trans('general.created_at') }} {{ trans('general.created_by') }} {{ trans('general.filesize') }} {{ trans('general.actions') }}
canDeleteFile($currentFile)) aria-label="{{ trans('admin/hardware/message.import.bulk_delete.select_row', ['file' => $currentFile->file_path]) }}"> @if ($this->fileMissingOnDisk($currentFile)) {{ $currentFile->file_path }} @elseif ((auth()->user()->id == $currentFile->adminuser?->id) || (auth()->user()->isSuperUser())) {{ $currentFile->file_path }} @else {{ $currentFile->file_path }} @endif @if (in_array($currentFile->id, $newlyUploadedIds, true)) {{-- Yellow spinning star flags rows the user just uploaded. Faster spin than fa-spin's default 2s via inline animation-duration, and an opacity transition so the JS timeout can add .newly-uploaded-fading for a soft dissolve before Livewire removes the DOM. --}} @endif {{ Helper::getFormattedDateObject($currentFile->created_at, 'datetime', false) }} @if ($currentFile->adminuser) @can('view', $currentFile->adminuser) {{ $currentFile->adminuser->display_name }} @else {{ $currentFile->adminuser->display_name }} @endcan @else --- @endif {{ Helper::formatFilesizeUnits($currentFile->filesize) }} @if ($this->fileMissingOnDisk($currentFile)) @else @endif @if (((auth()->user()->id == $currentFile->adminuser?->id) || (auth()->user()->isSuperUser())) && ! config('app.lock_passwords')) @else {{ trans('general.delete') }} @endif
@if ($this->files->hasPages())
{{ $this->files->links() }}
@endif @endif {{-- $this->files->isEmpty() --}}

{{ trans('general.importing') }}

{!! trans('general.importing_help') !!}

{{-- Feature-level demo-mode notice for the whole importer path (upload, process, destroy). x-demo-lock self-gates on editableOnDemo. --}} {{ trans('general.feature_disabled') }} {{-- Upload button. The fileupload jQuery widget is bound to #fileupload down in @script, so the input still has to be present in the DOM even when lock_passwords is set. --}} @if (! config('app.lock_passwords')) {{ trans('button.select_file') }} {{-- multiple lets users pick a batch of CSVs in one dialog; jQuery fileupload fires add()/progress()/done() per file, so the Livewire callbacks already handle each one individually. Server-side ImportController::store already iterates Request::file('files'). --}} @endif {{-- One progress bar per uploading file. JS appends a `.upload-progress-item` for each file in the fileupload widget's add() callback and mutates its own bar/message in place, so concurrent uploads don't trample each other's UI. wire:ignore keeps Livewire's morphdom from wiping the JS-appended children when uploadSucceeded / uploadFailed triggers a component re-render - especially important for failed uploads whose error text needs to stay put so the user can read it. --}}
{{-- Import wizard modal. Three steps: pick type + options, map columns, preview first N rows. Opened by selectFile() via dispatch('open-import-modal'). The submit ("Process") button on step 3 is the only path that fires the actual import POST; steps 1 and 2 just advance wizardStep. --}} {{-- Bulk delete confirmation modal. Kept as a Livewire-driven Bootstrap modal (not the shared confirm-action partial, which POSTs a form) so the confirm button can fire wire:click and let Livewire handle the delete without a page reload. --}}
@script @endscript