From d8ff1925609b963ce4b5a36ebb7a5e6a4faf3c55 Mon Sep 17 00:00:00 2001 From: Stephen Cameron Date: Wed, 17 Jul 2019 16:42:48 +0200 Subject: [PATCH] Fix VueJS error when cart is turned off + other misc fixes / style adjustments. WIP #2738 @0.5 --- resources/styles/components/products.styl | 2 +- resources/views/layouts/app.blade.php | 26 ++++++++------- resources/views/pages/products.blade.php | 2 +- resources/views/partials/cart.blade.php | 7 ++-- resources/views/partials/header.blade.php | 40 ++++++++++++----------- 5 files changed, 39 insertions(+), 38 deletions(-) diff --git a/resources/styles/components/products.styl b/resources/styles/components/products.styl index fe3c425..4bba0a1 100644 --- a/resources/styles/components/products.styl +++ b/resources/styles/components/products.styl @@ -8,4 +8,4 @@ // automatically change the number of columns based // on this min-width setting... &.grid-cols-auto - grid-template-columns: repeat(auto-fit, minmax(270px, 1fr)) + grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)) diff --git a/resources/views/layouts/app.blade.php b/resources/views/layouts/app.blade.php index 7f8ac9c..515d8e2 100644 --- a/resources/views/layouts/app.blade.php +++ b/resources/views/layouts/app.blade.php @@ -13,19 +13,21 @@ @include('cubist::body.begin') @php - //#### Generate temporary cart data - $cart_items = []; - if(config('features.quote')){ - for ($i = 1; $i <= 6; $i++) { - $cart_items[$i] = [ - 'id' => $i, - 'quantity' => rand(1, 15), - 'name' => 'Modèle '. rand(1000, 1500), - 'category' => 'Capteur de force', - 'image' => '/storage/products/'. rand(1,6) .'.png', - ]; + if (config('features.quote')) { + //#### Generate temporary cart data + $cart_items = []; + for ($i = 1; $i <= 6; $i++) { + $cart_items[$i] = [ + 'id' => $i, + 'quantity' => rand(1, 15), + 'name' => 'Modèle '. rand(1000, 1500), + 'category' => 'Capteur de force', + 'image' => '/storage/products/'. rand(1,6) .'.png', + ]; + } + } else { + $cart_items = new stdClass(); } -} @endphp
diff --git a/resources/views/pages/products.blade.php b/resources/views/pages/products.blade.php index 039e2fc..847e8d6 100644 --- a/resources/views/pages/products.blade.php +++ b/resources/views/pages/products.blade.php @@ -1,7 +1,7 @@ @extends('layouts/app') @section('content') - @intro() + @intro(['padding' => 'pb-1v']) diff --git a/resources/views/partials/cart.blade.php b/resources/views/partials/cart.blade.php index cc5fea9..164e5eb 100644 --- a/resources/views/partials/cart.blade.php +++ b/resources/views/partials/cart.blade.php @@ -1,5 +1,2 @@ -@if(config('features.quote')) - My Selection - -@endif - +My Selection + diff --git a/resources/views/partials/header.blade.php b/resources/views/partials/header.blade.php index e5aa7e3..f8677ff 100644 --- a/resources/views/partials/header.blade.php +++ b/resources/views/partials/header.blade.php @@ -14,27 +14,29 @@
-
- @include('partials.cart') -
- -
-
- - {{ __('Ma sélection') }} - - - - @svg('icon-close-thin') - + @if (config('features.quote')) +
+ @include('partials.cart')
-
- -
- + @endif
-- 2.39.5