]> gitweb.erp-flowers.ru Git - erp24_rep/yii-erp24/.git/commitdiff
ERP-417
authormarina <m.zozirova@gmail.com>
Mon, 26 May 2025 06:36:57 +0000 (09:36 +0300)
committermarina <m.zozirova@gmail.com>
Mon, 26 May 2025 06:36:57 +0000 (09:36 +0300)
erp24/views/write_offs_erp/view.php

index 15c153a07d7ccf766f499b6bf77837838f518a4b..dea25930cd3a65d963e16c78a4a152a6cf6b0973 100644 (file)
@@ -136,18 +136,18 @@ $this->registerCssFile('/css/write-offs-erp.css', ['position' => \yii\web\View::
                                 $dataTable .= '<td>';
                                 $images = $product->imagesWriteOffsErp;
                                 if (!empty($images)) {
-                                    $forWidget = true; // или false в зависимости от вашей логики
-                                    if ($forWidget) {
-                                        $dataTable .= '<div class="gallery-container">';
-                                        $dataTable .= dosamigos\gallery\Gallery::widget([
-                                            'items' => WriteOffsErp::getImagesList($images, $forWidget)
-                                        ]);
-                                        $dataTable .= '</div>';
-                                    } else {
-                                        foreach ($images as $image) {
-                                            $dataTable .= Html::img($image->url, ['style' => 'max-width: 100px; margin: 5px;']);
-                                        }
+                                    $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
+                                            ]
+                                        );
                                     }
+                                    $dataTable .= '</div>';
                                 }
                                 $dataTable .= '</td>';