]> _ Git - fluidbook-toolbox.git/commitdiff
wait #7423 @1
authorVincent Vanwaelscappel <vincent@cubedesigners.com>
Mon, 14 Apr 2025 15:42:44 +0000 (17:42 +0200)
committerVincent Vanwaelscappel <vincent@cubedesigners.com>
Mon, 14 Apr 2025 15:42:44 +0000 (17:42 +0200)
app/Http/Controllers/Admin/Operations/FluidbookPublication/Services/PumaOperation.php
resources/puma/planogramme/style.css
resources/puma/planogramme/style.css.map
resources/puma/planogramme/style.less

index 3505caf9f7b8e860b820c5dada81177471a56783..ef05696a7528f9f558c8c2bf3046fcb5ea45ff0e 100644 (file)
@@ -43,8 +43,8 @@ trait PumaOperation
                 continue;
             }
             $r[$reference] = $data;
-            $title = trim(trim($data['Catégorie']??'') . ' ' . trim($data['RBU']??''));
-            $subtitle = trim(trim($data['Age Group']??'') . ' - ' . trim($data['Product Line']??''), '- ');
+            $title = trim(trim($data['Catégorie'] ?? '') . ' ' . trim($data['RBU'] ?? ''));
+            $subtitle = trim(trim($data['Age Group'] ?? '') . ' - ' . trim($data['Product Line'] ?? ''), '- ');
             $key = md5($title . $subtitle);
             if (!isset($planches[$key])) {
                 $planches[$key] = ['class' => $data['Catégorie'], 'title' => $title, 'subtitle' => $subtitle, 'products' => []];
@@ -62,24 +62,38 @@ trait PumaOperation
         $html .= '</head>';
         $html .= '<body>';
         foreach ($planches as $data) {
-            $html .= '<section class="' . $data['class'] . '">';
-            $html .= '<h1>' . $data['title'] . '</h1>';
-            $html .= '<h2>' . $data['subtitle'] . '</h2>';
-            $html .= '<div class="products">';
-            foreach ($data['products'] as $reference => $product) {
-                $f = protected_path('fluidbookpublication/cache/zoomarea/zoomarea/books/32281/' . $product['zoom_image']);
-                $html .= '<article>';
-                $html .= '<img src="' . Files::asDataURI($f) . '">';
-                $html .= '<div class="infos">';
-                $html .= '<h3>' . $reference . '</h3>';
-                $html .= '<div>' . $product['Désignation']??'' . '</div>';
-                $html .= '<div>' . $product['Color Name']??''. '</div>';
-                $html .= '<div>PA : ' . number_format(floatval($product['Tarif']??0), 2, ',', ' ') . ' € / PVP : ' . number_format(floatval($product['PVC']??0), 2, ',', ' ') . ' €</div>';
+            $max = $data['class'] === 'Footwear' ? 20 : 18;
+
+            $subs = array_chunk($data['products'], $max, true);
+            $csubs = count($subs);
+
+            foreach ($subs as $i => $sub) {
+                $pos = $csubs == 1 ? '' : ' (' . ($i + 1) . '/' . $csubs . ')';
+                $html .= '<section class="' . $data['class'] . '">';
+                $html .= '<h1>' . $data['title'] . '</h1>';
+                $html .= '<h2>' . $data['subtitle'] . $pos . '</h2>';
+                $html .= '<div class="products">';
+                foreach ($sub as $reference => $product) {
+                    if (isset($product['zoom_image'])) {
+                        $f = protected_path('fluidbookpublication/cache/zoomarea/zoomarea/books/32281/' . $product['zoom_image']);
+                        $img = Files::asDataURI($f);
+                    } else {
+                        $img = 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVR42mNk+P+/HgAFhAJ/wlseKgAAAABJRU5ErkJggg==';
+                    }
+
+                    $html .= '<article>';
+                    $html .= '<img src="' . $img . '">';
+                    $html .= '<div class="infos">';
+                    $html .= '<h3>' . $reference . '</h3>';
+                    $html .= '<div>' . $product['Désignation'] ?? '' . '</div>';
+                    $html .= '<div>' . $product['Color Name'] ?? '' . '</div>';
+                    $html .= '<div>PA : ' . number_format(floatval($product['Tarif'] ?? 0), 2, ',', ' ') . ' € / PVP : ' . number_format(floatval($product['PVC'] ?? 0), 2, ',', ' ') . ' €</div>';
+                    $html .= '</div>';
+                    $html .= '</article>';
+                }
                 $html .= '</div>';
-                $html .= '</article>';
+                $html .= '</section>';
             }
-            $html .= '</div>';
-            $html .= '</section>';
         }
         $html .= '</body>';
         return $html;
index 8080c83853c61a0e9ccd90bc43e47e1849e531d6..cd0f79b108e05721e444656970379f68f0d6517e 100644 (file)
@@ -53,6 +53,10 @@ article img {
   max-height: 40mm;
   margin: 0 auto;
 }
+.Footwear article img {
+  max-width: 48mm;
+  max-height: 30mm;
+}
 h1,
 h2 {
   font-family: Puma;
index c21c8ff6e22757e680982e7f0674af4926298721..6d95b776f5620f262d7eef01f05547daef7140c5 100644 (file)
@@ -1 +1 @@
-{"version":3,"sources":["style.less"],"names":[],"mappings":"AAAA;EACI,aAAa,MAAb;EACA,kBAAA;EACA,gBAAA;EACA,y3pFAAA;;AAIJ;EACI,aAAa,MAAb;EACA,kBAAA;EACA,gBAAA;EACA,y9gFAAA;;AAGJ;EACI;IACI,eAAA;;;AAIR;EACI,UAAA;EACA,SAAA;EACA,yCAAA;EACA,iBAAA;EACA,kBAAA;EACA,sBAAA;;AAGJ;EACI,wBAAA;EACA,YAAA;EACA,iBAAA;;AAHJ,OAKI;EACI,uBAAA;;AAIR;EACI,aAAA;EACA,uBAAuB,cAAvB;EACA,oBAAoB,eAApB;EACA,YAAA;EACA,gBAAA;;AAEA,SAAU;EACN,uBAAuB,cAAvB;EACA,oBAAoB,eAApB;;AAIR;EACI,aAAA;EACA,sBAAA;;EACA,8BAAA;;AAHJ,OAKI;EACI,eAAA;EACA,gBAAA;EACA,cAAA;;AAIR;AAAI;EACA,iBAAA;EACA,gBAAA;EACA,yBAAA;;AAIJ;EAEI,gBAAA;EACA,iBAAA;;AAIJ;EACI,gBAAA;EACA,iBAAA;;AAGJ;EACI,gBAAA","file":"style.css"}
\ No newline at end of file
+{"version":3,"sources":["style.less"],"names":[],"mappings":"AAAA;EACI,aAAa,MAAb;EACA,kBAAA;EACA,gBAAA;EACA,y3pFAAA;;AAIJ;EACI,aAAa,MAAb;EACA,kBAAA;EACA,gBAAA;EACA,y9gFAAA;;AAGJ;EACI;IACI,eAAA;;;AAIR;EACI,UAAA;EACA,SAAA;EACA,yCAAA;EACA,iBAAA;EACA,kBAAA;EACA,sBAAA;;AAGJ;EACI,wBAAA;EACA,YAAA;EACA,iBAAA;;AAHJ,OAKI;EACI,uBAAA;;AAIR;EACI,aAAA;EACA,uBAAuB,cAAvB;EACA,oBAAoB,eAApB;EACA,YAAA;EACA,gBAAA;;AAEA,SAAU;EACN,uBAAuB,cAAvB;EACA,oBAAoB,eAApB;;AAIR;EACI,aAAA;EACA,sBAAA;;EACA,8BAAA;;AAHJ,OAKI;EACI,eAAA;EACA,gBAAA;EACA,cAAA;;AAEA,SAAU,QALd;EAMQ,eAAA;EACA,gBAAA;;AAKZ;AAAI;EACA,iBAAA;EACA,gBAAA;EACA,yBAAA;;AAIJ;EAEI,gBAAA;EACA,iBAAA;;AAIJ;EACI,gBAAA;EACA,iBAAA;;AAGJ;EACI,gBAAA","file":"style.css"}
\ No newline at end of file
index 2cc68507f940498ae9501c9ee260254c57cbca32..44332f8bc2507becebb1cfd4131ff7e94e7556e3 100644 (file)
@@ -60,6 +60,11 @@ article {
         max-width: 40mm;
         max-height: 40mm;
         margin: 0 auto;
+
+        .Footwear &{
+            max-width: 48mm;
+            max-height: 30mm;
+        }
     }
 }