]> gitweb.erp-flowers.ru Git - erp24_rep/yii-erp24/.git/commitdiff
ERP-417
authormarina <m.zozirova@gmail.com>
Tue, 27 May 2025 07:25:16 +0000 (10:25 +0300)
committermarina <m.zozirova@gmail.com>
Tue, 27 May 2025 07:25:16 +0000 (10:25 +0300)
erp24/views/write_offs_erp/view.php

index dea25930cd3a65d963e16c78a4a152a6cf6b0973..2ec419c01b4bc285f68c164f1165f11c9b4ad2b1 100644 (file)
@@ -133,24 +133,18 @@ $this->registerCssFile('/css/write-offs-erp.css', ['position' => \yii\web\View::
                                 $dataTable .= '<td>' . Html::encode($product['comment']) . '</td>';
 
                                 // Изображения
-                                $dataTable .= '<td>';
-                                $images = $product->imagesWriteOffsErp;
+                                $forWidget = false;
                                 if (!empty($images)) {
-                                    $dataTable .= '<div style="display: flex; flex-wrap: wrap; gap: 5px;">';
-                                    foreach ($images as $image) {
-                                        $dataTable .= Html::a(
-                                            Html::img($image->url, ['style' => 'max-width: 100px; max-height: 100px;']),
-                                            $image->url,
-                                            [
-                                                'data-fancybox' => 'gallery',
-                                                'data-caption' => $product->name
-                                            ]
-                                        );
+                                    if ($forWidget) {
+                                        $dataTable .= '<div class="gallery-container">';
+                                        $dataTable .= dosamigos\gallery\Gallery::widget(['items' => $images]);
+                                        $dataTable .= '</div>';
+                                    } else {
+                                        $dataTable .= implode('', $images);
                                     }
-                                    $dataTable .= '</div>';
                                 }
                                 $dataTable .= '</td>';
-
+                                
                                 // Видео
                                 $dataTable .= '<td>';
                                 $video = $product->video;