]> _ Git - pmi.git/commitdiff
done #2901 @1
authorVincent Vanwaelscappel <vincent@cubedesigners.com>
Wed, 17 Jul 2019 13:09:52 +0000 (15:09 +0200)
committerVincent Vanwaelscappel <vincent@cubedesigners.com>
Wed, 17 Jul 2019 13:09:52 +0000 (15:09 +0200)
app/Http/Controllers/ProductController.php
app/Models/Producttype.php
resources/styles/components/text-page.styl [new file with mode: 0644]
resources/views/layouts/app.blade.php
resources/views/pages/products.blade.php
resources/views/partials/intro.blade.php

index 58590532536b4808fd67b5b9b870b09e0efc8dc2..57fd5ac13562c539e524d1c1b0c6262fed356e86 100644 (file)
@@ -17,8 +17,8 @@ class ProductController extends CubistFrontController
         }
 
         $this->data['title'] = $productType->name;
-        $this->data['title'] = $productType->name;
-        $this->data['product_type'] = $productType->getPageData();
+
+        $this->data['page'] = $this->data['product_type'] = $productType->getPageData();
         $this->data['products'] = [];
         $products = Product::where('product_type', $id)->where('online', 1)->get();
         foreach ($products as $item) {
index d0f68d9a84fb8b4c42e75cf01637d6985abf82e5..5613025601d98d5dc63fb8bde7ef15448b52a6e5 100644 (file)
@@ -34,6 +34,13 @@ class ProductType extends CubistMagicModel
             ]
         );
 
+        $this->addField([
+            'name' => 'intro',
+            'type' => 'BunchOfFields',
+            'bunch' => 'App\SubForms\Intro',
+            'label' => __('Introduction'),
+        ]);
+
         $this->addField(['name' => 'specifications',
             'label' => 'Spécifications',
             'type' => 'SelectFromModel',
@@ -48,5 +55,7 @@ class ProductType extends CubistMagicModel
             'optionsmodel' => 'App\Models\Specification',
             'order' => true,
             'multiple' => true]);
+
+
     }
 }
diff --git a/resources/styles/components/text-page.styl b/resources/styles/components/text-page.styl
new file mode 100644 (file)
index 0000000..2e6caab
--- /dev/null
@@ -0,0 +1,5 @@
+.template-text
+  .container
+    .markdown
+      max-width 800px
+      margin 0 auto
index 9e5a636e0fb13a7298f2c29fd98aa86d0b3b82dd..7f8ac9c4f8756775d4178e8e714a3837c0a6398c 100644 (file)
@@ -15,6 +15,7 @@
 @php
     //#### Generate temporary cart data
     $cart_items = [];
+    if(config('features.quote')){
     for ($i = 1; $i <= 6; $i++) {
         $cart_items[$i] = [
             'id' => $i,
@@ -24,6 +25,7 @@
             'image' => '/storage/products/'. rand(1,6) .'.png',
         ];
     }
+}
 @endphp
 
 <div id="app" class="flex flex-col min-h-screen" data-cart-items='@json($cart_items)'>
index 982172aaa6f50ddff99fceda5b74fb3b70435a88..039e2fce11e4662e16bba307e7ad4f9a4af01c0a 100644 (file)
@@ -1,28 +1,7 @@
 @extends('layouts/app')
 
 @section('content')
-    <full-width padding="pb-1v">
-        <content>
-            <columns>
-                <column>
-                    <img src="{{ asset('storage/uploads/images/products-intro.jpg') }}" alt="">
-                </column>
-
-                <column>
-                    <text-block class="pt-2v" title-tag="h1" title-class="h1 overlap-left" :title="$title">
-
-                        <p>
-                            La mesure de force se réalise avec les capteurs de force ou des cellules de charge. Ils sont
-                            constitués d'un corps d'épreuve sur lequel sont collées des jauges de contrainte. La mesure
-                            de force s'exprime en Newton.
-                        </p>
-                    </text-block>
-
-                </column>
-            </columns>
-        </content>
-
-    </full-width>
+    @intro()
 
     <full-width class="bg-grey-100" padding="pt-1v pb-2v">
         <content class="flex relative items-start">
index ce3832501ba011e35f4e2628ea54eb1bd938c270..dc7b91b7b51a87c1e5c44747f1c8c773eb201fd9 100644 (file)
@@ -4,8 +4,8 @@
     // $name is the name of the page data to fetch. If it's not set, assume it is 'intro'
     $name = $name ?? 'intro';
 
-    $title = \Illuminate\Support\Str::ucfirst($page->get("$name.title", ''));
-    $image = $page->getImageURL("$name.image");
+    $title = \Illuminate\Support\Str::ucfirst($page->get("$name.title", $page->get("name")));
+    $image = $page->getImageURL("$name.image",'',asset('storage/uploads/images/products-intro.jpg'));
     $class = $class ?? '';
     $padding = $padding ?? null; // Pass null so it doesn't override default padding
 @endphp