From: marina Date: Fri, 21 Feb 2025 14:19:57 +0000 (+0300) Subject: ERP-302 Редактирование букета X-Git-Url: https://gitweb.erp-flowers.ru/?a=commitdiff_plain;h=515b921bf6934ab54afaa3d41778b4f97f1de0ac;p=erp24_rep%2Fyii-erp24%2F.git ERP-302 Редактирование букета --- diff --git a/erp24/views/bouquet/_form.php b/erp24/views/bouquet/_form.php index 6b286b26..2533bd7b 100644 --- a/erp24/views/bouquet/_form.php +++ b/erp24/views/bouquet/_form.php @@ -105,106 +105,76 @@ $form = ActiveForm::begin([ -
-
- -
'text-center font-weight-bold pt-5 h5']) ?>
- field($model, 'photo_bouquet[]')->widget(FileInput::class, [ +
+
+
'text-center font-weight-bold pt-5 h5']) ?>
+ field($model, 'video_presentation')->widget(FileInput::class, [ 'options' => [ - 'id' => 'bouquet-file-upload', - 'multiple' => true, // Поддержка выбора нескольких файлов - 'accept' => 'image/png, image/jpeg, image/jpg', + 'id' => 'video-file-upload', + 'multiple' => false, + 'accept' => 'video/mp4, video/avi, video/mov, video/mkv', ], 'language' => 'ru', 'pluginOptions' => [ - 'initialPreview' => $photoUrls, - 'initialPreviewConfig' => $photoConfig, - 'initialPreviewAsData' => true, 'showPreview' => true, 'showUpload' => false, 'showCancel' => false, - 'removeLabel' => '', 'mainClass' => 'input-group-lg', - 'maxFileSize' => 2800, // Максимальный размер файла (в килобайтах) - 'dropZoneTitle' => 'Выберите изображение', // Текст на зоне для перетаскивания - 'browseOnZoneClick' => true, // Разрешить клик по зоне перетаскивания + 'initialPreview' => !empty($videoUrls) ? [ + Html::tag('video', '', [ + 'src' => is_array($videoUrls) ? $videoUrls[0] : $videoUrls, // Извлекаем первый элемент, если массив + 'controls' => true, + 'class' => 'file-preview-video', + 'style' => 'max-width: 100%; height: auto;' + ]) + ] : [], + 'initialPreviewAsData' => false, + 'initialPreviewConfig' => !empty($videoUrls) ? [ + ['type' => 'video', 'filetype' => 'video/mp4'] + ] : [], + 'maxFileSize' => 100000, + 'dropZoneTitle' => 'Выберите видеофайл', + 'browseOnZoneClick' => true, 'fileActionSettings' => [ 'showZoom' => false, ], ], ])->label(false) ?>
-
-
-
'text-center font-weight-bold pt-5 h5']) ?>
- field($model, 'video_presentation')->widget(FileInput::class, [ - 'options' => [ - 'id' => 'video-file-upload', - 'multiple' => false, - 'accept' => 'video/mp4, video/avi, video/mov, video/mkv', - ], - 'language' => 'ru', - 'pluginOptions' => [ - 'showPreview' => true, - 'showUpload' => false, - 'showCancel' => false, - 'mainClass' => 'input-group-lg', - 'initialPreview' => !empty($videoUrls) ? [ - Html::tag('video', '', [ - 'src' => $videoUrls, - 'controls' => true, - 'class' => 'file-preview-video', - 'style' => 'max-width: 100%; height: auto;' - ]) - ] : [], - 'initialPreviewAsData' => false, // Указываем, что данные передаются как HTML - 'initialPreviewConfig' => !empty($videoUrls) ? [ - ['type' => 'video', 'filetype' => 'video/mp4'] // Тип файла для превью - ] : [], - 'maxFileSize' => 100000, // Максимальный размер файла (в килобайтах) - 'dropZoneTitle' => 'Выберите видеофайл', - 'browseOnZoneClick' => true, - 'fileActionSettings' => [ - 'showZoom' => false, - ], - ], - ])->label(false) ?> -
-
-
'text-center font-weight-bold pt-5 h5']) ?>
- field($model, 'video_build_process')->widget(FileInput::class, [ - 'options' => [ - 'id' => 'presentation-file-upload', - 'multiple' => false, - 'accept' => 'video/mp4, video/avi, video/mov, video/mkv', - ], - 'language' => 'ru', - 'pluginOptions' => [ - 'showPreview' => true, - 'showUpload' => false, - 'showCancel' => false, - 'mainClass' => 'input-group-lg', - 'initialPreview' => !empty($processUrls) ? [ - Html::tag('video', '', [ - 'src' => $processUrls, - 'controls' => true, - 'class' => 'file-preview-video', - 'style' => 'max-width: 100%; height: auto;' - ]) - ] : [], - 'initialPreviewAsData' => false, - 'initialPreviewConfig' => !empty($processUrls) ? [ - ['type' => 'video', 'filetype' => 'video/mp4'] - ] : [], - 'maxFileSize' => 100000, - 'dropZoneTitle' => 'Выберите видеофайл', - 'browseOnZoneClick' => true, - 'fileActionSettings' => [ - 'showZoom' => false, - ], +
+
'text-center font-weight-bold pt-5 h5']) ?>
+ field($model, 'video_build_process')->widget(FileInput::class, [ + 'options' => [ + 'id' => 'presentation-file-upload', + 'multiple' => false, + 'accept' => 'video/mp4, video/avi, video/mov, video/mkv', + ], + 'language' => 'ru', + 'pluginOptions' => [ + 'showPreview' => true, + 'showUpload' => false, + 'showCancel' => false, + 'mainClass' => 'input-group-lg', + 'initialPreview' => !empty($processUrls) ? [ + Html::tag('video', '', [ + 'src' => is_array($processUrls) ? $processUrls[0] : $processUrls, // Извлекаем первый элемент, если массив + 'controls' => true, + 'class' => 'file-preview-video', + 'style' => 'max-width: 100%; height: auto;' + ]) + ] : [], + 'initialPreviewAsData' => false, + 'initialPreviewConfig' => !empty($processUrls) ? [ + ['type' => 'video', 'filetype' => 'video/mp4'] + ] : [], + 'maxFileSize' => 100000, + 'dropZoneTitle' => 'Выберите видеофайл', + 'browseOnZoneClick' => true, + 'fileActionSettings' => [ + 'showZoom' => false, ], - ])->label(false) ?> -
+ ], + ])->label(false) ?>