]> _ Git - pmi.git/commitdiff
wip #2843 @5
authorVincent Vanwaelscappel <vincent@cubedesigners.com>
Thu, 4 Jul 2019 12:26:47 +0000 (14:26 +0200)
committerVincent Vanwaelscappel <vincent@cubedesigners.com>
Thu, 4 Jul 2019 12:26:47 +0000 (14:26 +0200)
29 files changed:
app/Http/Controllers/Admin/NewsCrudController.php [new file with mode: 0644]
app/Http/Controllers/Controller.php [deleted file]
app/Http/Controllers/PageController.php
app/Http/Controllers/ProductController.php [new file with mode: 0644]
app/Http/Kernel.php
app/Http/Middleware/GenerateMenus.php [deleted file]
app/Models/Page.php
app/Models/Product.php
app/Models/Settings.php
composer.json
config/app.php
package.json
public/_modules/product-onglet/img/arrow-down.svg [deleted file]
public/_modules/product-onglet/img/icon-file-2.svg [deleted file]
public/_modules/product-onglet/img/icon-file.svg [deleted file]
public/_modules/product-onglet/style.styl
public/images/product-details/arrow-down.svg [new file with mode: 0644]
public/images/product-details/icon-document.svg [new file with mode: 0644]
public/images/product-details/icon-tech.svg [new file with mode: 0644]
resources/js/bootstrap.js
resources/js/product-details.js [new file with mode: 0644]
resources/styles/components/product-details.styl [new file with mode: 0644]
resources/views/layouts/app.blade.php
resources/views/pages/product-detail.blade.php
resources/views/partials/footer.blade.php
resources/views/partials/nav.blade.php
routes/backpack/custom.php
routes/web.php
webpack.mix.js

diff --git a/app/Http/Controllers/Admin/NewsCrudController.php b/app/Http/Controllers/Admin/NewsCrudController.php
new file mode 100644 (file)
index 0000000..ff04f36
--- /dev/null
@@ -0,0 +1,16 @@
+<?php
+
+namespace App\Http\Controllers\Admin;
+
+use Cubist\Backpack\app\Magic\Controllers\CubistMagicController;
+
+class NewsCrudController extends CubistMagicController
+{
+    protected $_modelNamespace = 'App\Models\News';
+    protected $_routeURL = 'news';
+    protected $_singular = 'actualité';
+    protected $_plural = 'actualités';
+    protected $_clonable = true;
+    protected $_bulk = true;
+    protected $_oneInstance= false;
+}
diff --git a/app/Http/Controllers/Controller.php b/app/Http/Controllers/Controller.php
deleted file mode 100644 (file)
index 03e02a2..0000000
+++ /dev/null
@@ -1,13 +0,0 @@
-<?php
-
-namespace App\Http\Controllers;
-
-use Illuminate\Foundation\Bus\DispatchesJobs;
-use Illuminate\Routing\Controller as BaseController;
-use Illuminate\Foundation\Validation\ValidatesRequests;
-use Illuminate\Foundation\Auth\Access\AuthorizesRequests;
-
-class Controller extends BaseController
-{
-    use AuthorizesRequests, DispatchesJobs, ValidatesRequests;
-}
index b0981776b252b4fa028f5c1f54c353f7ac68b3da..a6d1cd8f425fc652ff969922ecee37b438425cea 100644 (file)
@@ -3,15 +3,16 @@
 namespace App\Http\Controllers;
 
 use App\Models\Page;
+use Cubist\Backpack\app\Http\Controllers\CubistFrontController;
 
