]> gitweb.erp-flowers.ru Git - erp24_rep/yii-erp24/.git/commitdiff
ERP-417
authormarina <m.zozirova@gmail.com>
Tue, 27 May 2025 06:38:41 +0000 (09:38 +0300)
committermarina <m.zozirova@gmail.com>
Tue, 27 May 2025 06:38:41 +0000 (09:38 +0300)
erp24/views/write_offs_erp/_form.php

index 9f35aa2e725921d562c557c7daa3cbda57f7a507..451cb1ee06acaaeb951c8bfbecc01791e1a3b479 100644 (file)
@@ -279,9 +279,6 @@ JS
                         }
 
                         return [
-                            'options' => [
-                                'style' => 'width: 250px; white-space: normal;', // уменьшаем ширину колонки
-                            ],
                             'attribute' => 'videoFiles',
                             'options' => [
                                 'multiple' => false,
@@ -293,20 +290,31 @@ JS
                                 'showPreview' => true,
                                 'showCaption' => true,
                                 'showRemove' => true,
-                                'showUpload' => false, // как у фото — не показываем кнопку загрузки
-                                'browseClass' => 'btn btn-primary btn-sm', // кнопка как у фото (синий маленький btn)
-                                'browseIcon' => '<i class="glyphicon glyphicon-plus"></i>',
-                                'browseLabel' => 'Выбрать видео',
+                                'showUpload' => true,
                                 'previewFileType' => 'video',
                                 'allowedFileExtensions' => ['mp4', 'mov', 'avi'],
                                 'maxFileSize' => 10240,
                                 'initialPreview' => $initialPreview,
                                 'initialPreviewAsData' => true,
                                 'initialPreviewConfig' => $initialPreviewConfig,
+                                // вот ключевые опции:
+                                'previewSettings' => [
+                                    'video' => ['width' => '120px', 'height' => 'auto'],
+                                ],
+                                'browseLabel' => '+',
+                                'removeLabel' => '-',
+                                'cancelLabel' => 'x',
+                                'layoutTemplates' => [
+                                    'actions' => '<div class="file-actions">{remove} {upload} {cancel}</div>',
+                                    'actionUpload' => '<button type="button" title="{uploadTitle}" class="kv-file-upload {uploadClass}" style="margin-left:5px">{uploadIcon}</button>',
+                                    'actionRemove' => '<button type="button" title="{removeTitle}" class="kv-file-remove {removeClass}">{removeIcon}</button>',
+                                    'actionCancel' => '<button type="button" title="{cancelTitle}" class="kv-file-cancel {cancelClass}">{cancelIcon}</button>',
+                                ],
                                 'fileActionSettings' => [
-                                    'showUpload' => false,  // не показываем кнопку загрузки возле файла
-                                    'showZoom' => true,
+                                    'showUpload' => true,
                                     'showRemove' => true,
+                                    'showZoom' => false,
+                                    'showDrag' => false,
                                 ],
                             ],
                         ];