95 lines
5.1 KiB
PHP
95 lines
5.1 KiB
PHP
|
<div role="tabpanel" class="tab-pane{{ $active_tab == 'upload' ? ' active' : '' }}" id="upload-tab">
|
||
|
@if (!$is_upload_enabled)
|
||
|
<div class="row">
|
||
|
<div class="col-xs-12">
|
||
|
<p class="text-danger" style="font-weight: bold">@lang('admin.upload_disabled_heading')</p>
|
||
|
<p>@lang('admin.upload_disabled_text')</p>
|
||
|
</div>
|
||
|
</div>
|
||
|
@else
|
||
|
<h4>@lang('admin.upload_single_file_heading')</h4>
|
||
|
<p>@lang('admin.upload_single_file_text')</p>
|
||
|
<div class="alert alert-info">
|
||
|
@lang('admin.upload_single_file_text2', [
|
||
|
'file_size' => sprintf('<b>%s%s</b>', round($file_upload_limit, 2), trans('global.units.megabytes')),
|
||
|
'max_upload_size' => sprintf('<b>%s%s</b>', round($max_post_limit, 2), trans('global.units.megabytes'))
|
||
|
])
|
||
|
</div>
|
||
|
|
||
|
<div class="row">
|
||
|
<div class="col-sm-5" style="margin-bottom: 20px;">
|
||
|
<form action="{{ route('photos.store') }}" method="POST" enctype="multipart/form-data" v-on:submit="uploadIndividualFiles">
|
||
|
{{ csrf_field() }}
|
||
|
<input type="hidden" name="album_id" value="{{ $album->id }}"/>
|
||
|
<input type="hidden" name="queue_token" value="{{ $queue_token }}"/>
|
||
|
|
||
|
<div class="form-group">
|
||
|
<label class="custom-file">
|
||
|
<input type="file" name="photo[]" id="single-upload-files" class="custom-file-input" multiple="multiple">
|
||
|
<span class="custom-file-control"></span>
|
||
|
</label>
|
||
|
</div>
|
||
|
|
||
|
<div>
|
||
|
<button type="submit" class="btn btn-success" v-bind:disabled="isUploadInProgress || isBulkUploadInProgress" v-html="isUploadInProgress ? '@lang('admin.is_uploading')' : '@lang('forms.upload_action')'"><i class="fa fa-fw fa-upload"></i> @lang('forms.upload_action')</button>
|
||
|
</div>
|
||
|
</form>
|
||
|
</div>
|
||
|
|
||
|
<div class="col-sm-5">
|
||
|
<div class="text-center" data-bind="visible: isUploadInProgress">
|
||
|
<p><b>@lang('admin.is_uploading')</b></p>
|
||
|
<div class="progress">
|
||
|
<div class="progress-bar progress-bar-success" data-bind="style: { width: successfulPercentage() }">
|
||
|
<span class="sr-only"><span class="percentage-success" data-bind="text: successfulPercentage"></span></span>
|
||
|
</div>
|
||
|
<div class="progress-bar progress-bar-danger" data-bind="style: { width: failedPercentage() }">
|
||
|
<span class="sr-only"><span class="percentage-danger" data-bind="text: failedPercentage"></span></span>
|
||
|
</div>
|
||
|
</div>
|
||
|
<p data-bind="text: currentStatus"></p>
|
||
|
</div>
|
||
|
|
||
|
<div data-bind="visible: statusMessages().length > 0">
|
||
|
<p data-bind="visible: !isUploadInProgress()" class="text-danger" style="font-weight: bold">
|
||
|
<span data-bind="text: imagesFailed"></span> @lang('admin.upload_file_number_failed')
|
||
|
</p>
|
||
|
<p data-bind="visible: imagesUploaded() > 0">
|
||
|
@lang('admin.upload_file_failed_continue')<br /><br/>
|
||
|
<a href="{{ route('albums.analyse', ['id' => $album->id, 'queue_token' => $queue_token]) }}" class="btn btn-primary">@lang('forms.continue_action')</a>
|
||
|
</p>
|
||
|
|
||
|
<ul data-bind="foreach: statusMessages">
|
||
|
<li data-bind="css: message_class, text: message_text"></li>
|
||
|
</ul>
|
||
|
</div>
|
||
|
</div>
|
||
|
</div>
|
||
|
|
||
|
<hr/>
|
||
|
<h4>@lang('admin.upload_bulk_heading')</h4>
|
||
|
<p>@lang('admin.upload_bulk_text')</p>
|
||
|
<div class="alert alert-info">
|
||
|
@lang('admin.upload_bulk_text2', [
|
||
|
'max_upload_size' => sprintf('<b>%s%s</b>', round($max_post_limit_bulk, 2), trans('global.units.megabytes'))
|
||
|
])
|
||
|
</div>
|
||
|
|
||
|
<form action="{{ route('photos.storeBulk') }}" method="POST" enctype="multipart/form-data">
|
||
|
{{ csrf_field() }}
|
||
|
<input type="hidden" name="album_id" value="{{ $album->id }}"/>
|
||
|
<input type="hidden" name="queue_token" value="{{ $queue_token }}"/>
|
||
|
|
||
|
<div class="form-group">
|
||
|
<label class="custom-file">
|
||
|
<input type="file" id="single-upload-files" class="custom-file-input" multiple="multiple" name="archive">
|
||
|
<span class="custom-file-control"></span>
|
||
|
</label>
|
||
|
</div>
|
||
|
|
||
|
<div>
|
||
|
<button type="submit" class="btn btn-success" data-bind="disable: (isUploadInProgress() || isBulkUploadInProgress()), text: isBulkUploadInProgress() ? '@lang('admin.is_uploading')' : '@lang('forms.upload_action')'"><i class="fa fa-fw fa-upload"></i> @lang('forms.upload_action')</button>
|
||
|
</div>
|
||
|
</form>
|
||
|
@endif
|
||
|
</div>
|