-class PageController extends Controller
+class PageController extends CubistFrontController
 {
     public function index($slug = 'home')
     {
         $page = Page::findBySlug($slug);
 
         if (!$page) {
-            abort(404, 'Please go back to our <a href="' . url('') . '">homepage</a>.');
+            $this->_404();
         }
 
         $this->data['title'] = $page->title;
diff --git a/app/Http/Controllers/ProductController.php b/app/Http/Controllers/ProductController.php
new file mode 100644 (file)
index 0000000..70045d0
--- /dev/null
@@ -0,0 +1,24 @@
+<?php
+
+
+namespace App\Http\Controllers;
+
+use App\Models\Product;
+use Cubist\Backpack\app\Http\Controllers\CubistFrontController;
+
+class ProductController extends CubistFrontController
+{
+    public function productDetails($id)
+    {
+        $product = Product::find($id);
+
+        if (!$product) {
+            $this->_404();
+        }
+
+        $this->data['title'] = $product->title;
+        $this->data['product'] = $product->withFakes();
+
+        return view('pages.product-detail', $this->data);
+    }
+}
index 415c2d17b1d688df5f8426061453937c746d17d9..348665a78ba3ea9918dedba8062ebe67e7a5a370 100644 (file)
@@ -36,7 +36,6 @@ class Kernel extends HttpKernel
             \Illuminate\View\Middleware\ShareErrorsFromSession::class,
             \App\Http\Middleware\VerifyCsrfToken::class,
             \Illuminate\Routing\Middleware\SubstituteBindings::class,
-            \App\Http\Middleware\GenerateMenus::class,
         ],
 
         'api' => [
diff --git a/app/Http/Middleware/GenerateMenus.php b/app/Http/Middleware/GenerateMenus.php
deleted file mode 100644 (file)
index 3052ae1..0000000
+++ /dev/null
@@ -1,216 +0,0 @@
-<?php
-
-namespace App\Http\Middleware;
-
-use App\Models\Page;
-use Closure;
-
-class GenerateMenus
-{
-    /**
-     * Handle an incoming request.
-     *
-     * @param \Illuminate\Http\Request $request
-     * @param \Closure $next
-     * @return mixed
-     */
-    public function handle($request, Closure $next)
-    {
-        $productsSubMenus = [
-
-            // Left panel
-            [
-                'title' => 'Capteurs',
-                'links' => [
-                    'Force' => 'products/force',
-                    'Couple' => 'products/couple',
-                    'Déplacement' => 'products/deplacement',
-                    'Accélération' => 'products/acceleration',
-                    'Inclinaison' => 'products/inclinaison',
-                    'Pression' => 'products/pression',
-                ],
-            ],
-
-            // Right panel
-            [
-                'title' => 'Systèmes de mesure',
-                'links' => [
-                    'Roue dynamométrique' => 'products/roue',
-                    'Contrôle de fermeture d’ouvrants' => 'products/cdfdo',
-                    'Contrôle de taraudage' => 'products/cdt',
-                    'Collecteurs tournant' => 'products/ct',
-                    'Télémétrie' => 'products/telemetrie',
-                    'Acquisition de données' => 'products/add',
-                ],
-            ],
-        ];
-
-        $tree = Page::getTree();
-        file_put_contents(app_path('tree.txt'), print_r($tree, true));
-        $main = $tree['#main'];
-
-        $nav_items = [];
-        foreach ($main['children'] as $name => $item) {
-
-            if ($item['element']->status !== 1) continue; // Skip offline pages
-
-            $submenus = null;
-            if ($name == 'products') {
-                $submenus = $productsSubMenus;
-            } else {
-                $links = [];
-
-                foreach ($item['children'] as $key => $child) {
-                    $links[$child['element']->title] = $child['element']->slug;
-                }
-
-                if (count($links) > 0) {
-                    $submenus = [['links' => $links]];
-                }
-            }
-            $s = ['url' => $item['element']->slug];
-            if (null !== $submenus) {
-                $s['submenus'] = $submenus;
-            }
-
-            $nav_items[$item['element']->title] = $s;
-        }
-
-        // Hard coded menu structure until we have dynamic data from the CMS
-//        $nav_items = [
-//
-//            'Products' => [
-//                'url' => 'products',
-//                'submenus' => [
-//
-//                    // Left panel
-//                    [
-//                        'title' => 'Capteurs',
-//                        'links' => [
-//                            'Force' => 'products/force',
-//                            'Couple' => 'products/couple',
-//                            'Déplacement' => 'products/deplacement',
-//                            'Accélération' => 'products/acceleration',
-//                            'Inclinaison' => 'products/inclinaison',
-//                            'Pression' => 'products/pression',
-//                        ],
-//                    ],
-//
-//                    // Right panel
-//                    [
-//                        'title' => 'Systèmes de mesure',
-//                        'links' => [
-//                            'Roue dynamométrique' => 'products/roue',
-//                            'Contrôle de fermeture d’ouvrants' => 'products/cdfdo',
-//                            'Contrôle de taraudage' => 'products/cdt',
-//                            'Collecteurs tournant' => 'products/ct',
-//                            'Télémétrie' => 'products/telemetrie',
-//                            'Acquisition de données' => 'products/add',
-//                        ],
-//                    ],
-//                ],
-//            ],
-//
-//            'Solutions' => [
-//                'url' => 'solutions',
-//                'submenus' => [
-//                    [
-//                        'links' => [
-//                            'Énergie' => 'solutions/energie',
-//                            'Aéronautique' => 'solutions/aero',
-//                            'Ferroviaire' => 'solutions/ferroviaire',
-//                            'Automobile' => 'solutions/auto',
-//                            'Génie civil' => 'solutions/civil',
-//                            'Industrie' => 'solutions/industrie',
-//                        ]
-//                    ],
-//                ],
-//            ],
-//
-//            'Services' => [
-//                'url' => 'services',
-//                'submenus' => [
-//                    [
-//                        'title' => null,
-//                        'links' => [
-//                            'Location' => 'services/location',
-//                            'Calibration' => 'services/calibration',
-//                            'Développement OEM' => 'services/developpement-oem',
-//                            'Custom Design' => 'services/custom-design',
-//                            'Formation' => 'services/formation',
-//                        ],
-//                    ],
-//                ],
-//            ],
-//            'Support' => ['url' => 'support'],
-//            'Société' => [
-//                'url' => 'societe',
-//                'submenus' => [
-//                    [
-//                        'links' => [
-//                            'Qui sommes nous ?' => 'societe/a-propos',
-//                            'Actualités' => 'societe/actualites',
-//                        ]
-//                    ]
-//                ],
-//            ],
-//            'Contact' => ['url' => 'contact'],
-//        ];
-
-
-        \Menu::make('primary', function ($menu) use ($nav_items) {
-
-            foreach ($nav_items as $nav_label => $nav_item) {
-
-                $parent = $menu->add($nav_label, $nav_item['url']);
-
-                // Handle items with submenus
-                if (isset($nav_item['submenus'])) {
-
-                    foreach ($nav_item['submenus'] as $submenu_data) {
-
-                        // Create an empty sub-element that will serve as a wrapper for the submenu(s)
-                        $wrapper = $parent->raw('')->attr(['class' => 'nav-submenu-wrapper']);
-
-                        // Some submenus have a title element
-                        if (isset($submenu_data['title'])) {
-                            $wrapper->raw($submenu_data['title'])->attr(['class' => 'nav-submenu-title']);
-                        }
-
-                        foreach ($submenu_data['links'] as $label => $url) {
-                            $wrapper->add($label, $url);
-                        }
-                    }
-                }
-
-            }
-
-        });
-
-        // Also make a menu for the breadcrumbs - this one is simpler and doesn't have the submenu headings
-        \Menu::make('breadcrumbs', function ($menu) use ($nav_items) {
-
-            // Start with home link
-            $menu = $menu->add('Home', '');
-
-            foreach ($nav_items as $nav_label => $nav_item) {
-
-                $parent = $menu->add($nav_label, $nav_item['url']);
-
-                // Handle items with submenus
-                if (isset($nav_item['submenus'])) {
-
-                    foreach ($nav_item['submenus'] as $submenu_data) {
-                        foreach ($submenu_data['links'] as $label => $url) {
-                            $parent->add($label, $url);
-                        }
-                    }
-                }
-            }
-        });
-
-        return $next($request);
-    }
-
-
-}
index 9b8d09930ca2b3c82e5944a72c61aad214bd59fa..d8fb4b3e33d3eadda88301fe025c6c7b68ab9c51 100644 (file)
@@ -4,8 +4,204 @@
 namespace App\Models;
 
 use Cubist\Backpack\app\Magic\Models\CMSPage;
+use Lavary\Menu\Menu;
 
 class Page extends CMSPage
 {
+    public static function makeMenus()
+    {
 
+        if (Menu::exists('primary')) {
+            return;
+        }
+        $productsSubMenus = [
+
+            // Left panel
+            [
+                'title' => 'Capteurs',
+                'links' => [
+                    'Force' => 'products/force',
+                    'Couple' => 'products/couple',
+                    'Déplacement' => 'products/deplacement',
+                    'Accélération' => 'products/acceleration',
+                    'Inclinaison' => 'products/inclinaison',
+                    'Pression' => 'products/pression',
+                ],
+            ],
+
+            // Right panel
+            [
+                'title' => 'Systèmes de mesure',
+                'links' => [
+                    'Roue dynamométrique' => 'products/roue',
+                    'Contrôle de fermeture d’ouvrants' => 'products/cdfdo',
+                    'Contrôle de taraudage' => 'products/cdt',
+                    'Collecteurs tournant' => 'products/ct',
+                    'Télémétrie' => 'products/telemetrie',
+                    'Acquisition de données' => 'products/add',
+                ],
+            ],
+        ];
+
+        $tree = Page::getTree();
+
+        $main = $tree['#main'];
+
+        $nav_items = [];
+        foreach ($main['children'] as $name => $item) {
+            $submenus = null;
+            if ($name == 'products') {
+                $submenus = $productsSubMenus;
+            } else {
+                $links = [];
+
+                foreach ($item['children'] as $key => $child) {
+                    $links[$child['element']->title] = $child['element']->slug;
+                }
+
+                if (count($links) > 0) {
+                    $submenus = [['links' => $links]];
+                }
+            }
+            $s = ['url' => $item['element']->slug];
+            if (null !== $submenus) {
+                $s['submenus'] = $submenus;
+            }
+
+            $nav_items[$item['element']->title] = $s;
+        }
+
+//        // Hard coded menu structure until we have dynamic data from the CMS
+//        $nav_items = [
+//
+//            'Products' => [
+//                'url' => 'products',
+//                'submenus' => [
+//
+//                    // Left panel
+//                    [
+//                        'title' => 'Capteurs',
+//                        'links' => [
+//                            'Force' => 'products/force',
+//                            'Couple' => 'products/couple',
+//                            'Déplacement' => 'products/deplacement',
+//                            'Accélération' => 'products/acceleration',
+//                            'Inclinaison' => 'products/inclinaison',
+//                            'Pression' => 'products/pression',
+//                        ],
+//                    ],
+//
+//                    // Right panel
+//                    [
+//                        'title' => 'Systèmes de mesure',
+//                        'links' => [
+//                            'Roue dynamométrique' => 'products/roue',
+//                            'Contrôle de fermeture d’ouvrants' => 'products/cdfdo',
+//                            'Contrôle de taraudage' => 'products/cdt',
+//                            'Collecteurs tournant' => 'products/ct',
+//                            'Télémétrie' => 'products/telemetrie',
+//                            'Acquisition de données' => 'products/add',
+//                        ],
+//                    ],
+//                ],
+//            ],
+//
+//            'Solutions' => [
+//                'url' => 'solutions',
+//                'submenus' => [
+//                    [
+//                        'links' => [
+//                            'Énergie' => 'solutions/energie',
+//                            'Aéronautique' => 'solutions/aero',
+//                            'Ferroviaire' => 'solutions/ferroviaire',
+//                            'Automobile' => 'solutions/auto',
+//                            'Génie civil' => 'solutions/civil',
+//                            'Industrie' => 'solutions/industrie',
+//                        ]
+//                    ],
+//                ],
+//            ],
+//
+//            'Services' => [
+//                'url' => 'services',
+//                'submenus' => [
+//                    [
+//                        'title' => null,
+//                        'links' => [
+//                            'Location' => 'services/location',
+//                            'Calibration' => 'services/calibration',
+//                            'Développement OEM' => 'services/developpement-oem',
+//                            'Custom Design' => 'services/custom-design',
+//                            'Formation' => 'services/formation',
+//                        ],
+//                    ],
+//                ],
+//            ],
+//            'Support' => ['url' => 'support'],
+//            'Société' => [
+//                'url' => 'societe',
+//                'submenus' => [
+//                    [
+//                        'links' => [
+//                            'Qui sommes nous ?' => 'societe/a-propos',
+//                            'Actualités' => 'societe/actualites',
+//                        ]
+//                    ]
+//                ],
+//            ],
+//            'Contact' => ['url' => 'contact'],
+//        ];
+
+
+        \Menu::make('primary', function ($menu) use ($nav_items) {
+
+            foreach ($nav_items as $nav_label => $nav_item) {
+
+                $parent = $menu->add($nav_label, $nav_item['url']);
+
+                // Handle items with submenus
+                if (isset($nav_item['submenus'])) {
+
+                    foreach ($nav_item['submenus'] as $submenu_data) {
+
+                        // Create an empty sub-element that will serve as a wrapper for the submenu(s)
+                        $wrapper = $parent->raw('')->attr(['class' => 'nav-submenu-wrapper']);
+
+                        // Some submenus have a title element
+                        if (isset($submenu_data['title'])) {
+                            $wrapper->raw($submenu_data['title'])->attr(['class' => 'nav-submenu-title']);
+                        }
+
+                        foreach ($submenu_data['links'] as $label => $url) {
+                            $wrapper->add($label, $url);
+                        }
+                    }
+                }
+
+            }
+
+        });
+
+        // Also make a menu for the breadcrumbs - this one is simpler and doesn't have the submenu headings
+        \Menu::make('breadcrumbs', function ($menu) use ($nav_items) {
+
+            // Start with home link
+            $menu = $menu->add('Home', '');
+
+            foreach ($nav_items as $nav_label => $nav_item) {
+
+                $parent = $menu->add($nav_label, $nav_item['url']);
+
+                // Handle items with submenus
+                if (isset($nav_item['submenus'])) {
+
+                    foreach ($nav_item['submenus'] as $submenu_data) {
+                        foreach ($submenu_data['links'] as $label => $url) {
+                            $parent->add($label, $url);
+                        }
+                    }
+                }
+            }
+        });
+    }
 }
index fbd8d2241b01b863af09e7910a8d4e5d1eadee7b..0f739c1c5d06699b7f0eaf65691750abe3b4e1fc 100644 (file)
@@ -4,6 +4,7 @@ namespace App\Models;
 
 use Cubist\Backpack\app\Magic\Models\CubistMagicModel;
 use Illuminate\Support\Str;
+use Spatie\MediaLibrary\Models\Media;
 
 class Product extends CubistMagicModel
 {
@@ -16,6 +17,14 @@ class Product extends CubistMagicModel
         'singular' => 'produit',
         'plural' => 'produits'];
 
+    protected $_documents = [];
+
+    public function __construct(array $attributes = [])
+    {
+        $this->_documents = ['technical_sheet' => trans('Fiche technique'), 'documentation' => trans('Documentation')];
+        parent::__construct($attributes);
+    }
+
     public function setFields()
     {
         parent::setFields();
@@ -87,8 +96,8 @@ class Product extends CubistMagicModel
             'maxFiles' => 6,
             'tab' => 'Média']);
 
-        $documents = ['technical_sheet' => 'Fiche technique', 'documentation' => 'Documentation'];
-        foreach ($documents as $name => $label) {
+
+        foreach ($this->_documents as $name => $label) {
             $this->addField(['name' => $name,
                 'label' => $label,
                 'type' => 'Files',
@@ -204,4 +213,36 @@ class Product extends CubistMagicModel
         }
 
     }
+
+    public function getDocuments()
+    {
+        $typedocs = ['odt', 'doc', 'docx', 'pdf'];
+        $res = [];
+        foreach ($this->_documents as $fieldName => $label) {
+            foreach ($this->getMedia($this->$fieldName) as $media) {
+                /** @var $media Media */
+
+                $res[] = ['media' => $media, 'label' => $label, 'type' => in_array($media->getExtensionAttribute(), $typedocs) ? 'document' : 'tech'];
+            }
+        }
+
+        return $res;
+    }
+
+    public function hasDocuments()
+    {
+        return count($this->getDocuments()) > 0;
+    }
+
+    public function getSpecificationsValues()
+    {
+        $res = [];
+        $allspecs = Specification::all();
+        $mytype = ProductType::find($this->productType);
+        $myspecs = $mytype->specifications;
+        foreach ($myspecs as $spec) {
+
+        }
+        return $res;
+    }
 }
index b27db86e3e85abc74bbeda04d0038d79590764e3..5d70942bb30e0933c5e0ef72d4f23678fc844c57 100644 (file)
@@ -15,5 +15,10 @@ class Settings extends \Cubist\Backpack\app\Magic\Models\Settings
             'type'=>'Email',
             'label'=>'E-mail',
             'tab'=>'Informations de contact']);
