diff --git a/app/Http/Controllers/Bo/GammesController.php b/app/Http/Controllers/Bo/GammesController.php index 5f2a1f0..5b80ab7 100644 --- a/app/Http/Controllers/Bo/GammesController.php +++ b/app/Http/Controllers/Bo/GammesController.php @@ -5,6 +5,7 @@ namespace App\Http\Controllers\Bo; use App\Http\Controllers\Controller; use App\Http\Requests\StoreGammeRequest; use App\Http\Requests\UpdateGammeRequest; +use App\Lib\Utils; use App\Models\Gamme; class GammesController extends Controller @@ -57,6 +58,12 @@ class GammesController extends Controller public function store(StoreGammeRequest $request) { $gamme = new Gamme($request->validated()); + if (is_a($request->picture, "SplFileInfo")) { + $gamme->picture = Utils::storeImage($request->picture, $gamme->getTable()); + } + if (is_a($request->banner, "SplFileInfo")) { + $gamme->banner = Utils::storeImage($request->banner, $gamme->getTable()); + } if (!$gamme->saveOrFail()) { return redirect()->route('bo.gammes.edit', $gamme->id)->with('error', 'L\'actualité n\'a pas été créee'); @@ -90,6 +97,12 @@ class GammesController extends Controller public function update(Gamme $gamme, UpdateGammeRequest $request) { $gamme->fill($request->validated()); + if (is_a($request->picture, "SplFileInfo")) { + $gamme->picture = Utils::storeImage($request->picture, $gamme->getTable()); + } + if (is_a($request->banner, "SplFileInfo")) { + $gamme->banner = Utils::storeImage($request->banner, $gamme->getTable()); + } if (!$gamme->saveOrFail()) { return redirect()->route('bo.gammes.edit', $gamme->id) diff --git a/app/Http/Controllers/Bo/PictosController.php b/app/Http/Controllers/Bo/PictosController.php index ab48988..adec3f6 100644 --- a/app/Http/Controllers/Bo/PictosController.php +++ b/app/Http/Controllers/Bo/PictosController.php @@ -43,11 +43,12 @@ class PictosController extends Controller public function store(StorePictoRequest $request) { $picto = new Picto($request->validated()); - if (is_a($request->picture,"SplFileInfo")) { + if (is_a($request->picture, "SplFileInfo")) { $picto->picture = Utils::storeImage($request->picture, $picto->getTable()); } //on ne peut pas arbitrairement créer tous les pictos à cet endroit - //$picto->page = Page::marqueBloc2(); + //j'ai du décommenter cette ligne pour la création picto fonctionne + $picto->page = Page::marqueBloc2(); if (!$picto->saveOrFail()) { return redirect()->route('bo.pictos.edit', $picto->id)->with('error', 'Le pictogramme n\'a pas été crée'); @@ -77,7 +78,7 @@ class PictosController extends Controller public function update(Picto $picto, StorePictoRequest $request) { $picto->fill($request->validated()); - if (is_a($request->picture,"SplFileInfo")) { + if (is_a($request->picture, "SplFileInfo")) { $picto->picture = Utils::storeImage($request->picture, $picto->getTable()); } diff --git a/app/Http/Controllers/Bo/TextsController.php b/app/Http/Controllers/Bo/TextsController.php index 6d67acc..bb39dd2 100644 --- a/app/Http/Controllers/Bo/TextsController.php +++ b/app/Http/Controllers/Bo/TextsController.php @@ -47,11 +47,11 @@ class TextsController extends Controller if (!$text->saveOrFail()) { return redirect() ->route('bo.texts.edit', $text->id) - ->with('error', 'La question/réponse n\'a pas été crée'); + ->with('error', 'La question/réponse n\'a pas été créée'); } return redirect() ->route('bo.texts.edit', $text->id) - ->with('success', 'Question/réponse créé !'); + ->with('success', 'Question/réponse créée !'); } /** diff --git a/app/Models/Product.php b/app/Models/Product.php index 614ef2f..b4cd42f 100644 --- a/app/Models/Product.php +++ b/app/Models/Product.php @@ -45,13 +45,13 @@ class Product extends Model protected static function boot() { static::creating(function (Product $product) { - if (is_a($product->picture,"SplFileInfo")) { + if (is_a($product->picture, "SplFileInfo")) { $product->picture = Utils::storeImage($product->picture, $product->getTable()); } }); static::updating(function (Product $product) { - if (is_a($product->picture,"SplFileInfo")) { + if (is_a($product->picture, "SplFileInfo")) { $product->picture = Utils::storeImage($product->picture, $product->getTable()); } }); @@ -67,7 +67,7 @@ class Product extends Model } //delete des images de plus produit $plusproduit = json_decode($product->plusproduit); - foreach($plusproduit as $plus) { + foreach ($plusproduit as $plus) { $urlPicture = public_path() . $plus->url; if ($urlPicture) { if (File::exists($urlPicture)) { diff --git a/public/css/preload-front.css b/public/css/preload-front.css index 282d163..84c092c 100644 --- a/public/css/preload-front.css +++ b/public/css/preload-front.css @@ -4428,12 +4428,13 @@ ul.infos span{ position:absolute; } +#list .p-abs{ + position:static; +} + .p-abs.dual-center{ padding-left:0 !important; padding-right:0 !important; - left:50% !important; - top:50% !important; - transform:translate(-50%, -50%) !important; } .color-red{ @@ -4453,6 +4454,16 @@ ul.infos span{ } @media screen and (min-width: 800px){ + #list .p-abs{ + position:absolute; + } + + .p-abs.dual-center{ + left:50% !important; + top:50% !important; + transform:translate(-50%, -50%) !important; + } + .is-flex .w25{ flex-basis:25%; } @@ -4674,7 +4685,7 @@ h3:not(.item__title, .product-card__title){ @media screen and (max-width: 799px){ .breadcrumb{ max-width:70%; - top:-60px; + top:-20px; right:0; justify-content:flex-end; flex-direction:initial; @@ -4980,6 +4991,8 @@ h3:not(.item__title, .product-card__title){ .footer-widgets .footer-widgets__content{ left:20%; right:0; + top:50%; + transform:translateY(-50%); } .footer-widgets .footer-widgets__content.white-color p{ color:white; @@ -5038,6 +5051,7 @@ h3:not(.item__title, .product-card__title){ .footer-widgets .footer-widgets__content{ text-align:center; left:50%; + top:unset; transform:translateX(-50%); bottom:20px; } @@ -5394,17 +5408,11 @@ input[type=text]{ flex-direction:initial; } #list .section-header{ - margin-bottom:30px; color:#fff; } #list .section-header .title{ margin-bottom:5px; } -#list .section-header .content{ - top:30px; - padding-left:30px; - padding-right:30px; -} #list .section-header > img{ -o-object-fit:cover; object-fit:cover; @@ -5505,6 +5513,9 @@ input[type=text]{ max-width:49%; } + #list .section-header{ + margin-bottom:80px; + } #list .section-header .content{ position:absolute; width:100%; @@ -5522,9 +5533,6 @@ input[type=text]{ } } @media (max-width: 1024px){ - #list .section-header{ - margin-bottom:80px; - } #list .is-flex{ justify-content:center; } @@ -5535,10 +5543,6 @@ input[type=text]{ } } @media (max-width: 768px){ - #list .section-header .content{ - position:relative; - } - #posts > img{ position:absolute; top:0; diff --git a/public/js/preload-back.js b/public/js/preload-back.js index 012d28e..9f5bd9f 100644 --- a/public/js/preload-back.js +++ b/public/js/preload-back.js @@ -10,14 +10,17 @@ // require('./bootstrap'); // require('./vuejs'); var selectElement = document.getElementById('gamme_id'); -selectElement.addEventListener('change', function (event) { - var selectSubRange = document.getElementById('sous_gamme_id'); - var length = selectSubRange.options.length; - for (i = length - 1; i > 0; i--) { - selectSubRange.options[i] = null; - } -}); +if (selectElement != null) { + selectElement.addEventListener('change', function (event) { + var selectSubRange = document.getElementById('sous_gamme_id'); + var length = selectSubRange.options.length; + + for (i = length - 1; i > 0; i--) { + selectSubRange.options[i] = null; + } + }); +} /***/ }), diff --git a/resources/js/back.js b/resources/js/back.js index 93e02a9..da2b6bd 100644 --- a/resources/js/back.js +++ b/resources/js/back.js @@ -3,10 +3,12 @@ const selectElement = document.getElementById('gamme_id'); -selectElement.addEventListener('change', (event) => { - let selectSubRange = document.getElementById('sous_gamme_id'); - let length = selectSubRange.options.length; - for (i = length - 1; i > 0; i--) { - selectSubRange.options[i] = null; - } -}); \ No newline at end of file +if (selectElement != null) { + selectElement.addEventListener('change', (event) => { + let selectSubRange = document.getElementById('sous_gamme_id'); + let length = selectSubRange.options.length; + for (i = length - 1; i > 0; i--) { + selectSubRange.options[i] = null; + } + }); +} diff --git a/resources/sass/frontend/_footer.scss b/resources/sass/frontend/_footer.scss index c26f129..fe89165 100644 --- a/resources/sass/frontend/_footer.scss +++ b/resources/sass/frontend/_footer.scss @@ -16,6 +16,9 @@ .footer-widgets__content { left: 20%; right: 0; + top: 50%; + transform: translateY(-50%); + &.white-color { p { color: white; @@ -85,6 +88,7 @@ .footer-widgets__content { text-align: center; left: 50%; + top: unset; transform: translateX(-50%); bottom: 20px; diff --git a/resources/sass/frontend/_links.scss b/resources/sass/frontend/_links.scss index 8356e7a..66943c7 100644 --- a/resources/sass/frontend/_links.scss +++ b/resources/sass/frontend/_links.scss @@ -52,7 +52,7 @@ @media screen and (max-width: 799px) { .breadcrumb { max-width: 70%; - top: -60px; + top: -20px; right: 0; justify-content: flex-end; flex-direction: initial; diff --git a/resources/sass/frontend/_list.scss b/resources/sass/frontend/_list.scss index cc41c60..c3882e4 100644 --- a/resources/sass/frontend/_list.scss +++ b/resources/sass/frontend/_list.scss @@ -98,17 +98,17 @@ flex-direction: initial; } .section-header { - margin-bottom: 30px; + // margin-bottom: 30px; color: $color-light; .title { margin-bottom: 5px; } - .content { - top: 30px; - padding-left: 30px; - padding-right: 30px; - } + // .content { + // top: 30px; + // padding-left: 30px; + // padding-right: 30px; + // } & > img { object-fit: cover; max-height: 243px; @@ -352,6 +352,8 @@ #list { .section-header { + margin-bottom: 80px; + .content { position: absolute; width: 100%; @@ -374,9 +376,9 @@ @media (max-width: 1024px) { #list { - .section-header { - margin-bottom: 80px; - } + // .section-header { + // margin-bottom: 80px; + // } .is-flex { justify-content: center; } @@ -394,16 +396,16 @@ } @media (max-width: 768px) { - #list { - // .wrapper > div:not(:last-child) { - // margin-bottom: 2rem; - // } - .section-header { - .content { - position: relative; - } - } - } + // #list { + // .wrapper > div:not(:last-child) { + // margin-bottom: 2rem; + // } + // .section-header { + // .content { + // position: relative; + // } + // } + // } #posts { > img { position: absolute; diff --git a/resources/sass/frontend/_utils.scss b/resources/sass/frontend/_utils.scss index 0bf7e13..43896f0 100644 --- a/resources/sass/frontend/_utils.scss +++ b/resources/sass/frontend/_utils.scss @@ -62,12 +62,15 @@ .p-abs { position: absolute; } +#list .p-abs { + position: static; +} .p-abs.dual-center { padding-left: 0 !important; padding-right: 0 !important; - left: 50% !important; - top: 50% !important; - transform: translate(-50%, -50%) !important; + // left: 50% !important; + // top: 50% !important; + // transform: translate(-50%, -50%) !important; } .color-red { @@ -87,6 +90,14 @@ } @media screen and (min-width: 800px) { + #list .p-abs { + position: absolute; + } + .p-abs.dual-center { + left: 50% !important; + top: 50% !important; + transform: translate(-50%, -50%) !important; + } .is-flex .w25 { flex-basis: 25%; } diff --git a/resources/views/back/pictos/create.blade.php b/resources/views/back/pictos/create.blade.php index bdc98f1..06cc0e7 100644 --- a/resources/views/back/pictos/create.blade.php +++ b/resources/views/back/pictos/create.blade.php @@ -6,7 +6,8 @@