mirror of
https://github.com/BookStackApp/BookStack.git
synced 2025-08-09 10:22:51 +03:00
ZIP Import: Finished base import process & error handling
Added file creation reverting and DB rollback on error. Added error display on failed import. Extracted likely shown import form/error text to translation files.
This commit is contained in:
@@ -7,8 +7,19 @@
|
||||
<h1 class="list-heading">{{ trans('entities.import_continue') }}</h1>
|
||||
<p class="text-muted">{{ trans('entities.import_continue_desc') }}</p>
|
||||
|
||||
@if(session()->has('import_errors'))
|
||||
<div class="mb-m">
|
||||
<label class="setting-list-label mb-xs text-neg">@icon('warning') {{ trans('entities.import_errors') }}</label>
|
||||
<p class="mb-xs small">{{ trans('entities.import_errors_desc') }}</p>
|
||||
@foreach(session()->get('import_errors') ?? [] as $error)
|
||||
<p class="mb-none text-neg">{{ $error }}</p>
|
||||
@endforeach
|
||||
<hr class="mt-m">
|
||||
</div>
|
||||
@endif
|
||||
|
||||
<div class="mb-m">
|
||||
<label class="setting-list-label mb-m">Import Details</label>
|
||||
<label class="setting-list-label mb-m">{{ trans('entities.import_details') }}</label>
|
||||
<div class="flex-container-row justify-space-between wrap">
|
||||
<div>
|
||||
@include('exports.parts.import-item', ['type' => $import->type, 'model' => $data])
|
||||
@@ -34,32 +45,36 @@
|
||||
@if($import->type === 'page' || $import->type === 'chapter')
|
||||
<hr>
|
||||
<label class="setting-list-label">{{ trans('entities.import_location') }}</label>
|
||||
<p class="small mb-m">{{ trans('entities.import_location_desc') }}</p>
|
||||
<p class="small mb-s">{{ trans('entities.import_location_desc') }}</p>
|
||||
@if($errors->has('parent'))
|
||||
<div class="mb-s">
|
||||
@include('form.errors', ['name' => 'parent'])
|
||||
</div>
|
||||
@endif
|
||||
@include('entities.selector', [
|
||||
'name' => 'parent',
|
||||
'entityTypes' => $import->type === 'page' ? 'chapter,book' : 'book',
|
||||
'entityPermission' => "{$import->type}-create",
|
||||
'selectorSize' => 'compact small',
|
||||
])
|
||||
@include('form.errors', ['name' => 'parent'])
|
||||
@endif
|
||||
</form>
|
||||
|
||||
<div class="text-right">
|
||||
<a href="{{ url('/import') }}" class="button outline">{{ trans('common.cancel') }}</a>
|
||||
<div component="dropdown" class="inline block mx-s">
|
||||
<button refs="dropdown@toggle"
|
||||
type="button"
|
||||
title="{{ trans('common.delete') }}"
|
||||
class="button outline">{{ trans('common.delete') }}</button>
|
||||
<div refs="dropdown@menu" class="dropdown-menu">
|
||||
<p class="text-neg bold small px-m mb-xs">{{ trans('entities.import_delete_confirm') }}</p>
|
||||
<p class="small px-m mb-xs">{{ trans('entities.import_delete_desc') }}</p>
|
||||
<button type="submit" form="import-delete-form" class="text-link small text-item">{{ trans('common.confirm') }}</button>
|
||||
<div class="text-right">
|
||||
<a href="{{ url('/import') }}" class="button outline">{{ trans('common.cancel') }}</a>
|
||||
<div component="dropdown" class="inline block mx-s">
|
||||
<button refs="dropdown@toggle"
|
||||
type="button"
|
||||
title="{{ trans('common.delete') }}"
|
||||
class="button outline">{{ trans('common.delete') }}</button>
|
||||
<div refs="dropdown@menu" class="dropdown-menu">
|
||||
<p class="text-neg bold small px-m mb-xs">{{ trans('entities.import_delete_confirm') }}</p>
|
||||
<p class="small px-m mb-xs">{{ trans('entities.import_delete_desc') }}</p>
|
||||
<button type="submit" form="import-delete-form" class="text-link small text-item">{{ trans('common.confirm') }}</button>
|
||||
</div>
|
||||
</div>
|
||||
<button type="submit" class="button">{{ trans('entities.import_run') }}</button>
|
||||
</div>
|
||||
<button type="submit" form="import-run-form" class="button">{{ trans('entities.import_run') }}</button>
|
||||
</div>
|
||||
</form>
|
||||
</main>
|
||||
</div>
|
||||
|
||||
|
@@ -4,7 +4,7 @@
|
||||
class="text-{{ $import->type }}">@icon($import->type) {{ $import->name }}</a>
|
||||
</div>
|
||||
<div class="px-m py-s flex-container-row gap-m items-center">
|
||||
<div class="bold opacity-80">{{ $import->getSizeString() }}</div>
|
||||
<div class="bold opacity-80 text-muted" title="{{ $import->created_at->toISOString() }}">@icon('time'){{ $import->created_at->diffForHumans() }}</div>
|
||||
<div class="bold opacity-80 text-muted">{{ $import->getSizeString() }}</div>
|
||||
<div class="bold opacity-80 text-muted min-width-xs text-right" title="{{ $import->created_at->toISOString() }}">@icon('time'){{ $import->created_at->diffForHumans() }}</div>
|
||||
</div>
|
||||
</div>
|
Reference in New Issue
Block a user