+
+        $this->addField(['name'=>'phone',
+            'type'=>'Text',
+            'label'=>'Téléphone',
+            'tab'=>'Informations de contact']);
     }
 }
index 4dd58ffa0f55269357072ce1cece81621f82f6c4..fc695b806ebc188e2408822fdaaec812d75e0f70 100644 (file)
@@ -19,7 +19,6 @@
     "license": "proprietary",
     "require": {
         "cubist/cms-back": "dev-master",
-        "lavary/laravel-menu": "^1.7",
         "league/csv": "^9.2",
         "nothingworks/blade-svg": "^0.3.1",
         "spatie/laravel-blade-x": "^2.2"
index ff1e0547090113bd729140df5553a30371089ad4..5989a1c25ee0f72e32f5b58f5a73f1635ea94493 100644 (file)
@@ -247,6 +247,8 @@ return [
         'Validator' => Illuminate\Support\Facades\Validator::class,
         'View' => Illuminate\Support\Facades\View::class,
 
+
+
     ],
 
 ];
index e25a4cc6c474cd4be0178e8949b6f24cfba7ce2c..7b1f9a40a912621341a445c4d120ea90565e187f 100644 (file)
         "rupture": "^0.7.1",
         "stylus": "acidjazz/stylus#dev",
         "stylus-loader": "^3.0.2",
