Ajout page En ce moment + Refonte chemins des images BO + Images pour le front

This commit is contained in:
Romain Bonhomme 2021-01-19 12:28:54 +01:00
parent 83441db0cb
commit b12e3bbd02
101 changed files with 873 additions and 386 deletions

View file

@ -38,7 +38,7 @@ class AdsController extends Controller
$a = new Ads();
$a->title = $title;
$a->link = $link;
$a->picture = date('Y') . '/' . date('m') . '/' . $imageName;
$a->picture = 'images/publicites/' . date('Y') . '/' . date('m') . '/' . $imageName;
$a->status = 0;
$a->save();
@ -72,8 +72,8 @@ class AdsController extends Controller
$a = Ads::findOrFail($id);
if ($picture !== NULL){
if(file_exists(public_path('images/publicites/') . $a->picture))
unlink(public_path('images/publicites/') . $a->picture);
if(file_exists(public_path() . '/' . $a->picture))
unlink(public_path() . '/' . $a->picture);
$imageName = Str::slug($title) .'-le-gaulois.'.$picture->extension();
$picture->move(public_path('images/publicites/' . date('Y') . '/' . date('m')), $imageName);
}
@ -81,7 +81,7 @@ class AdsController extends Controller
$a->title = $title;
$a->link = $link;
if ($picture !== NULL)
$a->picture = date('Y') . '/' . date('m') . '/' . $imageName;
$a->picture = 'images/publicites/' . date('Y') . '/' . date('m') . '/' . $imageName;
$a->status = $status;
$a->save();
@ -92,8 +92,8 @@ class AdsController extends Controller
{
$a = Ads::findOrFail($id);
if(file_exists(public_path('images/publicites/') . $a->picture))
unlink(public_path('images/publicites/') . $a->picture);
if(file_exists(public_path() . '/' . $a->picture))
unlink(public_path() . '/' . $a->picture);
$a->delete();

View file

@ -61,8 +61,8 @@ class ArticlesController extends Controller
$a = new Articles();
$a->title = $title;
$a->slug = $slug;
$a->picture = date('Y') . '/' . date('m') . '/' . $imageName;
$a->picture_r = date('Y') . '/' . date('m') . '/' . $imageName_r;
$a->picture = 'images/articles/' . date('Y') . '/' . date('m') . '/' . $imageName;
$a->picture_r = 'images/articles/' . date('Y') . '/' . date('m') . '/' . $imageName_r;
$a->content = $content;
$a->category_id = $categoryId;
if ($categoryId === "4") {
@ -142,14 +142,14 @@ class ArticlesController extends Controller
$a = Articles::findOrFail($id);
if ($picture !== NULL){
if(file_exists(public_path('images/articles/') . $a->picture))
unlink(public_path('images/articles/') . $a->picture);
if(file_exists(public_path() . '/' . $a->picture))
unlink(public_path() . '/' . $a->picture);
$imageName = Str::slug($title) .'.'.$picture->extension();
$picture->move(public_path('images/articles/' . date('Y') . '/' . date('m') . '/'), $imageName);
}
if ($picture_r !== NULL) {
if(file_exists(public_path('images/articles/') . $a->picture_r))
unlink(public_path('images/articles/') . $a->picture_r);
if(file_exists(public_path() . '/' . $a->picture_r))
unlink(public_path() . '/' . $a->picture_r);
$imageName_r = Str::slug($title) . '_r.' . $picture_r->extension();
$picture_r->move(public_path('images/articles/' . date('Y') . '/' . date('m') . '/'), $imageName_r);
}
@ -157,9 +157,9 @@ class ArticlesController extends Controller
$a->title = $title;
$a->slug = $slug;
if ($picture !== null)
$a->picture = date('Y') . '/' . date('m') . '/' . $imageName;
$a->picture = 'images/articles/' . date('Y') . '/' . date('m') . '/' . $imageName;
if ($picture_r !== null)
$a->picture_r = date('Y') . '/' . date('m') . '/' . $imageName_r;
$a->picture_r = 'images/articles/' . date('Y') . '/' . date('m') . '/' . $imageName_r;
$a->content = $content;
$a->category_id = $categoryId;
if ($categoryId === "4") {
@ -196,10 +196,10 @@ class ArticlesController extends Controller
{
$a = Articles::findOrFail($id);
if (file_exists(public_path('images/articles/') . $a->picture))
unlink(public_path('images/articles/') . $a->picture);
if (file_exists(public_path('images/articles/') . $a->picture_r))
unlink(public_path('images/articles/') . $a->picture_r);
if (file_exists(public_path() . '/' . $a->picture))
unlink(public_path() . '/' . $a->picture);
if (file_exists(public_path() . '/' . $a->picture_r))
unlink(public_path() . '/' . $a->picture_r);
$a->delete();

View file

@ -53,7 +53,7 @@ class BalancedMenusController extends Controller
$m = new BalancedMenus();
$m->product_id = $productId;
$m->type = $type;
$m->picture = date('Y') . '/' . date('m') . '/' . $imageName;
$m->picture = 'images/menus-equilibres/' . date('Y') . '/' . date('m') . '/' . $imageName;
$m->entree = $entree;
$m->meal = $meal;
$m->dessert = $dessert;
@ -99,8 +99,8 @@ class BalancedMenusController extends Controller
$m = BalancedMenus::findOrFail($id);
if ($picture !== null) {
if (file_exists(public_path('images/menus-equilibres/') . $m->picture))
unlink(public_path('images/menus-equilibres/') . $m->picture);
if (file_exists(public_path() . '/' . $m->picture))
unlink(public_path() . '/' . $m->picture);
$imageName = 'menu-' . $typeChaine . '-' . date('d-m-Y-h-i-s') .'-le-gaulois' . '.' . $picture->extension();
$picture->move(public_path('images/menus-equilibres/' . date('Y') . '/' . date('m')), $imageName);
}
@ -108,7 +108,7 @@ class BalancedMenusController extends Controller
$m->product_id = $productId;
$m->type = $type;
if ($picture !== null)
$m->picture = date('Y') . '/' . date('m') . '/' . $imageName;
$m->picture = 'images/menus-equilibres/' . date('Y') . '/' . date('m') . '/' . $imageName;
$m->entree = $entree;
$m->meal = $meal;
$m->dessert = $dessert;
@ -122,8 +122,8 @@ class BalancedMenusController extends Controller
{
$m = BalancedMenus::findOrFail($id);
if (file_exists(public_path('images/menus-equilibres/') . $m->picture))
unlink(public_path('images/menus-equilibres/') . $m->picture);
if (file_exists(public_path() . '/' . $m->picture))
unlink(public_path() . '/' . $m->picture);
$m->delete();

View file

@ -108,7 +108,7 @@ class BreedersController extends Controller
$b->first_name = $firstName;
$b->last_name = $lastName;
$b->slug = $slug;
$b->picture = date('Y') . '/' . date('m') . '/' . $imageName;
$b->picture = 'images/eleveurs/' . date('Y') . '/' . date('m') . '/' . $imageName;
$b->postal_code = $postalCode;
$b->town = $town;
$b->testimony = $testimony;
@ -128,11 +128,11 @@ class BreedersController extends Controller
$s->video_link = $videoLink;
} elseif ($presentationType === "2") {
if ($picture1 !== null)
$s->picture1 = date('Y') . '/' . date('m') . '/' . $imageNameSite1;
$s->picture1 = 'images/elevages/' . date('Y') . '/' . date('m') . '/' . $imageNameSite1;
if ($picture2 !== null)
$s->picture2 = date('Y') . '/' . date('m') . '/' . $imageNameSite2;
$s->picture2 = 'images/elevages/' . date('Y') . '/' . date('m') . '/' . $imageNameSite2;
if ($picture3 !== null)
$s->picture3 = date('Y') . '/' . date('m') . '/' . $imageNameSite3;
$s->picture3 = 'images/elevages/' . date('Y') . '/' . date('m') . '/' . $imageNameSite3;
}
// Ajout en BDD
@ -227,8 +227,8 @@ class BreedersController extends Controller
// Gestion des images
if ($picture !== null) {
if ($b->picture !== null && file_exists(public_path('images/eleveurs/') . $b->picture))
unlink(public_path('images/eleveurs/') . $b->picture);
if ($b->picture !== null && file_exists(public_path() . '/' . $b->picture))
unlink(public_path() . '/' . $b->picture);
$imageName = Str::slug($lastName) . '-' . Str::slug($firstName) .'-le-gaulois.' . $picture->extension();
$picture->move(public_path('images/eleveurs/' . date('Y') . '/' . date('m')), $imageName);
}
@ -236,31 +236,31 @@ class BreedersController extends Controller
if ($presentationType === "2") {
// Ajout des images seulement si le type de présentation est "Photos"
if ($picture1 !== null) {
if ($b->site->picture1 !== null && file_exists(public_path('images/elevages/') . $b->site->picture1))
unlink(public_path('images/elevages/') . $b->site->picture1);
if ($b->site->picture1 !== null && file_exists(public_path() . '/' . $b->site->picture1))
unlink(public_path() . '/' . $b->site->picture1);
$imageNameSite1 = Str::slug($lastName) . '-' . Str::slug($firstName) .'-site1-elevage-le-gaulois.' . $picture1->extension();
$picture1->move(public_path('images/elevages/' . date('Y') . '/' . date('m')), $imageNameSite1);
}
if ($picture2 !== null) {
if ($b->site->picture2 !== null && file_exists(public_path('images/elevages/') . $b->site->picture2))
unlink(public_path('images/elevages/') . $b->site->picture2);
if ($b->site->picture2 !== null && file_exists(public_path() . '/' . $b->site->picture2))
unlink(public_path() . '/' . $b->site->picture2);
$imageNameSite2 = Str::slug($lastName) . '-' . Str::slug($firstName) .'-site2-elevage-le-gaulois.' . $picture2->extension();
$picture2->move(public_path('images/elevages/' . date('Y') . '/' . date('m')), $imageNameSite2);
}
if ($picture3 !== null) {
if ($b->site->picture3 !== null && file_exists(public_path('images/elevages/') . $b->site->picture3))
unlink(public_path('images/elevages/') . $b->site->picture3);
if ($b->site->picture3 !== null && file_exists(public_path() . '/' . $b->site->picture3))
unlink(public_path() . '/' . $b->site->picture3);
$imageNameSite3 = Str::slug($lastName) . '-' . Str::slug($firstName) .'-site3-elevage-le-gaulois.' . $picture3->extension();
$picture3->move(public_path('images/elevages/' . date('Y') . '/' . date('m')), $imageNameSite3);
}
} else {
// Sinon, suppression des photos puisqu'elles ne seront plus utilisées
if ($b->site->picture1 !== null && file_exists(public_path('images/elevages/') . $b->site->picture1))
unlink(public_path('images/elevages/') . $b->site->picture1);
if ($b->site->picture2 !== null && file_exists(public_path('images/elevages/') . $b->site->picture2))
unlink(public_path('images/elevages/') . $b->site->picture2);
if ($b->site->picture3 !== null && file_exists(public_path('images/elevages/') . $b->site->picture3))
unlink(public_path('images/elevages/') . $b->site->picture3);
if ($b->site->picture1 !== null && file_exists(public_path() . '/' . $b->site->picture1))
unlink(public_path() . '/' . $b->site->picture1);
if ($b->site->picture2 !== null && file_exists(public_path() . '/' . $b->site->picture2))
unlink(public_path() . '/' . $b->site->picture2);
if ($b->site->picture3 !== null && file_exists(public_path() . '/' . $b->site->picture3))
unlink(public_path() . '/' . $b->site->picture3);
}
// Ajout des différents objets en base
@ -271,7 +271,7 @@ class BreedersController extends Controller
$b->last_name = $lastName;
$b->slug = $slug;
if ($picture !== null)
$b->picture = date('Y') . '/' . date('m') . '/' . $imageName;
$b->picture = 'images/eleveurs/' . date('Y') . '/' . date('m') . '/' . $imageName;
$b->postal_code = $postalCode;
$b->town = $town;
$b->testimony = $testimony;
@ -295,11 +295,11 @@ class BreedersController extends Controller
} elseif ($presentationType === "2") {
$s->video_link = null;
if ($picture1 !== null)
$s->picture1 = date('Y') . '/' . date('m') . '/' . $imageNameSite1;
$s->picture1 = 'images/elevages/' . date('Y') . '/' . date('m') . '/' . $imageNameSite1;
if ($picture2 !== null)
$s->picture2 = date('Y') . '/' . date('m') . '/' . $imageNameSite2;
$s->picture2 = 'images/elevages/' . date('Y') . '/' . date('m') . '/' . $imageNameSite2;
if ($picture3 !== null)
$s->picture3 = date('Y') . '/' . date('m') . '/' . $imageNameSite3;
$s->picture3 = 'images/elevages/' . date('Y') . '/' . date('m') . '/' . $imageNameSite3;
}
// Ajout en BDD
@ -324,14 +324,14 @@ class BreedersController extends Controller
{
$b = Breeders::findOrFail($id);
if (file_exists(public_path('images/eleveurs/') . $b->picture))
unlink(public_path('images/eleveurs/') . $b->picture);
if ($b->site->picture1 !== null && file_exists(public_path('images/elevages/') . $b->site->picture1))
unlink(public_path('images/elevages/') . $b->site->picture1);
if ($b->site->picture2 !== null && file_exists(public_path('images/elevages/') . $b->site->picture2))
unlink(public_path('images/elevages/') . $b->site->picture2);
if ($b->site->picture3 !== null && file_exists(public_path('images/elevages/') . $b->site->picture3))
unlink(public_path('images/elevages/') . $b->site->picture3);
if (file_exists(public_path() . '/' . $b->picture))
unlink(public_path() . '/' . $b->picture);
if ($b->site->picture1 !== null && file_exists(public_path() . '/' . $b->site->picture1))
unlink(public_path() . '/' . $b->site->picture1);
if ($b->site->picture2 !== null && file_exists(public_path() . '/' . $b->site->picture2))
unlink(public_path() . '/' . $b->site->picture2);
if ($b->site->picture3 !== null && file_exists(public_path() . '/' . $b->site->picture3))
unlink(public_path() . '/' . $b->site->picture3);
$i = BreedersInuav::where('breeder_id', $id);
$i->delete();

View file

@ -40,7 +40,7 @@ class ContentOCBController extends Controller
$picture->move(public_path('images/ocb/' . date('Y') . '/' . date('m')), $imageName);
$ocb = new ContentOCB();
$ocb->picture = date('Y') . '/' . date('m') . '/' . $imageName;
$ocb->picture = 'images/ocb/' . date('Y') . '/' . date('m') . '/' . $imageName;
$ocb->content = $content;
$ocb->status = $status;
$ocb->type = $type;
@ -75,16 +75,16 @@ class ContentOCBController extends Controller
$ocb = ContentOCB::findOrFail($id);
if ($picture !== null) {
if (file_exists(public_path('images/menus-equilibres/') . $ocb->picture))
unlink(public_path('images/menus-equilibres/') . $ocb->picture);
if (file_exists(public_path() . '/' . $ocb->picture))
unlink(public_path() . '/' . $ocb->picture);
$imageName = 'oui-cest-bon-' . strtolower($type) . '-' . date('d-m-Y-h-i-s') .'-le-gaulois' . '.' . $picture->extension();
$picture->move(public_path('images/menus-equilibres/' . date('Y') . '/' . date('m')), $imageName);
$picture->move(public_path('images/ocb/' . date('Y') . '/' . date('m')), $imageName);
}
$ocb->type = $type;
$ocb->content = $content;
if ($picture !== null)
$ocb->picture = date('Y') . '/' . date('m') . '/' . $imageName;
$ocb->picture = 'images/ocb/' . date('Y') . '/' . date('m') . '/' . $imageName;
$ocb->status = $status;
$ocb->type = $type;
$ocb->save();
@ -96,8 +96,8 @@ class ContentOCBController extends Controller
{
$ocb = ContentOCB::findOrFail($id);
if (file_exists(public_path('images/ocb/') . $ocb->picture))
unlink(public_path('images/ocb/') . $ocb->picture);
if (file_exists(public_path() . '/' . $ocb->picture))
unlink(public_path() . '/' . $ocb->picture);
$ocb->delete();

View file

@ -63,8 +63,8 @@ class HomeSliderPicturesController extends Controller
$hsp->catch_color = $catchColor;
$hsp->title = $title;
$hsp->title_color = $titleColor;
$hsp->picture = date('Y') . '/' . date('m') . '/' . $imageName;
$hsp->picture_r = date('Y') . '/' . date('m') . '/' . $imageName_r;
$hsp->picture = 'images/slider_accueil/' . date('Y') . '/' . date('m') . '/' . $imageName;
$hsp->picture_r = 'images/slider_accueil/' . date('Y') . '/' . date('m') . '/' . $imageName_r;
$hsp->link_label = $linkLabel;
$hsp->link = $link;
$hsp->link_color = $linkColor;
@ -138,14 +138,14 @@ class HomeSliderPicturesController extends Controller
$hsp = HomeSliderPictures::findOrFail($id);
if ($picture !== NULL){
if(file_exists(public_path('images/slider_accueil/') . $hsp->picture))
unlink(public_path('images/slider_accueil/') . $hsp->picture);
if(file_exists(public_path() . '/' . $hsp->picture))
unlink(public_path() . '/' . $hsp->picture);
$imageName = Str::slug($title) .'-le-gaulois.'.$picture->extension();
$picture->move(public_path('images/slider_accueil/' . date('Y') . '/' . date('m') . '/'), $imageName);
}
if ($picture_r !== NULL) {
if(file_exists(public_path('images/slider_accueil/') . $hsp->picture_r))
unlink(public_path('images/slider_accueil/') . $hsp->picture_r);
if(file_exists(public_path() . '/' . $hsp->picture_r))
unlink(public_path() . '/' . $hsp->picture_r);
$imageName_r = Str::slug($title) . '-le-gaulois_r.' . $picture_r->extension();
$picture_r->move(public_path('images/slider_accueil/' . date('Y') . '/' . date('m') . '/'), $imageName_r);
}
@ -155,9 +155,9 @@ class HomeSliderPicturesController extends Controller
$hsp->title = $title;
$hsp->title_color = $titleColor;
if ($picture !== null)
$hsp->picture = date('Y') . '/' . date('m') . '/' . $imageName;
$hsp->picture = 'images/slider_accueil/' . date('Y') . '/' . date('m') . '/' . $imageName;
if ($picture_r !== null)
$hsp->picture_r = date('Y') . '/' . date('m') . '/' . $imageName_r;
$hsp->picture_r = 'images/slider_accueil/' . date('Y') . '/' . date('m') . '/' . $imageName_r;
$hsp->link_label = $linkLabel;
$hsp->link = $link;
$hsp->link_color = $linkColor;
@ -179,11 +179,11 @@ class HomeSliderPicturesController extends Controller
{
$h = HomeSliderPictures::findOrFail($id);
if(file_exists(public_path('images/slider_accueil/') . $h->picture))
unlink(public_path('images/slider_accueil/') . $h->picture);
if(file_exists(public_path() . '/' . $h->picture))
unlink(public_path() . '/' . $h->picture);
if(file_exists(public_path('images/slider_accueil/') . $h->picture_r))
unlink(public_path('images/slider_accueil/') . $h->picture_r);
if(file_exists(public_path() . '/' . $h->picture_r))
unlink(public_path() . '/' . $h->picture_r);
$h->delete();

View file

@ -74,7 +74,7 @@ class MomentsController extends Controller
$picture_bg = $request->picture_bg;
$picture_bg_r = $request->picture_bg_r;
$parallax = $request->parallax === null ? 0 : 1;
$starMoment = $request->star_moment === null ? 0 : 1;
$starMoment = 0;
$status = 0;
$featuredTitle = $request->featured_title;
$featuredType = strtolower($request->featured_type);
@ -95,17 +95,20 @@ class MomentsController extends Controller
$picture_bg->move(public_path('images/moments/' . date('Y') . '/' . date('m') . '/'), $imageName_bg);
$imageName_bg_r = Str::slug($title) . '-bg-r-le-gaulois.' . $picture_bg_r->extension();
$picture_bg_r->move(public_path('images/moments/' . date('Y') . '/' . date('m') . '/'), $imageName_bg_r);
$imageNameVoucher = Str::slug($title) . '-bon-reduction-le-gaulois.' . $voucherPicture->extension();
$voucherPicture->move(public_path('images/moments/' . date('Y') . '/' . date('m') . '/'), $imageNameVoucher);
if ($voucherPicture !== null) {
$imageNameVoucher = Str::slug($title) . '-bon-reduction-le-gaulois.' . $voucherPicture->extension();
$voucherPicture->move(public_path('images/moments/' . date('Y') . '/' . date('m') . '/'), $imageNameVoucher);
}
$m = new Moments();
$m->title = $title;
$m->slug = Str::slug($title);
$m->description = $description;
$m->color = $color;
$m->picture = date('Y') . '/' . date('m') . '/' . $imageName;
$m->picture_bg = date('Y') . '/' . date('m') . '/' . $imageName_bg;
$m->picture_bg_r = date('Y') . '/' . date('m') . '/' . $imageName_bg_r;
$m->picture = 'images/moments/' . date('Y') . '/' . date('m') . '/' . $imageName;
$m->picture_bg = 'images/moments/' . date('Y') . '/' . date('m') . '/' . $imageName_bg;
$m->picture_bg_r = 'images/moments/' . date('Y') . '/' . date('m') . '/' . $imageName_bg_r;
$m->parallax = $parallax;
$m->star_moment = $starMoment;
$m->status = $status;
@ -114,7 +117,8 @@ class MomentsController extends Controller
$m->featured_type = $featuredType;
$m->featured_ids = $featuredIdsString;
$m->featured_status = $featuredStatus;
$m->voucher_picture = date('Y') . '/' . date('m') . '/' . $imageNameVoucher;
if ($voucherPicture !== null)
$m->voucher_picture = 'images/moments/' . date('Y') . '/' . date('m') . '/' . $imageNameVoucher;
$m->voucher_status = $voucherStatus;
$m->save();
@ -144,7 +148,7 @@ class MomentsController extends Controller
return back()->with('strates', json_encode($strates))->withInput()->withErrors("L'image de la strate " . $compteur . " n'est pas au bon format (formats acceptés : png, jpg, jpeg), veuillez réessayer.");
}
// Création d'un fichier temporaire pour ensuite le move si il est ok
$tmpFilePath=sys_get_temp_dir().'/'.uniqid();
$tmpFilePath = sys_get_temp_dir().'/'.uniqid();
file_put_contents($tmpFilePath, $image);
$tmpFile = new File($tmpFilePath);
$imgSize = getimagesize($tmpFilePath);
@ -200,7 +204,6 @@ class MomentsController extends Controller
$picture_bg = $request->picture_bg;
$picture_bg_r = $request->picture_bg_r;
$parallax = $request->parallax === null ? 0 : 1;
$starMoment = $request->star_moment === null ? 0 : 1;
$status = $request->status === null ? 0 : 1;
$featuredTitle = $request->featured_title;
$featuredText = $request->featured_text;
@ -240,29 +243,29 @@ class MomentsController extends Controller
$m = Moments::findOrFail($id);
if ($picture !== null) {
if (file_exists(public_path('images/moments/') . $m->picture))
unlink(public_path('images/moments/') . $m->picture);
if (file_exists(public_path() . $m->picture))
unlink(public_path() . $m->picture);
$imageName = Str::slug($title) . '-le-gaulois.'.$picture->extension();
$picture->move(public_path('images/moments/' . date('Y') . '/' . date('m') . '/'), $imageName);
}
if ($picture_bg !== null) {
if (file_exists(public_path('images/moments/') . $m->picture_bg))
unlink(public_path('images/moments/') . $m->picture_bg);
if (file_exists(public_path() . $m->picture_bg))
unlink(public_path() . $m->picture_bg);
$imageName_bg = Str::slug($title) . '-bg-le-gaulois.' . $picture_bg->extension();
$picture_bg->move(public_path('images/moments/' . date('Y') . '/' . date('m') . '/'), $imageName_bg);
}
if ($picture_bg_r !== null) {
if (file_exists(public_path('images/moments/') . $m->picture_bg_r))
unlink(public_path('images/moments/') . $m->picture_bg_r);
if (file_exists(public_path() . $m->picture_bg_r))
unlink(public_path() . $m->picture_bg_r);
$imageName_bg_r = Str::slug($title) . '-bg-r-le-gaulois.' . $picture_bg_r->extension();
$picture_bg_r->move(public_path('images/moments/' . date('Y') . '/' . date('m') . '/'), $imageName_bg_r);
}
if ($voucherPicture !== null) {
if (file_exists(public_path('images/moments/') . $m->voucher_picture))
unlink(public_path('images/moments/') . $m->voucher_picture);
if (file_exists(public_path() . $m->voucher_picture))
unlink(public_path() . $m->voucher_picture);
$imageNameVoucher = Str::slug($title) . '-bon-reduction-le-gaulois.' . $voucherPicture->extension();
$voucherPicture->move(public_path('images/moments/' . date('Y') . '/' . date('m') . '/'), $imageNameVoucher);
}
@ -272,13 +275,12 @@ class MomentsController extends Controller
$m->description = $description;
$m->color = $color;
if ($picture !== null)
$m->picture = date('Y') . '/' . date('m') . '/' . $imageName;
$m->picture = 'images/moments/' . date('Y') . '/' . date('m') . '/' . $imageName;
if ($picture_bg !== null)
$m->picture_bg = date('Y') . '/' . date('m') . '/' . $imageName_bg;
$m->picture_bg = 'images/moments/' . date('Y') . '/' . date('m') . '/' . $imageName_bg;
if ($picture_bg_r !== null)
$m->picture_bg_r = date('Y') . '/' . date('m') . '/' . $imageName_bg_r;
$m->picture_bg_r = 'images/moments/' . date('Y') . '/' . date('m') . '/' . $imageName_bg_r;
$m->parallax = $parallax;
$m->star_moment = $starMoment;
$m->status = $status;
$m->featured_title = $featuredTitle;
$m->featured_text = $featuredText;
@ -286,7 +288,7 @@ class MomentsController extends Controller
$m->featured_ids = $featuredIdsString;
$m->featured_status = $featuredStatus;
if ($voucherPicture !== null)
$m->voucher_picture = date('Y') . '/' . date('m') . '/' . $imageNameVoucher;
$m->voucher_picture = 'images/moments/' . date('Y') . '/' . date('m') . '/' . $imageNameVoucher;
$m->voucher_status = $voucherStatus;
$compteur = 0;
@ -301,10 +303,9 @@ class MomentsController extends Controller
return back()->with('strates', json_encode($strates))->withInput()->withErrors("Les données de la strate " . $compteur . " sont incorrects, veuillez réessayer.");
$compteur++;
if ($strate->id !== null) {
if ($strate->id !== null)
$s = MomentStrates::find($strate->id);
$ids[] = $strate->id;
} else
else
$s = new MomentStrates();
$s->moment_id = $m->id;
$s->title = $strate->title;
@ -333,6 +334,7 @@ class MomentsController extends Controller
$s->button_link = $strate->button_link;
$s->status = $strate->status === null ? 0 : 1;
$s->save();
$ids[] = $s->id;
}
if (count($ids) > 0) {
@ -346,10 +348,6 @@ class MomentsController extends Controller
$m->save();
// Mise en cache du moment si il est publié car c'est le dernier mis à jour obligatoirement
if ($m->status === 1)
Cache::put('momentFiche', $m);
return redirect()->route('bo.moments.edit', $m->id)->with('success', 'Enregistré !');
}
@ -358,14 +356,14 @@ class MomentsController extends Controller
$m = Moments::findOrFail($id);
if (file_exists(public_path('images/moments/') . $m->picture))
unlink(public_path('images/moments/') . $m->picture);
if (file_exists(public_path() . '/' . $m->picture))
unlink(public_path() . '/' . $m->picture);
if (file_exists(public_path('images/moments/') . $m->picture_bg))
unlink(public_path('images/moments/') . $m->picture_bg);
if (file_exists(public_path() . '/' . $m->picture_bg))
unlink(public_path() . '/' . $m->picture_bg);
if (file_exists(public_path('images/moments/') . $m->picture_bg_r))
unlink(public_path('images/moments/') . $m->picture_bg_r);
if (file_exists(public_path() . '/' . $m->picture_bg_r))
unlink(public_path() . '/' . $m->picture_bg_r);
foreach($m->strates as $strate) {
if (file_exists(public_path() . '/' . $strate->picture))
@ -381,4 +379,30 @@ class MomentsController extends Controller
return redirect()->route('bo.moments.index');
}
/**
* Passe un moment en moment star. Si il y avait déjà un moment star, il ne l'est plus et le nouveau le remplace
* @param id L'id du moment qui doit devenir moment star
*/
public function setStar($id) {
$moment = Moments::find($id);
if (!$moment)
abort(404);
if ($moment->star_moment === 0) {
$oldStar = Moments::where('star_moment', 1)->first();
if ($oldStar) {
$oldStar->star_moment = 0;
$oldStar->save();
}
}
$moment->star_moment = $moment->star_moment === 0 ? 1 : 0;
$moment->save();
if ($moment->star_moment === 1 && $moment->status)
Cache::put('momentFiche', $moment);
return redirect()->route('bo.moments.index');
}
}

View file

@ -42,7 +42,7 @@ class NewsSliderPicturesController extends Controller
$n = new NewsSliderPictures();
$n->catch_phrase = $catchPhrase;
$n->title = $title;
$n->picture = date('Y') . '/' . date('m') . '/' . $imageName;
$n->picture = 'images/slider_actus/' . date('Y') . '/' . date('m') . '/' . $imageName;
$n->link = $link;
$n->new_tab = $newTab;
$n->status = $status;
@ -82,8 +82,8 @@ class NewsSliderPicturesController extends Controller
$n = NewsSliderPictures::findOrFail($id);
if ($picture !== NULL){
if(file_exists(public_path('images/slider_actus/') . $n->picture))
unlink(public_path('images/slider_actus/') . $n->picture);
if(file_exists(public_path() . '/' . $n->picture))
unlink(public_path() . '/' . $n->picture);
$imageName = Str::slug($title) .'-le-gaulois-' . date('d-m-Y') . '.' . $picture->extension();
$picture->move(public_path('images/slider_actus/' . date('Y') . '/' . date('m') . '/'), $imageName);
}
@ -91,7 +91,7 @@ class NewsSliderPicturesController extends Controller
$n->catch_phrase = $catchPhrase;
$n->title = $title;
if ($picture !== null)
$n->picture = date('Y') . '/' . date('m') . '/' . $imageName;
$n->picture = 'images/slider_actus/' . date('Y') . '/' . date('m') . '/' . $imageName;
$n->link = $link;
$n->new_tab = $newTab;
$n->status = $status;
@ -104,8 +104,8 @@ class NewsSliderPicturesController extends Controller
{
$n = NewsSliderPictures::findOrFail($id);
if(file_exists(public_path('images/slider_actus/') . $n->picture))
unlink(public_path('images/slider_actus/') . $n->picture);
if(file_exists(public_path() . '/' . $n->picture))
unlink(public_path() . '/' . $n->picture);
$n->delete();

View file

@ -32,11 +32,11 @@ class ProductPictogramsController extends Controller
]);
$imageName = Str::slug($name) .'.'.$picture->extension();
$picture->move(public_path('images/pictos'), $imageName);
$picture->move(public_path('images/pictos/'), $imageName);
$pp = new ProductPictograms();
$pp->name = $name;
$pp->picture = $imageName;
$pp->picture = 'images/pictos/' . $imageName;
$pp->save();
return redirect()->route('bo.product-pictograms.index');
@ -62,9 +62,9 @@ class ProductPictogramsController extends Controller
$pp = ProductPictograms::findOrFail($id);
Storage::delete(public_path('images/pictos/') . $pp->picture);
$picture->move(public_path('images/pictos'), $imageName);
$picture->move(public_path('images/pictos/'), $imageName);
$pp->picture = $imageName;
$pp->picture = 'images/pictos/' . $imageName;
$pp->save();
return redirect()->route('bo.product-pictograms.edit', ['product_pictogram' => $pp->id])->with('success', 'Enregistré !');
@ -73,7 +73,7 @@ class ProductPictogramsController extends Controller
public function destroy($id)
{
$pp = ProductPictograms::findOrFail($id);
$path = public_path('images/pictos/') . $pp->picture;
$path = public_path() . '/' . $pp->picture;
if(file_exists($path)) {
unlink($path);
}

View file

@ -42,8 +42,8 @@ class ProductSliderPicturesController extends Controller
$picture_r->move(public_path('images/slider_produits/' . date('Y') . '/' . date('m') . '/'), $imageName_r);
$p = new ProductSliderPictures();
$p->picture = date('Y') . '/' . date('m') . '/' . $imageName;
$p->picture_r = date('Y') . '/' . date('m') . '/' . $imageName_r;
$p->picture = 'images/slider_produits/' . date('Y') . '/' . date('m') . '/' . $imageName;
$p->picture_r = 'images/slider_produits/' . date('Y') . '/' . date('m') . '/' . $imageName_r;
$p->link = $link;
$p->title = $title;
$p->new_tab = $newTab;
@ -92,22 +92,22 @@ class ProductSliderPicturesController extends Controller
$p = ProductSliderPictures::findOrFail($id);
if ($picture !== NULL){
if(file_exists(public_path('images/slider_produits/') . $p->picture))
unlink(public_path('images/slider_produits/') . $p->picture);
if(file_exists(public_path() . '/' . $p->picture))
unlink(public_path() . '/' . $p->picture);
$imageName = Str::slug($title) .'-le-gaulois.'.$picture->extension();
$picture->move(public_path('images/slider_produits/' . date('Y') . '/' . date('m') . '/'), $imageName);
}
if ($picture_r !== NULL) {
if(file_exists(public_path('images/slider_produits/') . $p->picture_r))
unlink(public_path('images/slider_produits/') . $p->picture_r);
if(file_exists(public_path() . '/' . $p->picture_r))
unlink(public_path() . '/' . $p->picture_r);
$imageName_r = Str::slug($title) . '-le-gaulois_r.' . $picture_r->extension();
$picture_r->move(public_path('images/slider_produits/' . date('Y') . '/' . date('m') . '/'), $imageName_r);
}
if ($picture !== null)
$p->picture = date('Y') . '/' . date('m') . '/' . $imageName;
$p->picture = 'images/slider_produits/' . date('Y') . '/' . date('m') . '/' . $imageName;
if ($picture_r !== null)
$p->picture_r = date('Y') . '/' . date('m') . '/' . $imageName_r;
$p->picture_r = 'images/slider_produits/' . date('Y') . '/' . date('m') . '/' . $imageName_r;
$p->link = $link;
$p->title = $title;
$p->new_tab = $newTab;
@ -122,11 +122,11 @@ class ProductSliderPicturesController extends Controller
{
$p = ProductSliderPictures::findOrFail($id);
if(file_exists(public_path('images/slider_produits/') . $p->picture))
unlink(public_path('images/slider_produits/') . $p->picture);
if(file_exists(public_path() . '/' . $p->picture))
unlink(public_path() . '/' . $p->picture);
if(file_exists(public_path('images/slider_produits/') . $p->picture_r))
unlink(public_path('images/slider_produits/') . $p->picture_r);
if(file_exists(public_path() . '/' . $p->picture_r))
unlink(public_path() . '/' . $p->picture_r);
$p->delete();

View file

@ -131,7 +131,7 @@ class ProductsController extends Controller
$p->name = $name;
$p->slug = $slug;
$p->portion_description = $portionDescription;
$p->picture = date('Y') . '/' . date('m') . '/' . $imageName;
$p->picture = 'images/produits/' . date('Y') . '/' . date('m') . '/' . $imageName;
$p->tags = $tags;
$p->subtitle = $subtitle;
$p->info1 = $info1;
@ -324,14 +324,14 @@ class ProductsController extends Controller
$p = Products::findOrFail($id);
if ($picture !== null) {
if (file_exists(public_path('images/produits/') . $p->picture))
unlink(public_path('images/produits/') . $p->picture);
if (file_exists(public_path() . '/' . $p->picture))
unlink(public_path() . '/' . $p->picture);
$imageName = $slug . '-le-gaulois.' . $picture->extension();
$picture->move(public_path('images/produits/') . date('Y') . '/' . date('m') . '/', $imageName);
}
if ($pictureVideo !== null) {
if ($p->picture_video !== null && file_exists(public_path('images/produits/') . $p->picture_video))
unlink(public_path('images/produits/') . $p->picture_video);
if ($p->picture_video !== null && file_exists(public_path() . '/' . $p->picture_video))
unlink(public_path() . '/' . $p->picture_video);
$imageNameVideo = $slug . '-video-le-gaulois.' . $pictureVideo->extension();
$pictureVideo->move(public_path('images/produits/') . date('Y') . '/' . date('m') . '/', $imageNameVideo);
}
@ -369,7 +369,7 @@ class ProductsController extends Controller
$p->slug = $slug;
$p->portion_description = $portionDescription;
if ($picture !== null)
$p->picture = date('Y') . '/' . date('m') . '/' . $imageName;
$p->picture = 'images/produits/' . date('Y') . '/' . date('m') . '/' . $imageName;
$p->tags = $tags;
$p->subtitle = $subtitle;
$p->info1 = $info1;
@ -398,7 +398,7 @@ class ProductsController extends Controller
$p->computer_movement_type = $computerMovemmentType;
$p->video_link = $videoLink;
if ($pictureVideo !== null)
$p->picture_video = date('Y') . '/' . date('m') . '/' . $imageNameVideo;
$p->picture_video = 'images/produits/' . date('Y') . '/' . date('m') . '/' . $imageNameVideo;
$p->status = $status;
$p->save();
@ -411,11 +411,11 @@ class ProductsController extends Controller
if (!$rExist) {
$p = Products::findOrFail($id);
if (file_exists(public_path('images/produits/') . $p->picture))
unlink(public_path('images/produits/' . $p->picture));
if (file_exists(public_path() . '/' . $p->picture))
unlink(public_path() . '/' . $p->picture);
if ($p->picture_video !== null && file_exists(public_path('images/produits/') . $p->picture_video))
unlink(public_path('images/produits/') . $p->picture_video);
if ($p->picture_video !== null && file_exists(public_path() . '/' . $p->picture_video))
unlink(public_path() . '/' . $p->picture_video);
$p->inco_nutritional_values()->delete();
$p->delete();

View file

@ -44,7 +44,7 @@ class QrCodesController extends Controller
$q = new QrCodes();
$q->title = $title;
$q->picture = date('Y') . '/' . date('m') . '/' . $imageName;
$q->picture = 'images/qr_codes/' . date('Y') . '/' . date('m') . '/' . $imageName;
$q->link = $link;
$q->associated_page = $associatedPage;
$q->publish_date = $publishDate;
@ -88,15 +88,15 @@ class QrCodesController extends Controller
$q = QrCodes::findOrFail($id);
if ($picture !== null) {
if (file_exists(public_path('images/qr_codes/') . $q->picture))
unlink(public_path('images/qr_codes/') . $q->picture);
if (file_exists(public_path() . '/' . $q->picture))
unlink(public_path() . '/' . $q->picture);
$imageName = Str::slug($title) . '-le-gaulois.' . $picture->extension();
$picture->move(public_path('images/qr_codes/' . date('Y') . '/' . date('m') . '/'), $imageName);
}
$q->title = $title;
if ($picture !== null)
$q->picture = date('Y') . '/' . date('m') . '/' . $imageName;
$q->picture = 'images/qr_codes/' . date('Y') . '/' . date('m') . '/' . $imageName;
$q->link = $link;
$q->associated_page = $associatedPage;
$q->publish_date = $publishDate;
@ -111,8 +111,8 @@ class QrCodesController extends Controller
{
$q = QrCodes::findOrFail($id);
if (file_exists(public_path('images/qr-codes/' . date('Y') . '/' . date('m') . '/') . $q->picture))
unlink(public_path('images/qr-codes/' . date('Y') . '/' . date('m') . '/') . $q->picture);
if (file_exists(public_path() . '/' . $q->picture))
unlink(public_path() . '/' . $q->picture);
$q->delete();

View file

@ -47,8 +47,8 @@ class RangesController extends Controller
$r = new Ranges();
$r->name = $name;
$r->description = $desc;
$r->picture = date('Y') . '/' . date('m') . '/' . $imageName;
$r->picture_r = date('Y') . '/' . date('m') . '/' . $imageName_r;
$r->picture = 'images/gammes/' . date('Y') . '/' . date('m') . '/' . $imageName;
$r->picture_r = 'images/gammes/' . date('Y') . '/' . date('m') . '/' . $imageName_r;
$r->color = $color;
$r->status = 0;
$r->order = $this->getLastOrder();
@ -98,14 +98,14 @@ class RangesController extends Controller
$r = Ranges::findOrFail($id);
if ($picture !== NULL){
if(file_exists(public_path('images/gammes/') . $r->picture))
unlink(public_path('images/gammes/') . $r->picture);
if(file_exists(public_path() . '/' . $r->picture))
unlink(public_path() . '/' . $r->picture);
$imageName = Str::slug($name) .'.'.$picture->extension();
$picture->move(public_path('images/gammes/' . date('Y') . '/' . date('m') . '/'), $imageName);
}
if ($picture_r !== NULL) {
if(file_exists(public_path('images/gammes/') . $r->picture_r))
unlink(public_path('images/gammes/') . $r->picture_r);
if(file_exists(public_path() . '/' . $r->picture_r))
unlink(public_path() . '/' . $r->picture_r);
$imageName_r = Str::slug($name) . '_r.' . $picture_r->extension();
$picture_r->move(public_path('images/gammes/' . date('Y') . '/' . date('m') . '/'), $imageName_r);
}
@ -113,9 +113,9 @@ class RangesController extends Controller
$r->name = $name;
$r->description = $desc;
if ($picture !== NULL)
$r->picture = date('Y') . '/' . date('m') . '/' . $imageName;
$r->picture = 'images/gammes/' . date('Y') . '/' . date('m') . '/' . $imageName;
if ($picture_r !== NULL)
$r->picture_r = date('Y') . '/' . date('m') . '/' . $imageName_r;
$r->picture_r = 'images/gammes/' . date('Y') . '/' . date('m') . '/' . $imageName_r;
$r->color = $color;
$r->status = $status;
$r->slug = $slug;
@ -131,11 +131,11 @@ class RangesController extends Controller
if (!$pExist) {
$r = Ranges::findOrFail($id);
if(file_exists(public_path('images/gammes/') . $r->picture))
unlink(public_path('images/gammes/') . $r->picture);
if(file_exists(public_path() . '/' . $r->picture))
unlink(public_path() . '/' . $r->picture);
if(file_exists(public_path('images/gammes/') . $r->picture_r))
unlink(public_path('images/gammes/') . $r->picture_r);
if(file_exists(public_path() . '/' . $r->picture_r))
unlink(public_path() . '/' . $r->picture_r);
$r->delete();
} else {

View file

@ -76,7 +76,7 @@ class RecipesController extends Controller
$r->slug = $slug;
$r->catch_phrase = $catchPhrase;
$r->tags = $tags;
$r->picture = date('Y') . '/' . date('m') . '/' . $imageName;
$r->picture = 'images/recettes/' . date('Y') . '/' . date('m') . '/' . $imageName;
$r->ingredients = $ingredients;
$r->preparation = $preparation;
$r->advice = $advice;
@ -161,8 +161,8 @@ class RecipesController extends Controller
$r = Recipes::findOrFail($id);
if ($picture !== null) {
if (file_exists(public_path('images/recettes/') . $r->picture))
unlink(public_path('images/recettes/') . $r->picture);
if (file_exists(public_path() . '/' . $r->picture))
unlink(public_path() . '/' . $r->picture);
$imageName = $slug .'.'.$picture->extension();
$picture->move(public_path('images/recettes/' . date('Y') . '/' . date('m') . '/'), $imageName);
}
@ -172,7 +172,7 @@ class RecipesController extends Controller
$r->catch_phrase = $catchPhrase;
$r->tags = $tags;
if ($picture !== null)
$r->picture = date('Y') . '/' . date('m') . '/' . $imageName;
$r->picture = 'images/recettes/' . date('Y') . '/' . date('m') . '/' . $imageName;
$r->ingredients = $ingredients;
$r->preparation = $preparation;
$r->advice = $advice;
@ -204,8 +204,8 @@ class RecipesController extends Controller
{
$r = Recipes::findOrFail($id);
if (file_exists(public_path('images/recettes/') . $r->picture));
unlink(public_path('images/recettes/') . $r->picture);
if (file_exists(public_path() . '/' . $r->picture));
unlink(public_path() . '/' . $r->picture);
$r->delete();

View file

@ -2,13 +2,33 @@
namespace App\Http\Controllers;
use App\Models\Articles;
use App\Models\Moments;
use App\Models\Products;
use App\Models\Recipes;
use Illuminate\Http\Request;
class MomentsController extends Controller
{
public function index() {
$moment = Moments::orderBy('updated_at', 'DESC')->first();
return view('front.moment', compact('moment'));
public function index($slug) {
$moment = Moments::where([['slug', $slug], ['status', 1]])->first();
$otherMoments = Moments::where([['slug', '<>', $slug], ['status', 1]])->inRandomOrder()->limit(2)->get();
$featuredIds = array_unique(explode(';', $moment->featured_ids));
$featuredObjects = [];
switch ($moment->featured_type) {
case "recettes":
$featuredObjects = Recipes::find($featuredIds);
break;
case "produits":
$featuredObjects = Products::find($featuredIds);
break;
case "articles":
$featuredObjects = Articles::find($featuredIds);
break;
}
return view('front.moment', compact('moment', 'otherMoments', 'featuredObjects'));
}
}

View file

@ -29,8 +29,8 @@ class TraceabilityController extends Controller
return json_encode(['status' => 'KO', 'code' => 101]);
}
// Si éleveur trouvé, alors c'est un éleveur OCB
$breeder = Breeders::where('breeder_code', 'LIKE', '%' . $tracaDatas->no_opa . $tracaDatas->no_elev)->first();
// Si éleveur trouvé, alors c'est un éleveur OCB publié
$breeder = Breeders::where([['status', 1], ['breeder_code', 'LIKE', '%' . $tracaDatas->no_opa . $tracaDatas->no_elev]])->first();
if (!$breeder) {
// Sinon, c'est un éleveur non OCB
$breeder = BreedersDatas::where('code_eleveur', $tracaDatas->no_elev)->first();

View file

@ -30,7 +30,7 @@ class AppServiceProvider extends ServiceProvider
if (!app()->runningInConsole()) {
$momentFiche = Cache::get('momentFiche');
if (!$momentFiche) {
$momentFiche = Moments::where('status', 1)->orderBy('updated_at', 'DESC')->first();
$momentFiche = Moments::where([['star_moment', 1], ['status', 1]])->first();
Cache::put('momentFiche', $momentFiche);
}
if ($momentFiche) {

2
public/css/app.css vendored

File diff suppressed because one or more lines are too long

2
public/css/main.css vendored

File diff suppressed because one or more lines are too long

Binary file not shown.

Before

Width:  |  Height:  |  Size: 225 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 496 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 225 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 496 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 225 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 496 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 14 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 14 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 402 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 844 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 846 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 688 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 920 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 27 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 18 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 178 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 174 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 30 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 144 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 277 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 260 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 121 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

2
public/js/app.js vendored

File diff suppressed because one or more lines are too long

2
public/js/main.js vendored

File diff suppressed because one or more lines are too long

View file

@ -1,37 +0,0 @@
/**
* Définition du JS à appliquer dans le BO pour les i
*/
// Etoiles cliquables
$("[name=star_empty]").mouseover(function(event) {
$(this).removeClass(['far', 'fa-star']);
$(this).addClass(['fas', 'fa-star', 'star-hover']);
}).mouseout(function(event) {
$(this).removeClass(['fas', 'fa-star', 'star-hover']);
$(this).addClass(['far', 'fa-star']);
});
$("[name=star_full]").mouseover(function(event) {
$(this).removeClass(['fas', 'fa-star', 'star-hover']);
$(this).addClass(['far', 'fa-star']);
}).mouseout(function(event) {
$(this).removeClass(['far', 'fa-star']);
$(this).addClass(['fas', 'fa-star', 'star-hover']);
});
// Pour l'ordre des éléments
$("[name=up_arrow]").mouseover(function(event) {
$(this).removeClass('far');
$(this).addClass('fas');
}).mouseout(function(event) {
$(this).removeClass('fas');
$(this).addClass('far');
});
$("[name=down_arrow]").mouseover(function(event) {
$(this).removeClass('far');
$(this).addClass('fas');
}).mouseout(function(event) {
$(this).removeClass('fas');
$(this).addClass('far');
});

2
resources/js/app.js vendored
View file

@ -4,8 +4,8 @@
* building robust, powerful web applications using Vue and Laravel.
*/
require('@fortawesome/fontawesome-free/js/all');
require('./bootstrap');
require('./app-icon');
require('vue-select-image/dist/vue-select-image.css')
window.Vue = require('vue');

View file

@ -3,7 +3,7 @@
<hooper style="height: 390px;" :infiniteScroll="true" :mouseDrag="false" :touchDrag="false" :wheelControl="false" :autoPlay="true" :playSpeed="3500" :transition="900">
<slide v-for="slide in oSlides">
<a :href="slide.link" :target="slide.new_tab === 1 ? '_blank' : '_self'">
<img :src="'images/slider_actus/' + slide.picture">
<img :src="slide.picture">
<div class="hover">
<p class="accroche">{{ slide.catch_phrase }}</p>
<p class="title">{{ slide.title }}</p>

View file

@ -2,7 +2,7 @@
<div class="slider">
<hooper ref="carousel" style="width: 950px; height: 633px;" @slide="updateCarousel" :initialSlide="1" :infiniteScroll="true" :mouseDrag="false" :touchDrag="false" :wheelControl="false" :autoPlay="true" :playSpeed="3500" :transition="900">
<slide v-for="slide in oSlides">
<img :src="'/images/elevages/' + slide">
<img :src="slide">
</slide>
<div class="hooper-navigation" slot="hooper-addons">
<div class="hooper-breeder-prev" @click="slide('prev')">&lsaquo;</div>
@ -10,7 +10,7 @@
</div>
</hooper>
<div class="hooper-breeder-previews">
<img v-for="(slide, index) in oSlides" :key="index" :src="'/images/elevages/' + slide" @click="changeSlide(index + 1)" alt="Exploitation - Le Gaulois" :style="index + 1 === indexSlide ? 'opacity: 1;' : 'opacity: 0.5;'">
<img v-for="(slide, index) in oSlides" :key="index" :src="slide" @click="changeSlide(index + 1)" alt="Exploitation - Le Gaulois" :style="index + 1 === indexSlide ? 'opacity: 1;' : 'opacity: 0.5;'">
</div>
</div>
</template>

View file

@ -8,7 +8,7 @@
<a :href="slide.link" :target="slide.new_tab === 1 ? '_blank' : '_self'" class="btn" :style="'background-color: ' + slide.link_color">{{ slide.link_label }}</a>
</div>
<!-- TODO : GESTION IMG SI MOBILE -->
<img :src="'images/slider_accueil/' + slide.picture" alt="Image - Le Gaulois">
<img :src="slide.picture" alt="Image - Le Gaulois">
</div>
</slide>
<div class="hooper-navigation" slot="hooper-addons">

View file

@ -3,7 +3,7 @@
<slide v-for="slide in oSlides">
<a :href="slide.link" :target="slide.new_tab === 1 ? '_blank' : '_self'">
<!-- TODO : GESTION IMG SI MOBILE -->
<img :src="asset('images/slider_produits/' + slide.picture)" alt="Image - Le Gaulois">
<img :src="slide.picture" alt="Image - Le Gaulois">
</a>
</slide>
</hooper>

View file

@ -9,14 +9,17 @@
<div class="form-group row">
<label class="col-form-label col-md-4">{{ label !== '' ? label + ' 1' : label }}</label>
<select class="custom-select col-md-8" :name="namechoice" v-model="featuredId1">
<option value=""></option>
<option v-for="item in datas" :value="item.id">{{ item.title }}</option>
</select>
<label class="col-form-label col-md-4">{{ label !== '' ? label + ' 2' : label }}</label>
<select class="custom-select col-md-8" :name="namechoice" v-model="featuredId2">
<option value=""></option>
<option v-for="item in datas" :value="item.id">{{ item.title }}</option>
</select>
<label class="col-form-label col-md-4">{{ label !== '' ? label + ' 3' : label }}</label>
<select class="custom-select col-md-8" :name="namechoice" v-model="featuredId3">
<option value=""></option>
<option v-for="item in datas" :value="item.id">{{ item.title }}</option>
</select>
</div>

View file

@ -14,5 +14,16 @@
.star-hover {
color: gold;
&:hover {
color: #3176C4;
}
}
.not-star-hover {
color: #3176C4;
&:hover {
color: gold;
}
}

View file

@ -73,6 +73,7 @@
position: absolute;
top: 32%;
left: 50%;
z-index: 20;
text-decoration: none;
line-height: 1em;
font-size: 5.6em;
@ -101,16 +102,10 @@
background-color: rgba(238,124,40,1);
}
.color-7 {
background-color: rgba(142,184,233,1);
background-color: rgba(214, 177, 127, 1);
}
.color-8 {
background-color: rgba(219,171,107,1);
}
.color-9 {
background-color: rgba(154,201,170,1);
}
.color-10 {
background-color: rgba(221,68,83,1);
background-color: rgba(163, 202, 177, 1);
}
&:after {

View file

@ -1,51 +1,462 @@
.content-moment {
position: relative;
background-color: #fbf8f5;
padding-top: 100px;
& .moment {
position: relative;
max-width: 700px;
margin-left: auto;
margin-right: auto;
color: #4e3238;
padding-bottom: 50px;
padding-top: 100px;
.color-1 {
background-color: rgba(142,184,233,1);
}
.color-2 {
background-color: rgba(255,180,0,1);
}
.color-3 {
background-color: rgba(172,40,61,1);
}
.color-4 {
background-color: rgba(231,145,14,1);
}
.color-5 {
background-color: rgba(250,183,216,1);
}
.color-6 {
background-color: rgba(238,124,40,1);
}
.color-7 {
background-color: rgba(214, 177, 127, 1);
}
.color-8 {
background-color: rgba(163, 202, 177, 1);
}
& .img-moment {
position: absolute;
top: -400px;
left: 50%;
transform: translateX(-50%);
z-index: 15;
& .img-moment {
position: absolute;
top: -420px;
left: 50%;
transform: translateX(-50%);
z-index: 15;
}
& .scroll-button {
position: absolute;
left: 50%;
top: -60px;
transform: translateX(-50%);
width: 50px;
height: 50px;
background-color: #f79e15;
border-radius: 50%;
font-family: 'icomoon';
border: 0;
color: white;
font-size: 1.5em;
cursor: pointer;
&:before {
content: "\e91b";
}
}
&>h1 {
font-size: 6em;
& .strates {
display: flex;
flex-direction: column;
& .strate-item {
position: relative;
max-width:1200px;
margin-left:auto;
margin-right:auto;
display: flex;
align-items: center;
justify-content: center;
margin-bottom: 100px;
figure {
margin-bottom: 10px;
margin-right: 60px;
text-align: center;
span {
position:relative;
height:auto;
display:inline-block;
img {
height: auto;
max-width: 100%;
}
&:before {
background-image: url('../images/moments/deco_title.png');
display: inline-block;
content: "";
width: 39px;
height: 46px;
position: absolute;
top: 50%;
left: -50px;
transform: translateY(-50%);
}
&:after {
background-image: url('../images/moments/deco_title.png');
display: inline-block;
content: "";
width: 39px;
height: 46px;
transform: rotate(180deg) translateY(50%);
position: absolute;
top: 50%;
left: 105%;
}
}
}
figcaption {
color: #4e3238;
font-family: "CreamyScriptRegular";
font-size: 24px;
margin-top: 10px;
text-align: center;
}
.strate-text {
max-width: 700px;
margin: 0;
color: #4e3238;
max-width: 450px;
h1 {
margin-bottom: 13px;
text-decoration: none;
text-align: left;
font-size: 6em;
font-family: 'Veneer';
}
p {
font-size: 18px;
margin-bottom: 10px;
}
ul {
margin-bottom: 16px;
}
li {
color: #4e3238;
font-family: "catamaran-regular";
font-size: 18px;
line-height: 1.7em;
&:before {
content: "\e91c";
color: #ffb400;
display: inline-block;
font-family: "icomoon";
font-size: inherit;
margin-right: 10px;
vertical-align: middle;
}
}
.wrap-btn {
padding-top: 12px;
text-align: center;
}
.btn {
font-size: 12px;
padding: 10px 15px;
}
}
}
}
& .ascent {
background-color: #f5efe9;
& .ascent-content {
position: relative;
max-width: 1200px;
margin-left: auto;
margin-right: auto;
color: #4e3238;
padding-bottom: 50px;
padding-top: 50px;
&>h1 {
font-size: 6em;
font-family: 'Veneer';
margin-bottom: 20px;
}
&>p {
font-size: 18px;
}
& .ascent-objects {
display: flex;
justify-content: center;
flex-direction: row;
padding-top: 40px;
&>a {
position: relative;
display: flex;
flex-direction: column;
width: 33%;
padding: 20px;
&>figure {
position: relative;
margin-bottom: 20px;
border: 8px solid white;
&>img {
width: 100%;
height: auto;
}
& .hover-img {
position: absolute;
display: flex;
justify-content: center;
align-items: center;
font-family: 'CreamyScriptRegular';
color: white;
font-size: 3.8em;
opacity: 0;
top: 0;
z-index: 10;
width: 100%;
height: 100%;
background-color: rgb(247, 158, 21, 0.7);
transition: opacity 0.2s;
&:hover {
opacity: 1;
}
&:before {
background-image: url('/images/recettes/hoverRecette.png');
content: "";
width: 100px;
height: 35px;
position: absolute;
top: 25%;
left: 50%;
transform: translateX(-50%);
}
&:after {
background-image: url('/images/recettes/hoverRecette.png');
content: "";
transform: rotate(180deg);
width: 100px;
height: 35px;
position: absolute;
bottom: 25%;
left: 50%;
transform: translateX(-50%) scaleY(-1);
}
}
}
&>p {
text-align: center;
text-transform: uppercase;
font-family: 'Catamaran-Bold';
color: #4e3238;
font-size: 1.7em;
}
}
}
& .ascent-products {
position: relative;
display: flex;
justify-content: center;
flex-direction: row;
padding-top: 40px;
text-align: center;
&>a {
position: relative;
display: flex;
flex-direction: column;
width: 33%;
padding: 20px;
&>figure {
height: 236px;
margin: 8px 8px 27px;
border: none;
padding: 0;
position: relative;
&>img {
position: absolute;
top: 50%;
left: 50%;
min-height: 100%;
min-width: inherit;
width: auto;
height: 100%;
overflow: hidden;
transition: all 500ms ease 0s;
transform: translateX(-50%) translateY(-50%);
&:hover {
transform: translateX(-50%) translateY(-55%);
}
}
}
&>p {
color: #4e3238;
text-transform: uppercase;
font-family: 'Catamaran-Bold';
padding: 0 40px;
font-size: 18px;
}
&>span {
color: #f79e15;
font-family: "CreamyScriptRegular";
font-size: 26px;
text-transform: none;
white-space: nowrap;
}
}
}
& .ascent-btn {
text-align: center;
padding-bottom: 50px;
&>a {
text-transform: uppercase;
border-radius: 20px;
background-color: #ffb400;
display: inline-block;
border: none;
color: white;
cursor: pointer;
font-family: 'Catamaran-Black';
font-size: 15px;
height: 40px;
margin-bottom: 0;
padding: 10px 25px;
line-height: 1.25;
text-align: center;
touch-action: manipulation;
vertical-align: middle;
white-space: nowrap;
}
}
}
}
& .other-moments {
background-color: #f5efe9;
text-align: center;
&>h2 {
background: url(../images/moments/arrow-down-53.png) no-repeat right center;
display: inline-block;
padding-right: 77px;
font-size: 5.5em;
font-family: 'Veneer';
margin-bottom: 20px;
color: #4e3238;
padding-bottom: 30px;
}
&>p {
font-size: 3.1em;
font-family: 'CreamyScriptRegular';
&>div {
display: flex;
flex-direction: row;
height: 400px;
position: relative;
z-index: 5;
&>figure {
text-align: center;
position: relative;
overflow: hidden;
width: 100%;
height: 100%;
&>a {
text-decoration: none;
& .img-item {
position: absolute;
top: 50%;
left: 50%;
transform: translateX(-50%) translateY(-50%);
min-width: 100%;
min-height: 100%;
width: auto;
height: auto;
overflow: hidden;
object-fit: cover;
transition: all 500ms ease 0s;
}
&>p {
position: absolute;
top: 50%;
left: 50%;
padding: 8px 20px;
border-radius: 5px;
font-size: 5em;
font-family: 'Veneer';
transform: rotate(-2deg) translateX(-50%) translateY(-50%);
white-space: nowrap;
color: white;
}
}
&:hover {
& .img-item {
transform: scale(1.1) translateX(-45%) translateY(-45%);
}
}
}
}
}
& .scroll-button {
position: absolute;
left: 50%;
top: 0;
transform: translateX(-50%);
width: 50px;
height: 50px;
background-color: #f79e15;
border-radius: 50%;
font-family: 'icomoon';
border: 0;
color: white;
font-size: 1.5em;
cursor: pointer;
& .voucher {
background-color: #f5efe9;
position: relative;
text-align: center;
padding-bottom: 70px;
&:before {
content: "\e91b";
& .voucher-content {
max-width: 1200px;
margin: 0 auto;
position: relative;
display: flex;
justify-content: center;
align-items: center;
& .link-voucher {
text-decoration: none;
cursor: pointer;
outline: none;
}
& .img-voucher {
transform: rotate(5deg);
}
& .voucher-picture {
position: relative;
padding: 0 25px;
&>img {
height: auto;
max-width: 100%;
}
}
}
}

View file

@ -81,8 +81,15 @@
}
td.tab-libelle {
font-size: 1.5em;
font-family: 'Catamaran-Bold';
text-align: left;
vertical-align: middle;
width: 100%;
& .sous-libelle {
font-size: 0.85em;
}
}
td.val-nutri, td.val-nutri-aqr, td.tab-libelle-right {

View file

@ -43,7 +43,7 @@
<label>Visuel de la vidéo * de type JPEG/PNG - 2Mo max. - 760 x 456px</label>
<input type="file" name="picture" accept="image/png, image/jpeg">
<br><br>
<img src="/images/publicites/{{$a->picture}}" style="max-height: 200px;">
<img src="{{ asset($a->picture) }}" style="max-height: 200px;">
</div>
<div class="form-group">
<label>

View file

@ -41,14 +41,14 @@
<input type="file" name="picture" accept="image/png, image/jpeg">
</br>
</br>
<img src="/images/articles/{{$a->picture}}" style="max-height: 200px;">
<img src="{{ asset($a->picture) }}" style="max-height: 200px;">
</div>
<div class="form-group">
<label>Visuel * de type JPEG/PNG - 2Mo max. - 780 x 508px</label>
<input type="file" name="picture_r" accept="image/png, image/jpeg">
</br>
</br>
<img src="/images/articles/{{$a->picture_r}}" style="max-height: 200px;">
<img src="{{ asset($a->picture_r) }}" style="max-height: 200px;">
</div>
<div class="form-group">
<label class="col-form-label">Contenu *</label>

View file

@ -62,7 +62,7 @@
<input type="file" name="picture" accept="image/png, image/jpeg">
</br>
</br>
<img src="/images/menus-equilibres/{{$m->picture}}" style="max-height: 200px;">
<img src="{{ asset($m->picture) }}" style="max-height: 200px;">
</div>
<div class="form-group">
<label class="col-form-label">Entrée *</label>

View file

@ -66,7 +66,7 @@
<input type="file" name="picture" accept="image/png, image/jpeg">
</br>
</br>
<img src="/images/eleveurs/{{$b->picture}}" style="max-height: 200px;">
<img src="{{ asset($b->picture) }}" style="max-height: 200px;">
</div>
<div class="form-group">
<input class="form-control" type="text" name="postal_code" placeholder="Code postal de l'éleveur *" value="{{$b->postal_code}}" required>
@ -125,21 +125,21 @@
<tr>
<td class="text-center">
@if ($b->site->picture1 !== null)
<img src="/images/elevages/{{$b->site->picture1}}" style="max-height: 100px;">
<img src="{{ asset($b->site->picture1) }}" style="max-height: 100px;">
@else
<label>Aucune photo.</label>
@endif
</td>
<td class="text-center">
@if ($b->site->picture2 !== null)
<img src="/images/elevages/{{$b->site->picture2}}" style="max-height: 100px;">
<img src="{{ asset($b->site->picture2) }}" style="max-height: 100px;">
@else
<label>Aucune photo.</label>
@endif
</td>
<td class="text-center">
@if ($b->site->picture3 !== null)
<img src="/images/elevages/{{$b->site->picture3}}" style="max-height: 100px;">
<img src="{{ asset($b->site->picture3) }}" style="max-height: 100px;">
@else
<label>Aucune photo.</label>
@endif

View file

@ -20,7 +20,7 @@
<tbody>
@foreach($b as $breeder)
<tr>
<th class="text-center"><img src="/images/eleveurs/{{$breeder->picture}}" style="max-height: 200px;"></th>
<th class="text-center"><img src="{{ asset($breeder->picture) }}" style="max-height: 200px;"></th>
<td>{{strtoupper($breeder->last_name)}} {{$breeder->first_name}}</td>
<td>
@if ($breeder->status === 0)

View file

@ -59,14 +59,14 @@
<input type="file" name="picture" accept="image/png, image/jpeg">
</br>
</br>
<img src="/images/slider_accueil/{{$h->picture}}" style="max-height: 200px;">
<img src="{{ asset($h->picture) }}" style="max-height: 200px;">
</div>
<div class="form-group">
<label>Visuel sur mobile * de type JPEG/PNG - 2Mo max. - 500 x 671px</label></br>
<input type="file" name="picture_r" accept="image/png, image/jpeg">
</br>
</br>
<img src="/images/slider_accueil/{{$h->picture_r}}" style="max-height: 200px;">
<img src="{{ asset($h->picture_r) }}" style="max-height: 200px;">
</div>
</div>
</div>

View file

@ -27,7 +27,7 @@
<tbody>
@foreach($h as $hsp)
<tr>
<td class="text-center"><img src="/images/slider_accueil/{{$hsp->picture}}" style="max-height: 50px;"></td>
<td class="text-center"><img src="{{ asset($hsp->picture) }}" style="max-height: 50px;"></td>
<td>
@if ($hsp->day1 === 0)
<i class="fas fa-times cross-red"></i>

View file

@ -84,12 +84,6 @@
Activer le parallax ?
</label>
</div>
<div class="form-group">
<label class="col-form-label">
<input type="checkbox" name="star_moment" @if (old('star_moment') !== null)checked @endif>
Moment star ?
</label>
</div>
</div>
</div>
</div>
@ -128,8 +122,8 @@
<div class="row">
<div class="col-md-10 offset-md-1">
<div class="form-group">
<label>Visuel du bon de réduction * de type JPEG/PNG - 2Mo max. - 580 x 330px</label></br>
<input type="file" name="voucher_picture" accept="image/png, image/jpeg" required>
<label>Visuel du bon de réduction de type JPEG/PNG - 2Mo max. - 580 x 330px</label></br>
<input type="file" name="voucher_picture" accept="image/png, image/jpeg" >
</div>
<div class="form-group">
<label class="col-form-label">

View file

@ -87,21 +87,21 @@
<input type="file" name="picture" accept="image/png, image/jpeg">
</br>
</br>
<img src="/images/moments/{{$m->picture}}" style="max-height: 200px;">
<img src="{{ asset($m->picture) }}" style="max-height: 200px;">
</div>
<div class="form-group">
<label>Visuel background * de type JPEG/PNG - 2Mo max. - 1200 x 650px</label></br>
<input type="file" name="picture_bg" accept="image/png, image/jpeg">
</br>
</br>
<img src="/images/moments/{{$m->picture_bg}}" style="max-height: 200px;">
<img src="{{ asset($m->picture_bg) }}" style="max-height: 200px;">
</div>
<div class="form-group">
<label>Visuel background mobile * de type JPEG/PNG - 2Mo max. - 500 x 300px</label></br>
<input type="file" name="picture_bg_r" accept="image/png, image/jpeg">
</br>
</br>
<img src="/images/moments/{{$m->picture_bg_r}}" style="max-height: 200px;">
<img src="{{ asset($m->picture_bg_r) }}" style="max-height: 200px;">
</div>
<div class="form-group">
<label class="col-form-label">
@ -112,18 +112,7 @@
@endif
Activer le parallax ?
</label>
</div>
<div class="form-group">
<label class="col-form-label">
@if ($m->star_moment === 1)
<input type="checkbox" name="star_moment" checked>
@else
<input type="checkbox" name="star_moment">
@endif
Moment star ?
</label>
</div>
<div class="form-group">
<br>
<label class="col-form-label">
@if ($m->status === 1)
<input type="checkbox" name="status" checked>
@ -176,11 +165,11 @@
<div class="row">
<div class="col-md-10 offset-md-1">
<div class="form-group">
<label>Visuel du bon de réduction * de type JPEG/PNG - 2Mo max. - 580 x 330px</label></br>
<label>Visuel du bon de réduction de type JPEG/PNG - 2Mo max. - 580 x 330px</label></br>
<input type="file" name="voucher_picture" accept="image/png, image/jpeg">
</br>
</br>
<img src="/images/moments/{{$m->voucher_picture}}" style="max-height: 200px;">
<img src="{{ asset($m->voucher_picture) }}" style="max-height: 200px;">
</div>
<div class="form-group">
<label class="col-form-label">

View file

@ -13,6 +13,7 @@
<tr>
<th scope="col">Titre</th>
<th scope="col">Publié ?</th>
<th scope="col">Moment star ?</th>
<th scope="col"></th>
</tr>
</thead>
@ -27,6 +28,19 @@
<i class="fas fa-check check-green"></i>
@endif
</td>
<td>
@if ($moment->status === 1)
<a href="{{route('bo.moments.change-star', $moment->id)}}" class="btn-link">
@if ($moment->star_moment === 0)
<i class="icon-size far fa-star not-star-hover"></i>
@else
<i class="icon-size fas fa-star star-hover"></i>
@endif
</a>
@else
<i class="icon-size far fa-star"></i>
@endif
</td>
<td><a href="{{route('bo.moments.edit', $moment->id)}}" class="btn btn-sm btn-primary">Éditer</a></td>
</tr>
@endforeach

View file

@ -44,7 +44,7 @@
<label>Visuel * de type JPEG/PNG - 2Mo max. - 565 x 390px</label></br>
<input type="file" name="picture" accept="image/png, image/jpeg">
</br></br>
<img src="/images/slider_actus/{{$n->picture}}" style="max-height: 200px;">
<img src="{{ asset($n->picture) }}" style="max-height: 200px;">
</div>
</div>
</div>

View file

@ -20,7 +20,7 @@
<tbody>
@foreach($n as $nsp)
<tr>
<th class="text-center"><img src="/images/slider_actus/{{$nsp->picture}}" style="max-height: 50px;"></th>
<th class="text-center"><img src="{{ asset($nsp->picture) }}" style="max-height: 50px;"></th>
<td>
@if ($nsp->status === 0)
<i class="fas fa-times cross-red"></i>

View file

@ -38,7 +38,7 @@
<input type="file" name="picture" accept="image/png, image/jpeg">
</br>
</br>
<img src="/images/ocb/{{$ocb->picture}}" style="max-height: 200px;">
<img src="{{ asset($ocb->picture) }}" style="max-height: 200px;">
</div>
<div class="form-group">
<label class="col-form-label">Contenu</label>

View file

@ -21,7 +21,7 @@
<tbody>
@foreach($contenu as $ocb)
<tr>
<th><img src="/images/ocb/{{$ocb->picture}}" style="max-height: 50px;"></th>
<th><img src="{{ asset($ocb->picture) }}" style="max-height: 50px;"></th>
<td class="w-50">
@if (strlen($ocb->content) > 100)
{!!substr($ocb->content, 0, 100)!!}

View file

@ -21,7 +21,7 @@
<tr>
<th>{{$picto->name}}</th>
<td>
<img src="/images/pictos/{{$picto->picture}}" alt="{{$picto->name}}" style="max-height: 200px;max-width: 200px;">
<img src="{{ asset($picto->picture) }}" alt="{{$picto->name}}" style="max-height: 200px;max-width: 200px;">
</td>
<td><a href="{{route('bo.product-pictograms.edit', ['product_pictogram' => $picto->id])}}" class="btn btn-sm btn-primary">Éditer</a></td>
</tr>

View file

@ -38,14 +38,14 @@
<input type="file" name="picture" accept="image/png, image/jpeg">
</br>
</br>
<img src="/images/slider_produits/{{$p->picture}}" style="max-height: 200px;">
<img src="{{ asset($p->picture) }}" style="max-height: 200px;">
</div>
<div class="form-group">
<label>Visuel sur mobile * de type JPEG/PNG - 2Mo max. - 500 x 671px</label>
<input type="file" name="picture_r" accept="image/png, image/jpeg">
</br>
</br>
<img src="/images/slider_produits/{{$p->picture_r}}" style="max-height: 200px;">
<img src="{{ asset($p->picture_r) }}" style="max-height: 200px;">
</div>
<div class="form-group">
<input type="text" class="form-control" name="link" placeholder="Lien *" value="{{$p->link}}" required>

View file

@ -20,7 +20,7 @@
<tbody>
@foreach($p as $product)
<tr>
<th class="text-center"><img src="/images/slider_produits/{{$product->picture}}" style="max-height: 50px;"></th>
<th class="text-center"><img src="{{ asset($product->picture) }}" style="max-height: 50px;"></th>
<td>
@if ($product->status === 0)
<i class="fas fa-times cross-red"></i>

View file

@ -44,7 +44,7 @@
<input type="file" name="picture" accept="image/png, image/jpeg">
</br>
</br>
<img src="{{ asset('images/produits/' . $p->picture) }}" style="max-height: 200px;">
<img src="{{ asset($p->picture) }}" style="max-height: 200px;">
</div>
<div class="form-group">
<input class="form-control" type="text" name="tags" placeholder="Tags (séparer par des points virgules)" value="{{$p->tags}}">
@ -281,7 +281,7 @@
@if ($p->picture_video !== null)
</br>
</br>
<img src="/images/produits/{{$p->picture_video}}" style="max-height: 200px;">
<img src="{{ asset($p->picture_video) }}" style="max-height: 200px;">
@endif
</div>
<div class="form-group text-center">

View file

@ -27,7 +27,7 @@
<td>
<a href="{{route('bo.products.change-star', $product->id)}}" class="btn-link">
@if ($product->star === 0)
<i name="star_empty" class="icon-size far fa-star"></i>
<i name="star_empty" class="icon-size far fa-star not-star-hover"></i>
@else
<i name="star_full" class="icon-size fas fa-star star-hover"></i>
@endif

View file

@ -41,7 +41,7 @@
<input type="file" name="picture" accept="image/png, image/jpeg">
</br>
</br>
<img src="/images/qr_codes/{{$q->picture}}" style="max-height: 200px;">
<img src="{{ asset($q->picture) }}" style="max-height: 200px;">
</div>
<div class="form-group">
<input type="text" class="form-control" name="link" placeholder="Lien *" value="{{$q->link}}" required>

View file

@ -60,13 +60,13 @@
<label>Visuel de type JPEG/PNG - 2Mo max. - 640 x 564px</label>
<input type="file" name="picture" accept="image/png, image/jpeg">
<br><br>
<img src="/images/gammes/{{$r->picture}}" style="max-height: 200px;">
<img src="{{ asset($r->picture) }}" style="max-height: 200px;">
</div>
<div class="form-group">
<label>Visuel rectangulaire de type JPEG/PNG - 2Mo max. - 1366 x 563px</label>
<input type="file" name="picture_r" accept="image/png, image/jpeg">
<br><br>
<img src="/images/gammes/{{$r->picture_r}}" style="max-height: 200px;">
<img src="{{ asset($r->picture_r) }}" style="max-height: 200px;">
</div>
<div class="form-group">
<label>

View file

@ -47,7 +47,7 @@
<input type="file" name="picture" accept="image/png, image/jpeg">
</br>
</br>
<img src="/images/recettes/{{$r->picture}}" style="max-height: 200px;">
<img src="{{ asset($r->picture) }}" style="max-height: 200px;">
</div>
<div class="form-group">
<label class="col-form-label">Ingrédients *</label>
@ -104,48 +104,24 @@
<div class="form-group col-md-6 row">
<label class="col-md-5 col-form-label">Difficulté</label>
<select class="custom-select col-md-7" name="difficulty">
@if ($r->difficulty === 0)
<option value="0" selected>Très facile</option>
@else
<option value="0">Très facile</option>
@endif
@if ($r->difficulty === 1)
<option value="1" selected>Facile</option>
@else
<option value="1">Facile</option>
@endif
@if ($r->difficulty === 2)
<option value="2" selected>Confirmé</option>
@else
<option value="2">Confirmé</option>
@endif
@if ($r->difficulty === 3)
<option value="3" selected>Expert</option>
@else
<option value="3">Expert</option>
@endif
<option value="0" @if ($r->difficulty === 0)selected @endif>Très facile</option>
<option value="1" @if ($r->difficulty === 1)selected @endif>Facile</option>
<option value="2" @if ($r->difficulty === 2)selected @endif>Confirmé</option>
<option value="3" @if ($r->difficulty === 3)selected @endif>Expert</option>
</select>
</div>
</div>
<div class="form-group">
<select class="custom-select" name="associated_product1">
@foreach ($p as $product)
@if ($r->associated_product1 === $product->id)
<option id="product_{{$product->id}}" data-ct="{{$product->consumption_times_id}}" value="{{$product->id}}" selected>{{$product->name}}</option>
@else
<option id="product_{{$product->id}}" data-ct="{{$product->consumption_times_id}}" value="{{$product->id}}">{{$product->name}}</option>
@endif
<option id="product_{{$product->id}}" data-ct="{{$product->consumption_times_id}}" value="{{$product->id}}" @if ($r->associated_product1 === $product->id)selected @endif>{{$product->name}}</option>
@endforeach
</select>
</div>
<div class="form-group">
<select class="custom-select" name="associated_product2">
@foreach ($p as $product)
@if ($r->associated_product2 === $product->id)
<option value="{{$product->id}}" selected>{{$product->name}}</option>
@else
<option value="{{$product->id}}">{{$product->name}}</option>
@endif
<option value="{{$product->id}}" @if ($r->associated_product2 === $product->id)selected @endif>{{$product->name}}</option>
@endforeach
</select>
</div>
@ -153,11 +129,7 @@
<label class="col-md-4">Moment consommation</label>
<select class="custom-select col-md-8" name="consumption_times">
@foreach ($c as $consumption_time)
@if ($r->consumption_times === $consumption_time->id)
<option value="{{$consumption_time->id}}" selected>{{$consumption_time->name}}</option>
@else
<option value="{{$consumption_time->id}}">{{$consumption_time->name}}</option>
@endif
<option value="{{$consumption_time->id}}" @if ($r->consumption_times === $consumption_time->id)selected @endif>{{$consumption_time->name}}</option>
@endforeach
</select>
</div>
@ -166,11 +138,7 @@
<div class="form-group col-md-8">
@foreach ($a as $article)
<label>
@if (in_array($article->id, $raIds))
<input type="checkbox" name="associated_news[]" value="{{$article->id}}" checked>
@else
<input type="checkbox" name="associated_news[]" value="{{$article->id}}">
@endif
<input type="checkbox" name="associated_news[]" value="{{$article->id}}" @if (in_array($article->id, $raIds))checked @endif>
{{$article->title}}
</label></br>
@endforeach
@ -178,21 +146,13 @@
</div>
<div class="form-group">
<label>
@if ($r->notification === 1)
<input type="checkbox" name="notification" checked>
@else
<input type="checkbox" name="notification">
@endif
<input type="checkbox" name="notification" @if ($r->notification === 1)checked @endif>
Notification activé
</label>
</div>
<div class="form-group">
<label>
@if ($r->status === 1)
<input type="checkbox" name="status" value="1" checked>
@else
<input type="checkbox" name="status" value="1">
@endif
<input type="checkbox" name="status" value="1" @if ($r->status === 1)checked @endif>
Publié ?
</label>
</div>

View file

@ -8,7 +8,7 @@
<img src="{{ asset('images/moments/logo-encemoment.png') }}" alt="En ce moment - Le Gaulois" class="img-moment-header">
<p class="title {{ $moment->color }}">{{ $moment->title }}</p>
<!-- TODO : GESTION IMG SI MOBILE -->
<img src="{{ asset('images/moments/' . $moment->picture_bg) }}" alt="En ce moment - Le Gaulois" class="img-cover">
<img src="{{ asset($moment->picture_bg) }}" alt="En ce moment - Le Gaulois" class="img-cover">
</div>
</div>
@endsection
@ -17,11 +17,103 @@
{{-- TODO : Parallax --}}
<div class="content-moment">
<section class="moment">
<img src="{{ asset('images/moments/' . $moment->picture) }}" alt="{{ $moment->title }} - Le Gaulois" class="img-moment">
<button class="scroll-button" onclick="scrollToContent()"></button>
<h1 id="title-moment">{{ $moment->featured_title }}</h1>
{!! $moment->featured_text !!}
<img src="{{ asset($moment->picture) }}" alt="{{ $moment->title }} - Le Gaulois" class="img-moment">
<section class="strates">
@if ($moment->strates()->count() > 0)
@foreach ($moment->strates as $strate)
<div class="strate-item">
<button class="scroll-button" onclick="scrollToContent('{{ 'strate-text-' . $loop->iteration }}')"></button>
@if ($strate->picture)
<figure>
<span><img src="{{ asset($strate->picture) }}" alt="{{ $strate->title }} - Le Gaulois"></span>
<figcaption>{{ $strate->picture_label }}</figcaption>
</figure>
@endif
<div class="strate-text" id="strate-text-{{ $loop->iteration }}">
<h1>{{ $strate->title }}</h1>
{!! $strate->content !!}
</div>
</div>
@endforeach
@endif
</section>
<section class="ascent">
@if ($moment->featured_status === 1)
<div class="ascent-content">
<button class="scroll-button" onclick="scrollToContent('title-ascent')"></button>
<h1 id="title-ascent">{{ $moment->featured_title }}</h1>
{!! $moment->featured_text !!}
@if ($moment->featured_type === "produits")
<div class="ascent-products">
@else
<div class="ascent-objects">
@endif
@foreach ($featuredObjects as $object)
@if ($moment->featured_type === "recettes")
<a href="{{ route('recipe', $object->slug) }}">
@elseif ($moment->featured_type === "articles")
<a href="{{ route('club.infos.child', $object->slug) }}">
@elseif ($moment->featured_type === "produits")
<a href="{{ route('product', $object->slug) }}">
@endif
<figure>
<img src="{{ asset($object->picture) }}" alt="Le Gaulois">
<div class="hover-img">
@if ($moment->featured_type === "recettes")
Voir la recette !
@elseif ($moment->featured_type === "articles")
Voir l'article !
@endif
</div>
</figure>
<p>{{ isset($object->title) ? $object->title : $object->name }}</p>
@if ($moment->featured_type === "produits")<span>{{ $object->portion_description }}</span> @endif
</a>
@endforeach
</div>
<div class="ascent-btn">
@if ($moment->featured_type === "recettes")
<a href="{{ route('recipes') }}">Toutes les recettes</a>
@elseif ($moment->featured_type === "articles")
<a href="{{ route('club.index') }}">Tous les articles</a>
@elseif ($moment->featured_type === "produits")
<a href="{{ route('products.index') }}">Tous les produits</a>
@endif
</div>
</div>
@endif
</section>
<section class="voucher">
@if ($moment->voucher_status === 1)
<button class="scroll-button" onclick="scrollToContent('voucher-content')"></button>
<div class="voucher-content">
<figure class="voucher-picture" id="voucher-content">
<img src="{{ asset('images/moments/lebonplan-moment.png') }}" alt="Bon plan - Le Gaulois">
</figure>
<figure class="voucher-picture">
@auth
<a href="{{ route('club.reductions') }}" class="link-voucher">
@else
<a href="{{ route('connexion') }}" class="link-voucher">
@endauth
<img src="{{ asset($moment->voucher_picture) }}" alt="{{ $moment->title }} - Le Gaulois" class="img-voucher">
</a>
</figure>
</div>
@endif
</section>
<section class="other-moments">
<h2>Découvrez aussi</h2>
<div>
@foreach ($otherMoments as $om)
<figure>
<a href="{{ route('moment', $om->slug) }}">
<img src="{{ asset($om->picture) }}" alt="{{ $om->title }} - Le Gaulois" class="img-item">
<p class="{{ $om->color }}">{{ $om->title }}</p>
</a>
</figure>
@endforeach
</div>
</section>
</div>
@ -29,8 +121,8 @@
@section('scripts')
<script type="text/javascript">
function scrollToContent() {
var element = document.getElementById('title-moment');
function scrollToContent(content) {
var element = document.getElementById(content);
var headerOffset = 70;
var elementPosition = element.getBoundingClientRect().top;
var offsetPosition = window.pageYOffset + elementPosition - headerOffset;

View file

@ -17,7 +17,7 @@
<section class="breeder">
<div class="breeder-left">
<img src="{{ asset('images/eleveurs/' . $breeder->picture) }}" alt="{{ $breeder->first_name }} {{ $breeder->last_name }} - Le Gaulois">
<img src="{{ asset($breeder->picture) }}" alt="{{ $breeder->first_name }} {{ $breeder->last_name }} - Le Gaulois">
<span>Éleveur de volailles à {{ $breeder->town }}</span>
</div>
<div class="breeder-right">
@ -79,7 +79,7 @@
<!-- Slider -->
<breeder-site-slider slides='@json($pictures)'></breeder-site-slider>
@else
<img src="{{ asset('images/elevages/' . $pictures[0]) }}" alt="Exploitation - Le Gaulois">
<img src="{{ asset($pictures[0]) }}" alt="Exploitation - Le Gaulois">
@endif
@endif
</section>

View file

@ -12,7 +12,7 @@
@else
<a href="{{ $productsSlides[0]->link }}" target="{{ $productsSlides[0]->new_tab === 1 ? '_blank' : '_self' }}">
<!-- TODO : GESTION IMG SI MOBILE -->
<img src="{{ asset('images/slider_produits/' . $productsSlides[0]->picture) }}" alt="Image - Le Gaulois">
<img src="{{ asset($productsSlides[0]->picture) }}" alt="Image - Le Gaulois">
</a>
@endif
</div>
@ -71,13 +71,13 @@
<div class="ranges">
@foreach($ranges as $range)
<div class="item">
<img src="{{ asset('images/gammes/' .$range->picture) }}">
<img src="{{ asset($range->picture) }}">
<div class="title">
<p class="{{ $range->color }} pattern">{{ $range->name }}</p>
</div>
<div class="hover {{ $range->color }} pattern">
<a href="{{ route('products.range', $range->slug) }}" title="{{ $range->name }}">
<img alt="{{ $range->name}} - Le Gaulois" src="{{ asset('images/gammes/' . $range->picture) }}">
<img alt="{{ $range->name}} - Le Gaulois" src="{{ asset($range->picture) }}">
<span>Découvrez {{ $range->name }}</span>
</a>
</div>
@ -91,7 +91,7 @@
@foreach($productsList as $product)
<div class="item">
<a href="{{ route('product', $product->slug) }}">
<img src="{{ asset('images/produits/' . $product->picture)}}">
<img src="{{ asset($product->picture)}}">
<p>{{ $product->name }}</p>
<span>Découvrez le produit</span>
</a>

View file

@ -58,7 +58,7 @@
<img class="logo" src="{{ asset('images/ocb/logo-oui.png') }}" width="190" alt="Oui c'est bon - Le Gaulois">
</picture>
<picture>
<img class="eleveur" src="{{ asset('images/eleveurs/' . $breeder->picture) }}" alt="Eleveur {{ $breeder->last_name . ' ' . $breeder->first_name }} - Le Gaulois">
<img class="eleveur" src="{{ asset($breeder->picture) }}" alt="Eleveur {{ $breeder->last_name . ' ' . $breeder->first_name }} - Le Gaulois">
</picture>
<p class="title">Alimentation:</p>
<ul>
@ -88,7 +88,7 @@
@foreach ($starProducts as $starProduct)
<div>
<a href="{{ route('product', $starProduct->slug) }}">
<img alt="{{ $starProduct->name }} - Le Gaulois" src="{{ asset('images/produits/' . $starProduct->picture) }}">
<img alt="{{ $starProduct->name }} - Le Gaulois" src="{{ asset($starProduct->picture) }}">
<h5>{{ $starProduct->name }}</h5>
<button type="button" href="{{ route('product', $starProduct->slug) }}">Découvrir le produit</button>
</a>

View file

@ -12,10 +12,6 @@
<!-- Scripts -->
{{-- TODO : Ajouter jQuery dans app.js --}}
<script src="https://code.jquery.com/jquery-3.5.1.min.js" integrity="sha256-9/aliU8dGd2tb6OSsuzixeV4y/faTqgFtohetphbbj0=" crossorigin="anonymous"></script>
{{-- TODO : Ajouter CKEditor dans app.js --}}
{{-- <script src="https://cdn.ckeditor.com/ckeditor5/23.0.0/classic/ckeditor.js"></script> --}}
{{-- TODO : Voir l'inclusion de Font Awesome, pour le moment c'est fait avec mon compte FA --}}
<script src="https://kit.fontawesome.com/2327d60f96.js" crossorigin="anonymous"></script>
<!-- Fonts -->
<link rel="dns-prefetch" href="//fonts.gstatic.com">

Some files were not shown because too many files have changed in this diff Show more