-        "tailwindcss": "^1.0.1",
+        "tailwindcss": "^1.0.4",
         "vue": "^2.6.10",
         "vue-slide-up-down": "^1.7.2",
-        "vue-template-compiler": "^2.6.10"
+        "vue-template-compiler": "^2.6.10",
+        "gsap": "^2.1.3"
     }
 }
diff --git a/public/_modules/product-onglet/img/arrow-down.svg b/public/_modules/product-onglet/img/arrow-down.svg
deleted file mode 100644 (file)
index 29654f0..0000000
+++ /dev/null
@@ -1,3 +0,0 @@
-<svg xmlns="http://www.w3.org/2000/svg" width="16.16" height="9.588" viewBox="0 0 16.16 9.588">
-  <path id="Tracé_29" data-name="Tracé 29" d="M3719.6-783.348l-7.459,7.459-7.278-7.459" transform="translate(-3704.146 784.055)" fill="none" stroke="#6b7287" stroke-miterlimit="10" stroke-width="2"/>
-</svg>
diff --git a/public/_modules/product-onglet/img/icon-file-2.svg b/public/_modules/product-onglet/img/icon-file-2.svg
deleted file mode 100644 (file)
index e78821b..0000000
+++ /dev/null
@@ -1,14 +0,0 @@
-<svg xmlns="http://www.w3.org/2000/svg" width="23.942" height="31" viewBox="0 0 23.942 31">
-  <g id="Groupe_130" data-name="Groupe 130" transform="translate(-207.499 -1302.5)">
-    <g id="Groupe_120" data-name="Groupe 120" transform="translate(208 1302.999)">
-      <g id="Groupe_124" data-name="Groupe 124" transform="translate(0 0)">
-        <path id="Tracé_202" data-name="Tracé 202" d="M4004.51-1343.333H3984.3a1.365,1.365,0,0,1-1.365-1.364v-27.271a1.365,1.365,0,0,1,1.365-1.364h14.926l6.651,6.651v21.985A1.364,1.364,0,0,1,4004.51-1343.333Z" transform="translate(-3982.933 1373.333)" fill="#0eaada" stroke="#f7f8fc" stroke-linecap="round" stroke-linejoin="round" stroke-width="1"/>
-        <path id="Tracé_203" data-name="Tracé 203" d="M4057.28-1366.683h-5.286a1.364,1.364,0,0,1-1.365-1.364v-5.287Z" transform="translate(-4034.338 1373.333)" fill="#0eaada" stroke="#f7f8fc" stroke-linecap="round" stroke-linejoin="round" stroke-width="1"/>
-      </g>
-      <g id="Groupe_125" data-name="Groupe 125" transform="translate(5 9.167)">
-        <path id="Tracé_204" data-name="Tracé 204" d="M515.025,11614.639a5.759,5.759,0,0,0-1.715.984l-1.315-.757-1.8,3.119,1.309.757a5.259,5.259,0,0,0,0,1.973l-1.31.756,1.8,3.119,1.319-.755a5.774,5.774,0,0,0,1.715.982v1.515h3.6v-1.515a5.7,5.7,0,0,0,1.7-.982l1.307.755,1.8-3.119-1.312-.756a5.541,5.541,0,0,0,.093-.986,5.465,5.465,0,0,0-.094-.986l1.311-.757-1.8-3.119-1.3.757a5.687,5.687,0,0,0-1.7-.984V11613h-3.6Z" transform="translate(-510.19 -11612.999)" fill="none" stroke="#f7f8fc" stroke-linecap="round" stroke-width="1"/>
-        <circle id="Ellipse_18" data-name="Ellipse 18" cx="2.381" cy="2.381" r="2.381" transform="translate(4.239 4.348)" fill="none" stroke="#f7f8fc" stroke-linecap="round" stroke-width="1"/>
-      </g>
-    </g>
-  </g>
-</svg>
diff --git a/public/_modules/product-onglet/img/icon-file.svg b/public/_modules/product-onglet/img/icon-file.svg
deleted file mode 100644 (file)
index 6309327..0000000
+++ /dev/null
@@ -1,20 +0,0 @@
-<svg xmlns="http://www.w3.org/2000/svg" width="23.944" height="31" viewBox="0 0 23.944 31">
-  <g id="Groupe_129" data-name="Groupe 129" transform="translate(-126.5 -1244.5)">
-    <g id="Groupe_127" data-name="Groupe 127" transform="translate(127 1244.999)">
-      <g id="Groupe_123" data-name="Groupe 123" transform="translate(0)">
-        <path id="Tracé_199" data-name="Tracé 199" d="M3845.179-1343.333h-20.215a1.365,1.365,0,0,1-1.365-1.364v-27.272a1.365,1.365,0,0,1,1.365-1.364h14.928l6.652,6.651v21.985A1.364,1.364,0,0,1,3845.179-1343.333Z" transform="translate(-3823.6 1373.333)" fill="#0eaada" stroke="#f7f8fc" stroke-linecap="round" stroke-linejoin="round" stroke-width="1"/>
-        <path id="Tracé_200" data-name="Tracé 200" d="M3897.947-1366.683h-5.287a1.364,1.364,0,0,1-1.364-1.364v-5.286Z" transform="translate(-3875.003 1373.333)" fill="#0eaada" stroke="#f7f8fc" stroke-linecap="round" stroke-linejoin="round" stroke-width="1"/>
-      </g>
-      <g id="Groupe_117" data-name="Groupe 117" transform="translate(3.334 8.334)">
-        <g id="Rectangle_472" data-name="Rectangle 472" transform="translate(0.126 0)" fill="none" stroke="#f7f8fc" stroke-linecap="square" stroke-width="1">
-          <rect width="7.008" height="7.007" stroke="none"/>
-          <rect x="0.5" y="0.5" width="6.008" height="6.007" fill="none"/>
-        </g>
-        <line id="Ligne_136" data-name="Ligne 136" x2="5.785" transform="translate(10.181 2.666)" fill="none" stroke="#f7f8fc" stroke-linejoin="round" stroke-width="1"/>
-        <line id="Ligne_137" data-name="Ligne 137" x2="15.841" transform="translate(0.126 10.031)" fill="none" stroke="#f7f8fc" stroke-linejoin="round" stroke-width="1"/>
-        <path id="Tracé_201" data-name="Tracé 201" d="M0,0H10.048" transform="translate(0 13.395)" fill="#0eaada" stroke="#f7f8fc" stroke-width="1"/>
-        <line id="Ligne_140" data-name="Ligne 140" x2="5.718" transform="translate(10.181 6.374)" fill="none" stroke="#f7f8fc" stroke-linejoin="round" stroke-width="1"/>
-      </g>
-    </g>
-  </g>
-</svg>
index 49d7ce93fa5eb9ce203d916e8f86bc352daeb774..196b415522251386f8c99e8a7ef8f74c551c731f 100644 (file)
@@ -5,6 +5,7 @@ $dark = #6B7287
 $lightgrey = #F7F8FC
 $darkblue = #152F4E
 
+
 *
   padding: 0
   box-sizing: border-box !important
@@ -104,4 +105,4 @@ $darkblue = #152F4E
     display flex !important
   .rotate
     transform: rotate(180deg)
-    transition 400ms all ease
\ No newline at end of file
+    transition 400ms all ease
diff --git a/public/images/product-details/arrow-down.svg b/public/images/product-details/arrow-down.svg
new file mode 100644 (file)
index 0000000..29654f0
--- /dev/null
@@ -0,0 +1,3 @@
+<svg xmlns="http://www.w3.org/2000/svg" width="16.16" height="9.588" viewBox="0 0 16.16 9.588">
+  <path id="Tracé_29" data-name="Tracé 29" d="M3719.6-783.348l-7.459,7.459-7.278-7.459" transform="translate(-3704.146 784.055)" fill="none" stroke="#6b7287" stroke-miterlimit="10" stroke-width="2"/>
+</svg>
diff --git a/public/images/product-details/icon-document.svg b/public/images/product-details/icon-document.svg
new file mode 100644 (file)
index 0000000..6309327
--- /dev/null
@@ -0,0 +1,20 @@
+<svg xmlns="http://www.w3.org/2000/svg" width="23.944" height="31" viewBox="0 0 23.944 31">
+  <g id="Groupe_129" data-name="Groupe 129" transform="translate(-126.5 -1244.5)">
+    <g id="Groupe_127" data-name="Groupe 127" transform="translate(127 1244.999)">
+      <g id="Groupe_123" data-name="Groupe 123" transform="translate(0)">
+        <path id="Tracé_199" data-name="Tracé 199" d="M3845.179-1343.333h-20.215a1.365,1.365,0,0,1-1.365-1.364v-27.272a1.365,1.365,0,0,1,1.365-1.364h14.928l6.652,6.651v21.985A1.364,1.364,0,0,1,3845.179-1343.333Z" transform="translate(-3823.6 1373.333)" fill="#0eaada" stroke="#f7f8fc" stroke-linecap="round" stroke-linejoin="round" stroke-width="1"/>
+        <path id="Tracé_200" data-name="Tracé 200" d="M3897.947-1366.683h-5.287a1.364,1.364,0,0,1-1.364-1.364v-5.286Z" transform="translate(-3875.003 1373.333)" fill="#0eaada" stroke="#f7f8fc" stroke-linecap="round" stroke-linejoin="round" stroke-width="1"/>
+      </g>
+      <g id="Groupe_117" data-name="Groupe 117" transform="translate(3.334 8.334)">
+        <g id="Rectangle_472" data-name="Rectangle 472" transform="translate(0.126 0)" fill="none" stroke="#f7f8fc" stroke-linecap="square" stroke-width="1">
+          <rect width="7.008" height="7.007" stroke="none"/>
+          <rect x="0.5" y="0.5" width="6.008" height="6.007" fill="none"/>
+        </g>
+        <line id="Ligne_136" data-name="Ligne 136" x2="5.785" transform="translate(10.181 2.666)" fill="none" stroke="#f7f8fc" stroke-linejoin="round" stroke-width="1"/>
+        <line id="Ligne_137" data-name="Ligne 137" x2="15.841" transform="translate(0.126 10.031)" fill="none" stroke="#f7f8fc" stroke-linejoin="round" stroke-width="1"/>
+        <path id="Tracé_201" data-name="Tracé 201" d="M0,0H10.048" transform="translate(0 13.395)" fill="#0eaada" stroke="#f7f8fc" stroke-width="1"/>
+        <line id="Ligne_140" data-name="Ligne 140" x2="5.718" transform="translate(10.181 6.374)" fill="none" stroke="#f7f8fc" stroke-linejoin="round" stroke-width="1"/>
+      </g>
+    </g>
+  </g>
+</svg>
diff --git a/public/images/product-details/icon-tech.svg b/public/images/product-details/icon-tech.svg
new file mode 100644 (file)
index 0000000..e78821b
--- /dev/null
@@ -0,0 +1,14 @@
+<svg xmlns="http://www.w3.org/2000/svg" width="23.942" height="31" viewBox="0 0 23.942 31">
+  <g id="Groupe_130" data-name="Groupe 130" transform="translate(-207.499 -1302.5)">
+    <g id="Groupe_120" data-name="Groupe 120" transform="translate(208 1302.999)">
+      <g id="Groupe_124" data-name="Groupe 124" transform="translate(0 0)">
+        <path id="Tracé_202" data-name="Tracé 202" d="M4004.51-1343.333H3984.3a1.365,1.365,0,0,1-1.365-1.364v-27.271a1.365,1.365,0,0,1,1.365-1.364h14.926l6.651,6.651v21.985A1.364,1.364,0,0,1,4004.51-1343.333Z" transform="translate(-3982.933 1373.333)" fill="#0eaada" stroke="#f7f8fc" stroke-linecap="round" stroke-linejoin="round" stroke-width="1"/>
+        <path id="Tracé_203" data-name="Tracé 203" d="M4057.28-1366.683h-5.286a1.364,1.364,0,0,1-1.365-1.364v-5.287Z" transform="translate(-4034.338 1373.333)" fill="#0eaada" stroke="#f7f8fc" stroke-linecap="round" stroke-linejoin="round" stroke-width="1"/>
+      </g>
+      <g id="Groupe_125" data-name="Groupe 125" transform="translate(5 9.167)">
+        <path id="Tracé_204" data-name="Tracé 204" d="M515.025,11614.639a5.759,5.759,0,0,0-1.715.984l-1.315-.757-1.8,3.119,1.309.757a5.259,5.259,0,0,0,0,1.973l-1.31.756,1.8,3.119,1.319-.755a5.774,5.774,0,0,0,1.715.982v1.515h3.6v-1.515a5.7,5.7,0,0,0,1.7-.982l1.307.755,1.8-3.119-1.312-.756a5.541,5.541,0,0,0,.093-.986,5.465,5.465,0,0,0-.094-.986l1.311-.757-1.8-3.119-1.3.757a5.687,5.687,0,0,0-1.7-.984V11613h-3.6Z" transform="translate(-510.19 -11612.999)" fill="none" stroke="#f7f8fc" stroke-linecap="round" stroke-width="1"/>
+        <circle id="Ellipse_18" data-name="Ellipse 18" cx="2.381" cy="2.381" r="2.381" transform="translate(4.239 4.348)" fill="none" stroke="#f7f8fc" stroke-linecap="round" stroke-width="1"/>
+      </g>
+    </g>
+  </g>
+</svg>
index 4ba264b7bbb7a8be9da1444ae0bf67bcdc040807..4e36bfcf9217592a2e18656fa25bb25e52e4697d 100644 (file)
@@ -7,12 +7,13 @@ window._ = require('lodash');
  * code may be modified to fit the specific needs of your application.
  */
 
-// try {
-//     window.Popper = require('popper.js').default;
-//     window.$ = window.jQuery = require('jquery');
-//
-//     require('bootstrap');
-// } catch (e) {}
+try {
+    //window.Popper = require('popper.js').default;
+    window.$ = window.jQuery = require('jquery');
+
+    //require('bootstrap');
+} catch (e) {}
+
 
 /**
  * We'll load the axios HTTP library which allows us to easily issue requests
diff --git a/resources/js/product-details.js b/resources/js/product-details.js
new file mode 100644 (file)
index 0000000..f490adb
--- /dev/null
@@ -0,0 +1,28 @@
+$(function () {
+  $(document).on('click', '#product-tabs .section-title', function () {
+    let that = $(this);
+
+    $('.content-item').each(function () {
+      if ($(this).data('content') === that.data('nav')) {
+        $(this).addClass('active-content').siblings().removeClass('active-content').addClass('hidden');
+        that.addClass('active-nav').parent().siblings().find(".section-title").removeClass('active-nav');
+      }
+    });
+
+    if ($(window).width() < 940) {
+      $('.responsive-content').each(function () {
+        if ($(this).data('content') === that.data('nav')) {
+          that.find('.product-nav-arrow').toggleClass('rotate');
+        }
+      })
+    }
+  })
+
+  $(".section-title").click(function () {
+    $(this)
+      .toggleClass('active-content')
+      .siblings(".responsive-content")
+      .slideToggle()
+  });
+
+});
diff --git a/resources/styles/components/product-details.styl b/resources/styles/components/product-details.styl
new file mode 100644 (file)
index 0000000..26d8379
--- /dev/null
@@ -0,0 +1,70 @@
+$h3 = 24px
+$barlow = 'Barlow', sans-serif
+$muli = 'Muli', sans-serif
+$dark = #6B7287
+$lightgrey = #F7F8FC
+$darkblue = #152F4E
+
+
+#product-tabs
+  max-width: 1536px
+  margin: 0 auto
+
+  .content
+    @media (max-width 940px)
+      display none
+      max-width 1536px
+      padding 55px 48px 48px 48px
+      background $lightgrey
+
+  .product-nav
+    @media (max-width 940px)
+      flex-direction column
+
+    &-item
+      //padding : 25px 50px
+      font-family $barlow
+      font-size: 18px
+      color: $darkblue
+      position: relative
+      transition 400ms all ease
+      @media (max-width 940px)
+        &:last-child::after
+          height: 0
+        &::after
+          content ''
+          background #E7E9F3
+          left 48px
+          right 48px
+          bottom 0
+          position absolute
+          height 1px
+
+    .section-title
+      font-family $barlow
+      display flex
+      padding: 25px 50px
+      cursor pointer
+
+      + div
+        padding: 0px 50px 25px 50px
+        @media (min-width 940px)
+          display none !important
+
+      .product-nav-arrow
+        display flex
+        transition 400ms all ease
+        @media (min-width 940px)
+          display none
+
+  .active-nav
+    background $lightgrey
+    @media (max-width 940px)
+      background white
+
+  .active-content
+    display flex !important
+
+  .rotate
+    transform: rotate(180deg)
+    transition 400ms all ease
index bc2e4c19e466a6a3badcf19b3e8e7eef9af59f1a..bbf224a6909cc1a15640cb4f4599651f2217c10c 100644 (file)
     @include('partials.header')
 
     @section('breadcrumbs')
-        @if(Menu::get('breadcrumbs')->active())
+        @if(CubistMenu::get('breadcrumbs')->active())
             <full-width padding="pt-1v pb-1v">
                 <content>
-                        {!! Menu::get('breadcrumbs')->crumbMenu()->asDiv(['class' => 'breadcrumbs'], [], ['class' => 'breadcrumbs-item']) !!}
+                        {!! CubistMenu::get('breadcrumbs')->crumbMenu()->asDiv(['class' => 'breadcrumbs'], [], ['class' => 'breadcrumbs-item']) !!}
                 </content>
             </full-width>
         @endif
index dd3b8ba06053a5b54e52e7061dec17d030a1d35b..a8ed71d25d66c85818e5309907136da121d12308 100644 (file)
 @extends('layouts/app')
 
 @section('content')
+    <content class="pt-1v">
+        <text-block title-class="h1 text-6xl" title-tag="h1">
+            <slot name="title">
+                {{$product->name}}
+            </slot>
+        </text-block>
+
+        {{-- Product details --}}
+        <div class="flex mb-2v sm:block">
+            {{-- Product images --}}
+            <div class="product-detail-images-wrapper flex-grow" style="max-width: 348px">
+                <div
+                    class="product-detail-images-main border-gray-100 border-4 pb-100p w-full bg-center bg-contain bg-no-repeat mb-3"
+                    style="background-image: url({{ $product->getMedia($product->images)->first()->getUrl() }});">
+                </div>
 
-        <content class="pt-1v">
-            <text-block title-class="h1 text-6xl" title-tag="h1">
-                <slot name="title">
-                    Modèle 1200<br>
-                    de 1.5 kN à 900kN
-                </slot>
-            </text-block>
+                <grid cols="3" gap="sm">
+                    @foreach ($product->getMedia($product->images) as $image)
+                        <div
+                            class="product-detail-images-main border-gray-100 border-4 pb-100p w-full bg-center bg-contain bg-no-repeat"
+                            style="background-image: url({{ $image->getUrl() }});">
+                        </div>
+                    @endforeach
+                </grid>
+            </div>
 
-            {{-- Product details --}}
-            <div class="flex mb-2v sm:block">
-                {{-- Product images --}}
-                <div class="product-detail-images-wrapper flex-grow" style="max-width: 348px">
-                    <div class="product-detail-images-main border-gray-100 border-4 pb-100p w-full bg-center bg-contain bg-no-repeat mb-3"
-                         style="background-image: url({{ asset('storage/products/1.png') }});">
-                    </div>
+            {{-- Product text --}}
+            <text-block class="product-detail-text sm:mt-6">
+                {!! Markdown::parse($product->highlights) !!}
 
-                    <grid cols="3" gap="sm">
-                        @for ($i = 1; $i <= 3; $i++)
-                            <div class="product-detail-images-main border-gray-100 border-4 pb-100p w-full bg-center bg-contain bg-no-repeat"
-                                 style="background-image: url({{ asset('storage/products/1.png') }});">
-                            </div>
-                        @endfor
-                    </grid>
-                </div>
+                @if(count($product->getMedia($product->technical_sheet)))
+                    <p class="mt-4"><a href="{{$product->getMedia($product->technical_sheet)->first()->getUrl()}}">Télécharger
+                            la fiche produit</a></p>
+                @endif
 
-                {{-- Product text --}}
-                <text-block class="product-detail-text sm:mt-6">
-                    <ul>
-                        <li>Non-linéarité ± 0.03 % pleine échelle</li>
-                        <li>Compensation mécanique des efforts transverses.</li>
-                        <li>Utilise des jauges de contrainte Interface auto compensées.</li>
-                        <li>Compensation barométrique</li>
-                        <li>Sensibilité à la température < 0.0015% / °C</li>
-                        <li>Etendue de mesure de 1.25 kN à 450 kN</li>
-                        <li>Protection en surcharge : 300% de la gamme de mesure</li>
-                        <li>Disponible en double ponts</li>
-                    </ul>
+                <link-button href="#" class="align-middle">Ajouter à ma sélection</link-button>
 
-                    <p class="mt-4"><a href="#">Télécharger la fiche produit</a></p>
+                <span
+                    class="font-display text-lg inline-block align-middle rounded-full border-grey-dark border-2 h-8 w-8 text-center ml-6">?</span>
 
-                    <link-button href="#" class="align-middle">Ajouter à ma sélection</link-button>
+            </text-block>
 
-                    <span class="font-display text-lg inline-block align-middle rounded-full border-grey-dark border-2 h-8 w-8 text-center ml-6">?</span>
 
-                </text-block>
+        </div>
 
+    </content>
 
-            </div>
+    @push('scripts')
+        <script src="{{mix('js/product-details.js')}}"></script>
+    @endpush
 
-        </content>
+    <div id="product-tabs">
+        <ul class="flex product-nav">
+            @if($product->descriptions)
+                <li class="product-nav-item ">
+                    <div data-nav="0" class="section-title justify-between items-center active-nav">
+                        {{trans('Description')}}
+                        <img class="product-nav-arrow" src="{{asset('images/product-details/arrow-down.svg')}}" alt="">
+                    </div>
+
+                    <div>
+                        {!! Markdown::parse($product->descriptions) !!}
+                    </div>
+                </li>
+            @endif
+            <li class="product-nav-item">
+                <div data-nav="1" class="section-title justify-between items-center">
+                    {{trans('Spécifications')}}
+                    <img class="product-nav-arrow" src="{{asset('images/product-details/arrow-down.svg')}}" alt="">
+                </div>
+                <div>
+                    <ul class="specification-list">
+                        <li class=" flex justify-between">
+                            <div class="specification-info">Etendue de mesure (kN)</div>
+                            <div class="specification-value">1.5 / 2.5 / 5 / 10</div>
+                        </li>
+                        <li class="flex justify-between mt-6">
+                            <div class="specification-info">Précision (erreur totale)</div>
+                            <div class="specification-value">± 0.04</div>
+                        </li>
+
+                        <li class="flex justify-between mt-6">
+                            <div class="specification-info">Non-linéarité, % PE</div>
+                            <div class="specification-value">± 0.04</div>
+                        </li>
+                        <li class="flex justify-between mt-6">
+                            <div class="specification-info">Hystérésis, % PE</div>
+                            <div class="specification-value">± 0.03</div>
+                        </li>
+                        <li class="flex justify-between mt-6">
+                            <div class="specification-info">Non-répétabilité, % PE</div>
+                            <div class="specification-value">± 0.01</div>
+                        </li>
+                        <li class="flex justify-between mt-6">
+                            <div class="specification-info">Dérive sous charge (20 mins)</div>
+                            <div class="specification-value">± 0.025</div>
+                        </li>
+                        <li class="flex justify-between mt-6">
+                            <div class="specification-info">Sensibilité transverse %</div>
+                            <div class="specification-value">± 0.25</div>
+                        </li>
+                        <li class="flex justify-between mt-6">
+                            <div class="specification-info">Gamme de compensation °C</div>
+                            <div class="specification-value">-10 à + 45</div>
+                        </li>
+                        <li class="flex justify-between mt-6">
+                            <div class="specification-info">Gamme d'utilisation °C</div>
+                            <div class="specification-value">-55 à 90</div>
+                        </li>
+                        <li class="flex justify-between mt-6">
+                            <div class="specification-info">Sensibilité au Zéro (%PE/°C)</div>
+                            <div class="specification-value">± 0.0015</div>
+                        </li>
+                    </ul>
+                </div>
+            </li>
+            @if($product->hasDocuments())
+                <li class="product-nav-item">
+                    <div data-nav="2" class="section-title justify-between items-center">
+                        {{trans('Documents')}}
+                        <img class="product-nav-arrow" src="{{asset('images/product-details/arrow-down.svg')}}" alt="">
+                    </div>
+                    <div>
+                        <ul class="text-grey-dark">
+                            @foreach($product->getDocuments() as $document)
+                                <li class="flex items-center ">
+                                    <a href="{{$document['media']->getUrl()}}" target="_blank">
+                                        <img class="mr-4 mb-2"
+                                             src="{{asset('images/product-details/icon-'.$document['type'].'.svg')}}"
+                                             alt="">
+                                        {{$document['label']}}
+                                    </a>
+                                </li>
+                            @endforeach
+                        </ul>
+                    </div>
+                </li>
+            @endif
+
+            @if($product->dimensions)
+                <li class="product-nav-item">
+                    <div data-nav="3" class="section-title justify-between items-center">
+                        {{trans('Dimensions')}}
+                        <img class="product-nav-arrow" src="{{asset('images/product-details/arrow-down.svg')}}" alt="">
+                    </div>
+                    <div data-content="3" class="option">
+                        {!! Markdown::parse($product->dimensions) !!}
+                    </div>
+                </li>
+            @endif
+            @if($product->options)
+                <li class="product-nav-item">
+                    <div class="section-title justify-between items-center">
+                        {{trans('Options')}}
+                        <img class="product-nav-arrow" src="{{asset('images/product-details/arrow-down.svg')}}" alt="">
+                    </div>
+                    <div>
+                        {!! Markdown::parse($product->options) !!}
+                    </div>
+                </li>
+            @endif
+            @if($product->accessories)
+                <li class="product-nav-item">
+                    <div class="section-title justify-between items-center">
+                        {{trans('Accessoires')}}
+                        <img class="product-nav-arrow" src="{{asset('images/product-details/arrow-down.svg')}}" alt="">
+                    </div>
+                    <div>
+                        {!! Markdown::parse($product->accessories) !!}
+                    </div>
+                </li>
+            @endif
+        </ul>
+    </div>
 
     <full-width class="bg-grey-100">
         <content>
 
-            <text-block title="Produits associés" title-class="h2" />
+            <text-block title="Produits associés" title-class="h2"/>
 
             {{-- Product Grid --}}
             <grid cols="auto" class="products-grid">
                         <div class="p-4">
                             <h3>Modèle 1200 de 1.5 kN à 900kN</h3>
                             <ul class="text-sm">
-                                <li>Étendue de mesure : 1.5 kN à 900 kN </li>
-                                <li>Sortie élevée : 2 ou 4 mV/V </li>
+                                <li>Étendue de mesure : 1.5 kN à 900 kN</li>
+                                <li>Sortie élevée : 2 ou 4 mV/V</li>
                                 <li>Précision : 0.04% à 0.07% pleine échelle</li>
                                 <li>Compensé pour les efforts transverses</li>
                             </ul>
index 68c8e1464c1fa656bc5c64d18738aa26b7cdff6d..9b4e07db02fceba6cb6c5b6a5e84b2dbcc384119 100644 (file)
                 </div>
             </a>
 
-            <a class="footer-contact-block" href="#">
+            <a class="footer-contact-block" href="mailto:{{$global->email}}">
                 @svg('icon-email', 'footer-contact-icon')
                 <div class="footer-contact-text">
                     <div class="footer-contact-title">{{ __('Email') }}</div>
 
-                    contact@pm-instrumentation.com
+                    {{$global->email}}
                 </div>
             </a>
 
index ae53b8326dde9fe6a6e513c7bacc1baa6e820e21..6416c11a43bc8436ac4bcda0ceebb556f9b22a2e 100644 (file)
@@ -1 +1 @@
-{!! Menu::get('primary')->asUl(['class' => 'nav-primary']) !!}
+{!! CubistMenu::get('#main')->asUl(['class' => 'nav-primary']) !!}
index 05ca4952b4d511e8a021e2b98b0f6785186b0a19..929101a37a99ccd4d3d32c8236a402e76ba8ddfe 100644 (file)
@@ -14,11 +14,6 @@ Route::group([
         Route::match(['delete'], 'page/{id}/media/{mediaId}', 'PageCrudController@deleteMedia');
         Route::match(['post'], 'page/{id}/media/reorder', 'PageCrudController@reorderMedia');
     });
-    CRUD::resource('product', 'ProductCrudController')->with(function () {
-        Route::match(['post'], 'product/{id}/media', 'ProductCrudController@uploadMedia');
-        Route::match(['delete'], 'product/{id}/media/{mediaId}', 'ProductCrudController@deleteMedia');
-        Route::match(['post'], 'product/{id}/media/reorder', 'ProductCrudController@reorderMedia');
-    });
     CRUD::resource('producttype', 'ProductTypeCrudController')->with(function () {
         Route::match(['post'], 'producttype/{id}/media', 'ProductTypeCrudController@uploadMedia');
         Route::match(['delete'], 'producttype/{id}/media/{mediaId}', 'ProductTypeCrudController@deleteMedia');
index 9816886c2b72b9ab0bb8d35a9baed45bdb76f92c..25e01e823f1527902e5fd74ad03cd4da961f8855 100644 (file)
 |
 */
 
-Route::get('/', function () {
-    return view('pages.home');
-});
-
 Route::get('/products/{category}/{id}', function ($category, $id = null) {
     return view('pages.product-detail', compact('category', 'id'));
 })->where(['category' => '.*']);
@@ -28,6 +24,9 @@ Route::get('/products/{category}', function ($category) {
 //    return view('pages.test', compact('name'));
 //})->where(['name' => '.*']);
 
+Route::get('product/{id}', ['uses' => 'ProductController@productDetails']);
+
 /** CATCH-ALL ROUTE for CMS Pages - needs to be at the end of your web.php file  **/
 Route::get('{page}/{subs?}', ['uses' => 'PageController@index'])
     ->where(['page' => '^(((?=(?!admin))(?=(?!\/)).))*$', 'subs' => '.*']);
+
index dcff99b46fcc839a86bf8416e213afcaca50881e..13ed6291c2dd5d51da8aa5f8fa014360a50d60f7 100644 (file)
@@ -19,6 +19,7 @@ mix.browserSync({
 });
 
 mix.js('resources/js/app.js', 'public/js')
+   .js('resources/js/product-details.js','public/js')
    .stylus('resources/styles/app.styl', 'public/css', {
         use: [
             require('rupture')()