Engagement: - création des pages

- Fix retours Marine et modification ordre des engagements
This commit is contained in:
Jérémy Munsch 2021-07-07 08:40:57 +02:00
parent ff9a48199f
commit 3d2dfde1e8
116 changed files with 3299 additions and 1 deletions

View file

@ -0,0 +1,37 @@
<?php
namespace App\Enums;
use Kwaadpepper\Enum\BaseEnum;
/**
* @method static self bloc1()
* @method static self bloc2()
* @method static self bloc3()
* @method static self bloc4()
* @method static self bloc5()
*/
final class EngagementBlocType extends BaseEnum
{
protected static function values(): array
{
return [
'bloc1' => 0,
'bloc2' => 1,
'bloc3' => 2,
'bloc4' => 3,
'bloc5' => 4
];
}
protected static function labels(): array
{
return [
'bloc1' => __('Bloc 1'),
'bloc2' => __('Bloc 2 (mise en avant)'),
'bloc3' => __('Bloc 3'),
'bloc4' => __('Bloc 4 (bloc 3 inversé)'),
'bloc5' => __('Bloc 5 (info horizontale)')
];
}
}

View file

@ -0,0 +1,28 @@
<?php
namespace App\Enums;
use Kwaadpepper\Enum\BaseEnum;
/**
* @method static self header()
* @method static self article()
*/
final class EngagementType extends BaseEnum
{
protected static function values(): array
{
return [
'header' => 0,
'article' => 1
];
}
protected static function labels(): array
{
return [
'header' => __('Entête'),
'article' => __('Article')
];
}
}

31
app/Enums/InputType.php Normal file
View file

@ -0,0 +1,31 @@
<?php
namespace App\Enums;
use Kwaadpepper\Enum\BaseEnum;
/**
* @method static self boolean()
* @method static self image()
* @method static self string()
* @method static self text()
* html autorisé
* @method static self url()
* @method static self imageArray()
* @method static self labelArray()
*/
final class InputType extends BaseEnum
{
protected static function values(): array
{
return [
'boolean' => 0,
'image' => 1,
'string' => 2,
'text' => 3,
'url' => 4,
'imageArray' => 5,
'labelArray' => 6
];
}
}

View file

@ -0,0 +1,48 @@
<?php
namespace App\Http\Controllers\Bo;
use App\Enums\InputType;
use App\Http\Controllers\Controller;
use App\Http\Requests\UpdateEngagement;
use App\Models\Engagement;
use App\Traits\UpdateModelStatus;
class EngagementsController extends Controller
{
use UpdateModelStatus;
public function index()
{
$engagements = Engagement::paginate();
return view('bo.engagements.index', compact('engagements'));
}
public function edit(Engagement $engagement)
{
return view('bo.engagements.edit', ['engagement' => $engagement]);
}
public function update(UpdateEngagement $request, Engagement $engagement)
{
$engagement->fill(array_replace_recursive(
$this->clearImagesArrays($engagement->toArray()),
$request->validated()
));
$engagement->saveOrFail();
return redirect()->route('bo.engagements.edit', $engagement->id)
->with('success', 'Enregistré !');
}
private function clearImagesArrays(array $engagement): array
{
foreach ($engagement['content'] as &$block) {
foreach ($block['content'] as &$input) {
if ($input['inputType']['value'] === InputType::imageArray()->value) {
$input['value'] = [];
}
}
}
return $engagement;
}
}

View file

@ -0,0 +1,50 @@
<?php
namespace App\Http\Controllers;
use App\Enums\EngagementType;
use App\Models\Engagement;
use Illuminate\Support\Facades\View;
class EngagementsController extends Controller
{
public function lagrandemarque()
{
$this->pushIntroToView();
$engagement = Engagement::findOrFail(2);
return view('front.onsengage.engageetresponsable.engagement', compact('engagement'));
}
public function biennourrir()
{
$this->pushIntroToView();
$engagement = Engagement::findOrFail(4);
return view('front.onsengage.engageetresponsable.engagement', compact('engagement'));
}
public function eleverdurablement()
{
$this->pushIntroToView();
$engagement = Engagement::findOrFail(3);
return view('front.onsengage.engageetresponsable.engagement', compact('engagement'));
}
public function respecterlaterre()
{
$this->pushIntroToView();
$engagement = Engagement::findOrFail(6);
return view('front.onsengage.engageetresponsable.engagement', compact('engagement'));
}
public function vivreensemble()
{
$this->pushIntroToView();
$engagement = Engagement::findOrFail(5);
return view('front.onsengage.engageetresponsable.engagement', compact('engagement'));
}
private function pushIntroToView()
{
View::share('intro', Engagement::where('type', EngagementType::header())->firstOrFail());
}
}

View file

@ -0,0 +1,168 @@
<?php
namespace App\Http\Requests;
use App\Enums\EngagementType;
use App\Enums\InputType;
use App\Lib\Utils;
use Illuminate\Support\Str;
use Illuminate\Foundation\Http\FormRequest;
use Illuminate\Validation\ValidationException;
class UpdateEngagement extends FormRequest
{
/**
* Determine if the user is authorized to make this request.
*
* @return bool
*/
public function authorize()
{
if (auth()->check()) {
$this->merge([
'status' => $this->status === null ? 0 : 1
]);
return true;
}
return false;
}
/**
* Get the validation rules that apply to the request.
*
* @return array
*/
public function rules()
{
$rules = [
'title' => 'required|string|min:7',
'metaTitle' => 'required|string|min:20|max:60',
'metaDescription' => 'required|string|min:130|max:160'
];
if ($this->engagement->type == EngagementType::header()) {
$rules = array_merge($rules, [
'content' => 'required|string|min:40'
]);
} else {
foreach ($this->engagement->content as $i => $block) {
foreach ($block['content'] as $iptName => $input) {
switch ($input['inputType']['value']) {
case InputType::string()->value:
$rules = array_merge($rules, [
"content.$i.content.$iptName.value" => 'required|string|min:4'
]);
break;
case InputType::text()->value:
$rules = array_merge($rules, [
"content.$i.content.$iptName.value" => 'required|string|min:15'
]);
break;
case InputType::image()->value:
$ipt = $this->engagement->content[$i]['content'][$iptName];
$max = isset($ipt['dimensionsMax']);
$dim = collect(explode(
',',
$ipt['dimensions'] ?? $ipt['dimensionsMax']
))->mapWithKeys(function ($v) {
$v = explode(' ', $v);
return [$v[0] => $v[1]];
});
$rules = array_merge($rules, [
"content.$i.content.$iptName.value" => [
'sometimes',
'image',
'mimes:png,jpg,svg',
sprintf(
'dimensions:%s=%d,%s=%d',
$max ? 'max_height' : 'height',
$dim['hauteur'],
$max ? 'max_width' : 'width',
$dim['largeur']
)
]
]);
break;
case InputType::imageArray()->value:
$ipt = $this->engagement->content[$i]['content'][$iptName];
$max = isset($ipt['dimensionsMax']);
$dim = collect(explode(
',',
$ipt['dimensions'] ?? $ipt['dimensionsMax']
))->mapWithKeys(function ($v) {
$v = explode(' ', $v);
return [$v[0] => $v[1]];
});
$rules = array_merge($rules, [
"content.$i.content.$iptName.value.*" => 'sometimes|array'
]);
if (is_array($this->input("content.$i.content.$iptName.value.*"))) {
foreach ($this->input("content.$i.content.$iptName.value.*") as $imageK => $image) {
if (!is_string($image)) {
$rules = array_merge($rules, [
"content.$i.content.$iptName.value.$imageK" => [
'image',
'mimes:png,jpg,svg',
sprintf(
'dimensions:%s=%d,%s=%d',
$max ? 'max_height' : 'height',
$dim['hauteur'],
$max ? 'max_width' : 'width',
$dim['largeur']
)
]
]);
} else {
$rules = array_merge($rules, [
"content.$i.content.$iptName.value.$imageK" => 'string'
]);
}
}
}
break;
case InputType::url()->value:
$rules = array_merge($rules, [
"content.$i.content.$iptName.value" => [
'required', 'url',
// @phpcs:ignore Generic.CodeAnalysis.UnusedFunctionParameter.FoundInExtendedClassBeforeLastUsed
function ($attribute, $value, $fail) {
try {
Utils::assertNoInternalUrls($attribute, $value);
} catch (ValidationException $e) {
$fail(collect($e->errors())->first()[0]);
}
}
]
]);
break;
case InputType::labelArray()->value:
$all = $this->all();
foreach ($this->input("content.$i.content.$iptName.value") as $labelIndex => $label) {
if ($labelIndex === 'X') {
unset($all['content'][$i]['content'][$iptName]['value'][$labelIndex]);
continue;
}
$rules = array_merge($rules, [
"content.$i.content.$iptName.value.$labelIndex.*" => 'string'
]);
}
$this->merge($all);
break;
case InputType::boolean()->value:
$all = $this->all();
$nested = Utils::dotStringToNestedArray(
"content.$i.content.$iptName.value",
$this->input("content.$i.content.$iptName.value") ? true : false
);
$all = array_merge_recursive_distinct($all, $nested);
$this->merge($all);
$rules = array_merge($rules, [
"content.$i.content.$iptName.value" => 'boolean'
]);
break;
}
}
}
}
return $rules;
}
}

View file

@ -142,4 +142,15 @@ class Utils
);
return $text;
}
public static function dotStringToNestedArray($path, $value, $separator = '.')
{
$arr = $value;
$keys = array_reverse(explode($separator, $path));
foreach ($keys as $key) {
$arr = [$key => $arr];
}
return $arr;
}
}

353
app/Models/Engagement.php Normal file
View file

@ -0,0 +1,353 @@
<?php
namespace App\Models;
use App\Enums\EngagementBlocType;
use App\Enums\EngagementType;
use App\Enums\InputType;
use App\Lib\Utils;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Http\UploadedFile;
use Illuminate\Support\Facades\File;
use Illuminate\Support\Str;
use Kwaadpepper\Enum\Traits\CastsEnums;
use SplFileInfo;
class Engagement extends Model
{
use CastsEnums;
protected $enumCasts = [
'type' => EngagementType::class
];
protected $casts = [
'content' => 'array',
];
protected $fillable = [
'icon', 'pretitle', 'title',
'metaTitle', 'metaDescription',
'content', 'status'
];
protected $attributes = [
'icon' => '',
'pretitle' => '',
'metaTitle' => '',
'metaDescription' => '',
'type' => 1, // EngagementType article
];
protected static function booted()
{
static::creating(function (Engagement $engagement) {
});
static::updating(function (Engagement $engagement) {
});
}
public function setContentAttribute($value)
{
$this->setContent($value);
}
public function getContentAttribute()
{
$content = json_decode($this->getRawOriginal('content'), true);
return isset($content->header) ? $content->header : $content;
}
/**
* Fill the model with an array of attributes.
*
* @param array $attributes
* @return $this
*
* @throws \Illuminate\Database\Eloquent\MassAssignmentException
*/
public function fill(array $attributes)
{
parent::fill($attributes);
if (isset($attributes['content'])) {
$this->setContent($attributes['content']);
}
}
/**
* Get Blocks Template Data
*
* @return array
*/
public static function getBlocks(): array
{
return [
EngagementBlocType::bloc1()->value => [
'type' => EngagementBlocType::bloc1(),
'content' => [
'img' => [
'dimensions' => 'largeur 792,hauteur 555',
'label' => 'Illustration',
'inputType' => InputType::image(),
'alt' => '',
'value' => ''
],
'title' => [
'label' => 'Titre (h2)',
'inputType' => InputType::string(),
'value' => ''
],
'content' => [
'label' => 'Contenu',
'inputType' => InputType::text(),
'value' => ''
],
'side' => [
'label' => 'Orientation de l\'image (gauche ou droite)',
'inputType' => InputType::boolean(),
'value' => ''
],
'link' => [
'text' => 'En savoir +',
'label' => 'Lien du bouton en savoir +',
'inputType' => InputType::url(),
'status' => true,
'newtab' => false,
'value' => ''
],
'labels' => [
'label' => 'Labels avec titre',
'inputType' => InputType::labelArray(),
'value' => []
]
]
],
EngagementBlocType::bloc2()->value => [
'type' => EngagementBlocType::bloc2(),
'content' => [
'img' => [
'dimensions' => 'largeur 384,hauteur 260',
'label' => 'Illustration',
'inputType' => InputType::image(),
'alt' => '',
'value' => ''
],
'content' => [
'label' => 'Contenu',
'inputType' => InputType::text(),
'value' => ''
],
'link' => [
'label' => 'Lien du bouton en savoir +',
'inputType' => InputType::url(),
'status' => true,
'newtab' => false,
'value' => ''
]
]
],
EngagementBlocType::bloc3()->value => [
'type' => EngagementBlocType::bloc3(),
'content' => [
'img' => [
'dimensions' => 'largeur 486,hauteur 682',
'label' => 'Illustration',
'inputType' => InputType::image(),
'alt' => '',
'value' => ''
],
'title' => [
'label' => 'Titre (h2)',
'inputType' => InputType::string(),
'value' => ''
],
'content' => [
'label' => 'Contenu',
'inputType' => InputType::text(),
'value' => ''
],
'side' => [
'label' => 'Orientation de l\'image (gauche ou droite)',
'inputType' => InputType::boolean(),
'value' => ''
],
'link' => [
'label' => 'Lien du bouton en savoir +',
'inputType' => InputType::url(),
'status' => true,
'newtab' => false,
'value' => ''
],
'labels' => [
'label' => 'Labels avec titre',
'inputType' => InputType::labelArray(),
'value' => []
]
]
],
EngagementBlocType::bloc4()->value => [
'type' => EngagementBlocType::bloc4(),
'content' => [
'img' => [
'dimensions' => 'largeur 792,hauteur 792',
'label' => 'Illustration',
'inputType' => InputType::image(),
'alt' => '',
'value' => ''
],
'title' => [
'label' => 'Titre (h2)',
'inputType' => InputType::string(),
'value' => ''
],
'content' => [
'label' => 'Contenu',
'inputType' => InputType::text(),
'value' => ''
],
'side' => [
'label' => 'Orientation de l\'image (gauche ou droite)',
'inputType' => InputType::boolean(),
'value' => ''
],
'link' => [
'label' => 'Lien du bouton en savoir +',
'inputType' => InputType::url(),
'status' => true,
'newtab' => false,
'value' => ''
],
'labels' => [
'label' => 'Labels avec titre',
'inputType' => InputType::labelArray(),
'value' => []
]
]
],
EngagementBlocType::bloc5()->value => [
'type' => EngagementBlocType::bloc5(),
'content' => [
'titlePicto' => [
'dimensionsMax' => 'largeur 130,hauteur 110',
'label' => 'Pictogramme Titre',
'inputType' => InputType::image(),
'value' => ''
],
'mobileVisible' => [
'label' => 'Visible sur mobile ?',
'inputType' => InputType::boolean(),
'value' => ''
],
'images' => [
'dimensionsMax' => 'largeur 130,hauteur 110',
'label' => 'Illustrations',
'inputType' => InputType::imageArray(),
'value' => []
]
]
],
];
}
/**
* Get Label Template Data
*
* @return array
*/
public static function getLabel(): array
{
return [
'bigText' => '',
'text' => '',
'fullLine' => false
];
}
private function setContent($content): void
{
$attrs = $this->attributes;
if (isset($attrs['content'])) {
unset($attrs['content']);
}
if (is_string($content)) {
$content = sprintf('{"header" : "%s"}', $content);
} else {
$content = $this->serializeContent($content);
}
$this->setRawAttributes(\array_merge_recursive(
$attrs,
['content' => $content]
));
}
private function serializeContent(array $content): string
{
foreach ($content as $i => $bloc) {
foreach ($bloc['content'] as $o => $input) {
switch ($input['inputType']->value ?? $input['inputType']['value']) {
case InputType::image()->value:
$content[$i]['content'][$o]['value'] = $this->storeImage($input['value']);
break;
case InputType::imageArray()->value:
foreach ($input['value'] as $k => $image) {
$content[$i]['content'][$o]['value'][$k] = $this->storeImage($image);
}
break;
case InputType::labelArray()->value:
case InputType::boolean()->value:
case InputType::text()->value:
case InputType::string()->value:
break;
case InputType::url()->value:
Utils::assertNoInternalUrls('content', $input['value']);
break;
default:
throw new \Exception(sprintf('Unknown input Type %s', $input['inputType']->label ?? $input['inputType']['label']));
}
}
}
return json_encode($content);
}
private function storeImage($image): string
{
if (\is_object($image) and get_class($image) === UploadedFile::class) {
/** @var UploadedFile */
$image = $image;
$newPath = $this->prepareMoveFile($image->getClientOriginalName());
$newPath = str_replace(storage_path('app'), '', $newPath);
$image->storePubliclyAs(pathinfo($newPath, \PATHINFO_DIRNAME), pathinfo($newPath, \PATHINFO_BASENAME));
return '/storage' . str_replace('/public', '', $newPath);
}
if (\is_object($image) and get_class($image) === SplFileInfo::class) {
/** @var SplFileInfo */
$image = $image;
$newPath = $this->prepareMoveFile($image->getBaseName());
if (!File::copy($image->getRealPath(), $newPath)) {
throw new \Exception(sprintf(
'Failed to copy file %s to %s',
$image->getRealPath(),
$newPath
));
}
return str_replace(\storage_path('app/public'), '/storage', $newPath);
}
if (\is_string($image)) {
return $image;
}
}
private function prepareMoveFile(string $filename): string
{
$pathFolder = \storage_path('app/public/images/engagements');
if (!File::exists($pathFolder)) {
File::makeDirectory($pathFolder, 0755, true);
}
$filename = sprintf('%s-%s', Str::uuid(), $filename);
$fullPath = sprintf('%s/%s', $pathFolder, $filename);
if (File::exists($fullPath)) {
File::delete($fullPath);
}
return $fullPath;
}
}

View file

@ -7,6 +7,7 @@ use App\Models\Articles;
use App\Models\BalancedMenus;
use App\Models\BreederPortrait;
use App\Models\ConsumptionTimes;
use App\Models\Engagement;
use App\Models\FaqQuestions;
use App\Models\HomeSliderPictures;
use App\Models\MeatTypes;
@ -50,6 +51,9 @@ class RouteServiceProvider extends ServiceProvider
Route::bind('publishedArticle', function ($value) {
return Articles::where('id', $value)->orWhere('slug', $value)->where('status', true)->firstOrFail();
});
Route::bind('engagement', function ($value) {
return Engagement::where('id', $value)->firstOrFail();
});
Route::bind('product', function ($value) {
return Products::where('id', $value)->orWhere('slug', $value)->firstOrFail();
});

View file

@ -254,7 +254,10 @@ return [
'ArticleCategory' => \App\Enums\ArticleCategory::class,
'RecipeFilter' => \App\Enums\RecipeFilter::class,
'RecipeFilterTimes' => \App\Enums\RecipeFilterTimes::class,
'NotificationType' => \App\Enums\NotificationType::class
'NotificationType' => \App\Enums\NotificationType::class,
'EngagementType' => \App\Enums\EngagementType::class,
'EngagementBlocType' => \App\Enums\EngagementBlocType::class,
'InputType' => \App\Enums\InputType::class
],
];

View file

@ -0,0 +1,779 @@
<?php
use App\Enums\EngagementBlocType;
use App\Enums\EngagementType;
use App\Models\Engagement;
use App\Models\MeatTypes;
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Http\UploadedFile;
use Illuminate\Support\Facades\File;
use Illuminate\Support\Facades\Schema;
class CreateEngagementsTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('engagements', function (Blueprint $table) {
$table->id();
// EngagementType
$table->smallInteger('type');
$table->string('icon');
$table->string('pretitle');
$table->string('title');
$table->string('metaTitle');
$table->string('metaDescription');
// contient un tableau de blocks (json)
$table->mediumText('content');
$table->boolean('status');
$table->timestamps();
});
$engagement0 = new Engagement([
'title' => 'Le Gaulois,<br> marque engagée et responsable',
'content' => '<p>Face aux enjeux de notre époque, Le Gaulois répond présent.<br>Chaque jour, nous avançons pas à pas avec les équipes, les partenaires et les consommateurs pour élaborer des produits gourmands, de qualité et ainsi créer de bons moments de convivialité à table et en cuisine. Découvrez nos 5 engagements et nos actions pour minimiser l’impact de notre activité sur l’environnement, veiller au bien-être animal et améliorer notre alimentation et notre qualité de vie</p>',
'status' => true
]);
$engagement0->type = EngagementType::header();
$engagement0->saveOrFail();
$engagement1 = new Engagement(
[
'icon' => '/assets/images/onsengage/svgs/engagement1/GAULOIS_engagement-1.svg',
'pretitle' => 'Engagement n°1',
'metaTitle' => 'Le Gaulois - La marque 100% volaille française',
'metaDescription' => '100% des produits de volaille Le Gaulois sont élaborés à partir de volailles nées, élevées et élaborées en France',
'title' => 'Être la grande marque alimentaire 100% française',
'content' => [
array_replace_recursive(
Engagement::getBlocks()[EngagementBlocType::bloc1()->value],
[
'type' => EngagementBlocType::bloc1(),
'content' => [
'img' => [
'alt' => 'Français depuis toujours',
'value' => '/assets/images/onsengage/images/engagement1/le-gaulois-engagement_792x555_Francais-depuis-toujours.jpg'
],
'title' => [
'value' => '100% Française depuis toujours'
],
'content' => [
'value' => '<p>Née au cœur de la Sarthe en 1984, notre marque Le Gaulois, a toujours eu la fibre, à la fois locale et nationale depuis son origine. Aujourd’hui, c’est 100% des produits de volaille Le Gaulois qui sont élaborés à partir des volailles nées, élevées et élaborées en France. Choisir un produit de volaille Le Gaulois, qu’il soit brut ou élaboré*, c’est se garantir d’acheter <b>100 % français de A à Z</b> et de consommer responsable.</p><p>Nous sommes attachés à créer de la valeur en région car le modèle est vertueux et juste&nbsp;:</p><br><ul><li>des territoires dynamiques</li><li>des revenus des éleveurs partenaires sécurisés</li><li>des emplois locaux</li><li>des savoir-faire ancrés</li><li>la qualité française défendue</li></ul><p><small style="color:gray;">*A l’exception des gésiers de canard</small></p>'
],
'side' => [
'value' => false
],
'link' => [
'status' => true,
'value' => route('brand.french-poultry')
],
'labels' => [
'value' => [
array_merge(Engagement::getLabel(), [
'bigText' => '2000',
'text' => 'éleveurs partenaires sur l’ensemble de la France'
]),
array_merge(Engagement::getLabel(), [
'bigText' => 'Près de 4000',
'text' => 'collaborateurs travaillent pour la marque à travers nos 10 sites régionaux'
])
]
]
]
]
),
array_replace_recursive(
Engagement::getBlocks()[EngagementBlocType::bloc5()->value],
[
'type' => EngagementBlocType::bloc5(),
'content' => [
'titlePicto' => [
'value' => new SplFileInfo(resource_path('assets/images/onsengage/svgs/engagement1/engagement_1_origine-france.svg'))
],
'mobileVisible' => [
'value' => true
],
'images' => [
'value' => [
new SplFileInfo(resource_path('assets/images/onsengage/svgs/engagement1/engagement_1_volailles-france.svg')),
new SplFileInfo(resource_path('assets/images/onsengage/svgs/engagement1/engagement_1_1ere-marque.svg')),
new SplFileInfo(resource_path('assets/images/onsengage/svgs/engagement1/engagement_1_100-francais.svg')),
new SplFileInfo(resource_path('assets/images/onsengage/svgs/engagement1/engagement_1_100-present.svg'))
]
]
]
]
),
array_replace_recursive(
Engagement::getBlocks()[EngagementBlocType::bloc2()->value],
[
'type' => EngagementBlocType::bloc2(),
'content' => [
'img' => [
'alt' => 'Partenaire solidaire',
'value' => '/assets/images/onsengage/images/engagement1/le-gaulois-engagement_384x260_Partenaire-Solidaire.jpg'
],
'content' => [
'value' => '<h3>Solidarité et défense de l’emploi.<br>Le Gaulois, Partenaire Solidaire de nos Régions&nbsp;:<br>une nouvelle gamme engagée</h3><ul><li>200 kms de distance au maximum entre les élevages et les sites de production</li><li>+ de 16 000 emplois soutenus en région</li><li>Les revenus de nos éleveurs partenaires protégés</li></ul>'
],
'link' => [
'status' => true,
'value' => ''
]
]
]
),
],
'status' => true
]
);
$engagement1->type = EngagementType::article();
$engagement1->saveOrFail();
$engagement2 = new Engagement(
[
'icon' => '/assets/images/onsengage/svgs/engagement3/GAULOIS_engagement-3.svg',
'pretitle' => 'Engagement n°2',
'metaTitle' => 'Le Gaulois - Respecter les hommes, les animaux et la nature',
'metaDescription' => 'Le Gaulois travaille avec ses éleveurs partenaires pour préserver la santé et assurer le bien-être des volailles tout en préservant l\'environnement',
'title' => 'Élever durablement, en respectant les hommes, les animaux et la nature',
'content' => [
array_replace_recursive(
Engagement::getBlocks()[EngagementBlocType::bloc1()->value],
[
'type' => EngagementBlocType::bloc1(),
'content' => [
'img' => [
'alt' => 'Nature éleveur',
'value' => '/assets/images/onsengage/images/engagement3/le-gaulois-engagement_792x555_Nature-eleveurs.jpg'
],
'title' => [
'value' => 'Nature d’éleveurs&nbsp;:<br>une démarche éthique et durable'
],
'content' => [
'value' => '<p>Le Gaulois a mis en place un contrat d’engagement avec ses éleveurs partenaires qui les engagent à préserver la santé et assurer le bien-être des volailles tout au long de leur vie.<br>Ce contrat d’engagement stipule en particulier que les volailles nées en France sont élevées dans des conditions qui favorisent l’expression des comportements naturels. Ainsi, les volailles sont élevées à la lumière naturelle (présence de fenêtres dans les poulaillers) et disposent de pierre à picorer, de perchoirs et de ballots de paille.</p>'
],
'side' => [
'value' => false
],
'link' => [
'status' => true,
'value' => route('products.meat-type', ['slugMeatType' => 'le-cru'])
],
'labels' => [
'value' => [
array_merge(Engagement::getLabel(), [
'bigText' => '100% Des éleveurs partenaires Le Gaulois',
'text' => 'engagés dans la démarche d’ici 2025'
])
]
]
]
]
),
array_replace_recursive(
Engagement::getBlocks()[EngagementBlocType::bloc5()->value],
[
'type' => EngagementBlocType::bloc5(),
'content' => [
'mobileVisible' => [
'value' => true
],
'images' => [
'value' => [
'/assets/images/onsengage/svgs/engagement3/engagement_3_lumiere-naturelle.svg',
'/assets/images/onsengage/svgs/engagement3/engagement_3_cereales-francaises.svg',
'/assets/images/onsengage/svgs/engagement3/engagement_3_paille.svg',
'/assets/images/onsengage/svgs/engagement3/engagement_3_perchoirs.svg',
'/assets/images/onsengage/svgs/engagement3/engagement_3_litiere.svg'
]
]
]
]
),
array_replace_recursive(
Engagement::getBlocks()[EngagementBlocType::bloc1()->value],
[
'type' => EngagementBlocType::bloc1(),
'content' => [
'img' => [
'alt' => 'Oui c\'est bon',
'value' => '/assets/images/onsengage/images/engagement3/le-gaulois-engagement_792x555_Oui-cest-bon.jpg'
],
'title' => [
'value' => 'Oui c’est bon&nbsp;: oui à d’avantage d’engagement'
],
'content' => [
'value' => '<p>Le Gaulois déploie vigoureusement sa démarche « Oui c’est bon », et garantit des produits de qualité à prix accessible afin de prendre, encore davantage en compte, le bien-être animal, la santé des volailles et la préservation de l’environnement. La démarche « Oui c’est bon » est basée sur la démarche Nature d’Eleveurs à laquelle s’ajoutent encore plus de dispositifs qualitatifs.</p>'
],
'side' => [
'value' => true
],
'link' => [
'text' => 'Oui c’est bon : En savoir +',
'status' => true,
'value' => ''
]
]
]
),
array_replace_recursive(
Engagement::getBlocks()[EngagementBlocType::bloc5()->value],
[
'type' => EngagementBlocType::bloc5(),
'content' => [
'mobileVisible' => [
'value' => true
],
'images' => [
'value' => [
'/assets/images/onsengage/svgs/engagement3/engagement_3_alimentation-sans-OGM.svg',
'/assets/images/onsengage/svgs/engagement3/engagement_3_espace.svg',
'/assets/images/onsengage/svgs/engagement3/engagement_3_musical.svg',
'/assets/images/onsengage/svgs/engagement3/engagement_3_basse-consommation.svg',
'/assets/images/onsengage/svgs/engagement3/engagement_3_plantation.svg'
]
]
]
]
),
array_replace_recursive(
Engagement::getBlocks()[EngagementBlocType::bloc2()->value],
[
'type' => EngagementBlocType::bloc2(),
'content' => [
'img' => [
'alt' => 'Base conso',
'value' => '/assets/images/onsengage/images/engagement3/le-gaulois-engagement_384x260_Basse-conso.jpg'
],
'content' => [
'value' => '<h3>Des poulaillers basse-consommation&nbsp;:<br>c’est bon aussi pour la nature</h3><p>En plus des aménagements dans les poulaillers pour le bien-être animal, Le Gaulois, à travers sa démarche « Oui C’est Bon », encourage le développement de poulaillers basse consommation avec par exemple l’installation de panneaux photovoltaïques et de récupérateurs de chaleur.</p><br><h3>Des haies pour favoriser la biodiversité</h3><p>Le Gaulois encourage vivement la plantation de haies dans ses élevages. En effet, elles permettent d’abriter et de faire vivre une faune diversifiée , en particulier des insectes et petits oiseaux. Elles renforcent ainsi la biodiversité tout en embellissant les paysages.</p>'
],
'link' => [
'status' => true,
'newtab' => true,
'value' => ''
]
]
]
),
array_replace_recursive(
Engagement::getBlocks()[EngagementBlocType::bloc4()->value],
[
'type' => EngagementBlocType::bloc4(),
'content' => [
'img' => [
'alt' => 'Sante volaille',
'value' => '/assets/images/onsengage/images/engagement3/le-gaulois-engagement_792x792_Sante-volailles.jpg'
],
'title' => [
'value' => 'La santé de nos volailles&nbsp;:<br>on en prend le plus grand soin'
],
'content' => [
'value' => '<p>Le Gaulois est engagé dans une démarche volontariste et continue afin de mieux protéger la santé des volailles. Les antibiotiques ne sont utilisés qu’en dernier recours et uniquement sur prescription vétérinaire, en respectant des délais garantissant la sécurité sanitaire des consommateurs.</p>'
],
'side' => [
'value' => true
],
'link' => [
'status' => true,
'newtab' => true,
'value' => '',
'text' => 'Antibiotiques critiques : En savoir +'
]
]
]
),
array_replace_recursive(
Engagement::getBlocks()[EngagementBlocType::bloc5()->value],
[
'type' => EngagementBlocType::bloc5(),
'content' => [
'titlePicto' => [
'value' => '/assets/images/onsengage/svgs/engagement3/engagement_3_stop.svg'
],
'mobileVisible' => [
'value' => true
],
'images' => [
'value' => [
'/assets/images/onsengage/svgs/engagement3/engagement_3_antibiotique.svg',
'/assets/images/onsengage/svgs/engagement3/engagement_3_alimentation-sans-antibiotique-hormone.svg',
'/assets/images/onsengage/svgs/engagement3/engagement_3_zero-antibiotique.svg',
'/assets/images/onsengage/svgs/engagement3/engagement_3_poules.svg'
]
]
]
]
),
array_replace_recursive(
Engagement::getBlocks()[EngagementBlocType::bloc5()->value],
[
'type' => EngagementBlocType::bloc5(),
'content' => [
'titlePicto' => [
'value' => '/assets/images/onsengage/svgs/engagement3/engagement_3_nature-fait-bien.svg'
],
'mobileVisible' => [
'value' => true
],
'images' => [
'value' => [
'/assets/images/onsengage/svgs/engagement3/engagement_3_extaits-vegetaux.svg',
'/assets/images/onsengage/svgs/engagement3/engagement_3_chataignier.svg',
'/assets/images/onsengage/svgs/engagement3/engagement_3_algues.svg',
'/assets/images/onsengage/svgs/engagement3/engagement_3_probiotiques.svg'
]
]
]
]
),
array_replace_recursive(
Engagement::getBlocks()[EngagementBlocType::bloc3()->value],
[
'type' => EngagementBlocType::bloc3(),
'content' => [
'img' => [
'alt' => 'Oeuf',
'value' => '/assets/images/onsengage/images/engagement3/le-gaulois-engagement_486x682_Oeuf.jpg'
],
'title' => [
'value' => 'Poules pondeuses&nbsp;:<br>quand les poules ont bonne mine, les œufs sont bons'
],
'content' => [
'value' => '<p>Dans son activité de production d’œufs, Le Gaulois favorise le bien-être de ses poules pondeuses avec un environnement qualitatif et des élevages au sol, en plein-air ou biologique&nbsp;:</p><br><ul><li>100 % engagé pour le bien-être des poules pondeuses depuis 2015</li><li>0 % d’œufs issus de la filière en cage</li><li>100% des œufs issus de la filière Bio, plein air ou jardin d’hiver</li></ul><br><a href="#" title="pas renseigné">Savez-vous ce que deviennent les frères des poules chez Le Gaulois ?</a>'
],
'side' => [
'value' => true
],
'link' => [
'value' => ''
]
]
]
)
],
'status' => true
]
);
$engagement2->type = EngagementType::article();
$engagement2->saveOrFail();
$engagement3 = new Engagement(
[
'icon' => '/assets/images/onsengage/svgs/engagement2/GAULOIS_engagement-2.svg',
'pretitle' => 'Engagement n°3',
'metaTitle' => 'Le Gaulois - Bien nourrir les français',
'metaDescription' => 'Le Gaulois s\'engage à optimiser la qualité nutritionnelle de ses produits pour avoir des recettes plus saines et toujours aussi gourmandes',
'title' => 'Bien nourrir tous les français',
'content' => [
array_replace_recursive(
Engagement::getBlocks()[EngagementBlocType::bloc1()->value],
[
'type' => EngagementBlocType::bloc1(),
'content' => [
'img' => [
'alt' => 'Recette',
'value' => '/assets/images/onsengage/images/engagement2/le-gaulois-engagement_792x555_Recette.jpg'
],
'title' => [
'value' => 'La santé fait recette'
],
'content' => [
'value' => '<p>Tout autant que la sécurité alimentaire, la qualité nutritionnelle est une priorité chez Le Gaulois.<br>Nous nous engageons à optimiser la qualité nutritionnelle de nos recettes à travers une charte nutritionnelle afin de réduire la teneur en sel et en matières grasses saturées de nos produits.</p><br><p>Allier plaisir gustatif et équilibre nutritionnel est, nous le savons, notre challenge quotidien, afin de satisfaire durablement nos consommateurs. Les nombreux atouts diététiques de la viande de volaille et des oeufs, recommandés par le PNNS Manger Bouger (programme national de nutrition santé) y contribuent pour partie. Notre nouvelle charte nutritionnelle nous permet de progresser d’avantage, en particulier sur les produits élaborés.</p><br><p>Pour informer en toute transparence le consommateur sur les qualités nutritionnelles de nos produits, nous nous sommes engagés auprès de Santé Publique à afficher dès avril 2019 la démarche d’étiquetage nutritionnelle Nutriscore.</p>'
],
'side' => [
'value' => true
],
'link' => [
'status' => true,
'value' => route('kitchen-side.health-nutrition.nutrition')
],
'labels' => [
'value' => [
array_merge(Engagement::getLabel(), [
'bigText' => '71%',
'text' => 'de nos produits classés A ou B au Nutriscore en 2021'
]),
array_merge(Engagement::getLabel(), [
'bigText' => '80%',
'text' => 'de nos produits seront classés A et B au Nutriscore en 2025 (objectif fixé)'
])
]
]
]
]
),
array_replace_recursive(
Engagement::getBlocks()[EngagementBlocType::bloc5()->value],
[
'type' => EngagementBlocType::bloc5(),
'content' => [
'titlePicto' => [
'value' => '/assets/images/onsengage/svgs/engagement2/engagement_2_recettes-saines.svg'
],
'mobileVisible' => [
'value' => true
],
'images' => [
'value' => [
'/assets/images/onsengage/svgs/engagement2/engagement_2_reduire.svg',
'/assets/images/onsengage/svgs/engagement2/engagement_2_limiter-sel.svg',
'/assets/images/onsengage/svgs/engagement2/engagement_2_privilegier.svg',
'/assets/images/onsengage/svgs/engagement2/engagement_2_optimiser-ingredients.svg'
]
]
]
]
),
array_replace_recursive(
Engagement::getBlocks()[EngagementBlocType::bloc2()->value],
[
'type' => EngagementBlocType::bloc2(),
'content' => [
'img' => [
'alt' => 'Additifs',
'value' => '/assets/images/onsengage/images/engagement2/le-gaulois-engagement_384x260_Additifs.jpg'
],
'content' => [
'value' => '<h3>Moins c’est mieux ! <br>169 additifs bannis chez Le Gaulois</h3><p>Accompagnés par un médecin nutritionniste expert en toxicologie, nous avons dressé une liste de 169 additifs (parmi les 300 autorisés au niveau européen) que nous avons choisis de ne plus ou pas utiliser. Ainsi, tous les nouveaux produits Le Gaulois sont développés en tenant compte de ces nouvelles exigences. Les produits existants sont, quant à eux, retravaillés pour supprimer ces additifs.</p>'
],
'link' => [
'status' => true,
'newtab' => true,
'value' => ''
]
]
]
),
array_replace_recursive(
Engagement::getBlocks()[EngagementBlocType::bloc3()->value],
[
'type' => EngagementBlocType::bloc3(),
'content' => [
'img' => [
'alt' => 'Programme malin',
'value' => '/assets/images/onsengage/images/engagement2/le-gaulois-engagement_486x682_Programme-MALIN.jpg'
],
'title' => [
'value' => 'Accompagner les familles à mieux manger'
],
'content' => [
'value' => '<h6>Les enfants d’abord</h6><p>Partenaire du programme MALIN, Le Gaulois s’engage à promouvoir le bien manger auprès des familles via les caisses d’allocation familiales (Caf). Bien manger dès le plus jeune âge est essentiel. Les familles en situation de grossesse ou avec des enfants de 5 mois sont concernées et bénéficient d’un programme de pédagogie, de conseils et de recettes pour les sensibiliser à l’équilibre alimentaire.</p><br><h6>Des coups de pouce budgétaires</h6><p>Par le biais de bons de réduction à valoir sur les découpes crues Le Gaulois, les familles sous tension financière avec des enfants entre 16 et 24 mois sont soutenues.</p>'
],
'side' => [
'value' => true
],
'link' => [
'status' => true,
'newtab' => true,
'value' => ''
],
'labels' => [
'value' => [
array_merge(Engagement::getLabel(), [
'fullLine' => true,
'bigText' => 'Grâce à Le Gaulois',
'text' => ''
]),
array_merge(Engagement::getLabel(), [
'bigText' => '750 000 familles',
'text' => 'aidées à mieux manger en 2021'
]),
array_merge(Engagement::getLabel(), [
'bigText' => '2 Fois +',
'text' => 'de familles seront aidées à mieux manger en <b>2022</b> (objectif fixé)'
])
]
]
]
]
),
],
'status' => true
]
);
$engagement3->type = EngagementType::article();
$engagement3->saveOrFail();
$engagement4 = new Engagement(
[
'icon' => '/assets/images/onsengage/svgs/engagement5/GAULOIS_engagement-5.svg',
'pretitle' => 'Engagement n°4',
'title' => 'Favoriser le mieux vivre ensemble',
'metaTitle' => 'Le Gaulois - Favoriser le mieux vivre ensemble ',
'metaDescription' => 'Le Gaulois promeut le bien-être autour du sport en soutenant des associations sportives ou de santé publique pour encourager le mieux-vivre ensemble',
'content' => [
array_replace_recursive(
Engagement::getBlocks()[EngagementBlocType::bloc1()->value],
[
'type' => EngagementBlocType::bloc1(),
'content' => [
'img' => [
'alt' => 'Sport',
'value' => '/assets/images/onsengage/images/engagement5/le-gaulois-engagement_792x555_Sport.jpg'
],
'title' => [
'value' => 'C’est bon d’être sportif'
],
'content' => [
'value' => '<p>Populaire, convivial, bénéfique et utile, le sport incarne parfaitement les valeurs de la marque. C’est pourquoi Le Gaulois promeut le « bien-être » autour du sport pour tous en soutenant les associations sportives locales.</p>'
],
'side' => [
'value' => true
],
'link' => [
'status' => true,
'value' => route('kitchen-side.health-nutrition.nutrition')
],
'labels' => [
'value' => [
array_merge(Engagement::getLabel(), [
'bigText' => '+ de 30 associations Sportives',
'text' => 'locales soutenues'
])
]
]
]
]
),
array_replace_recursive(
Engagement::getBlocks()[EngagementBlocType::bloc5()->value],
[
'type' => EngagementBlocType::bloc5(),
'content' => [
'mobileVisible' => [
'value' => true
],
'images' => [
'value' => [
'/assets/images/onsengage/svgs/engagement5/engagement_5_handball.svg',
'/assets/images/onsengage/svgs/engagement5/engagement_5_football.svg',
'/assets/images/onsengage/svgs/engagement5/engagement_5_rugby.svg',
'/assets/images/onsengage/svgs/engagement5/engagement_5_course-a-pieds.svg',
'/assets/images/onsengage/svgs/engagement5/engagement_5_tennis-de-table.svg'
]
]
]
]
),
array_replace_recursive(
Engagement::getBlocks()[EngagementBlocType::bloc2()->value],
[
'type' => EngagementBlocType::bloc2(),
'content' => [
'img' => [
'alt' => 'Tour de france',
'value' => '/assets/images/onsengage/images/engagement5/le-gaulois-engagement_384x260_Tour-de-France.jpg'
],
'content' => [
'value' => '<h3>Le Gaulois, sponsor de l’événement mondial qui valorise la France et ses régions : Le Tour de France</h3><p>Volaille officielle du Tour de France depuis 2012, Le Gaulois est fier de s’associer à ce grand rendez-vous populaire et gratuit au service du sport qui participe à la promotion des territoires.</p>'
],
'link' => [
'status' => false
]
]
]
),
array_replace_recursive(
Engagement::getBlocks()[EngagementBlocType::bloc3()->value],
[
'type' => EngagementBlocType::bloc3(),
'content' => [
'img' => [
'alt' => 'Mecenat',
'value' => '/assets/images/onsengage/images/engagement5/le-gaulois-engagement_486x682_Mecenat.jpg'
],
'title' => [
'value' => '2021, nos collaborateurs ont du cœur'
],
'content' => [
'value' => '<p>Chaque année, Le Gaulois s’investit dans une cause forte d’intérêt général avec ses collaborateurs, en organisant un grand challenge sportif et solidaire. En 2021, l’entreprise soutient l’association <b>Mécénat de chirurgie cardiaque</b> pour financer 1 opération d’enfant atteint de malformation cardiaque. Course à pied, vélo, marche, randonnée, les kilomètres parcourus par les collaborateurs sont compilés par une application sportive tout au long de l’année et se transforment en dons dans la cagnotte de l’association. Une belle façon de bouger, de prendre soin de soi et de penser aux autres.</p>'
],
'side' => [
'value' => false
],
'link' => [
'status' => false,
],
'labels' => [
'value' => [
array_merge(Engagement::getLabel(), [
'bigText' => '12 centimes /Km',
'text' => 'versés par l’entreprise pour chaque km parcouru à pied par ses collaborateurs'
]),
]
]
]
]
),
],
'status' => true
]
);
$engagement4->type = EngagementType::article();
$engagement4->saveOrFail();
$engagement5 = new Engagement(
[
'icon' => '/assets/images/onsengage/svgs/engagement4/GAULOIS_engagement-4.svg',
'pretitle' => 'Engagement n°5',
'title' => 'Respecter la terre',
'metaTitle' => 'Le Gaulois - S\'engager envers la préservation de la terre',
'metaDescription' => 'Le Gaulois travaille à la réduction de son empreinte carbone en optimisant le transport de ses produits et des volailles, son mode de production et ses emballages',
'content' => [
array_replace_recursive(
Engagement::getBlocks()[EngagementBlocType::bloc4()->value],
[
'type' => EngagementBlocType::bloc4(),
'content' => [
'img' => [
'alt' => 'Empreinte carbone',
'value' => '/assets/images/onsengage/images/engagement4/le-gaulois-engagement_792x792_Empreinte-carbone.jpg'
],
'title' => [
'value' => 'Priorité à la réduction de notre empreinte carbone'
],
'content' => [
'value' => '<p>Chaque action compte dans la lutte contre l’effet de serre qui déstabilise les équilibres sur terre et la biodiversité. Ainsi, Le Gaulois met en en place des actions concrètes face au réchauffement climatique.</p>'
],
'side' => [
'value' => true
]
]
]
),
array_replace_recursive(
Engagement::getBlocks()[EngagementBlocType::bloc5()->value],
[
'type' => EngagementBlocType::bloc5(),
'content' => [
'titlePicto' => [
'value' => '/assets/images/onsengage/svgs/engagement4/engagement_4_reduction-empreinte-carbone.svg'
],
'mobileVisible' => [
'value' => true
],
'images' => [
'value' => [
'/assets/images/onsengage/svgs/engagement4/engagement_4_reduction-distances.svg',
'/assets/images/onsengage/svgs/engagement4/engagement_4_amelioration-flotte.svg',
'/assets/images/onsengage/svgs/engagement4/engagement_4_boucles-transports.svg',
'/assets/images/onsengage/svgs/engagement4/engagement_4_colisage.svg',
'/assets/images/onsengage/svgs/engagement4/engagement_4_fournisseurs-locaux.svg',
'/assets/images/onsengage/svgs/engagement4/engagement_4_basse-consommation.svg'
]
]
]
]
),
array_replace_recursive(
Engagement::getBlocks()[EngagementBlocType::bloc2()->value],
[
'type' => EngagementBlocType::bloc2(),
'content' => [
'img' => [
'alt' => 'Soja responsable',
'value' => '/assets/images/onsengage/images/engagement4/le-gaulois-engagement_384x260_Soja-responsable.jpg'
],
'content' => [
'value' => '<h3>Stop à la déforestation, halte au soja non responsable</h3><p>Chez Le Gaulois, pour assurer l’apport protéique de nos volailles, nous leur donnons des matières riches en protéines telles que le soja. Le soja est un composant essentiel à l’équilibre nutritionnel de la volaille. C’est la légumineuse la plus riche en protéines et en acides aminés essentiels ! Chez Le Gaulois, nous sommes conscients que la culture du Soja importée est assujettie à de nombreux questionnements notamment son impact sur la déforestation. Notre engagement : 100% de soja garanti zéro déforestation / conversion au plus tard d’ici 2025.</p>'
],
'link' => [
'status' => true,
]
]
]
),
array_replace_recursive(
Engagement::getBlocks()[EngagementBlocType::bloc4()->value],
[
'type' => EngagementBlocType::bloc4(),
'content' => [
'img' => [
'alt' => 'Emballage',
'value' => '/assets/images/onsengage/images/engagement4/le-gaulois-engagement_792x792_Emballages.jpg'
],
'title' => [
'value' => 'Réduire l’impact de nos emballages sur l’environnement'
],
'content' => [
'value' => '<p>Conscient de son rôle, Le Gaulois s ‘est engagé dans une démarche continue de réduction de ses emballages et d’amélioration de leur recyclabilité, tout en garantissant la sécurité alimentaire.</p>'
],
'side' => [
'value' => false
],
'link' => [
'status' => false
]
]
]
),
array_replace_recursive(
Engagement::getBlocks()[EngagementBlocType::bloc5()->value],
[
'type' => EngagementBlocType::bloc5(),
'content' => [
'titlePicto' => [
'value' => '/assets/images/onsengage/svgs/engagement4/engagement_4_packaging-responsables.svg'
],
'mobileVisible' => [
'value' => true
],
'images' => [
'value' => [
'/assets/images/onsengage/svgs/engagement4/engagement_4_reduction.svg',
'/assets/images/onsengage/svgs/engagement4/engagement_4_emballages-recycles-certifies.svg',
'/assets/images/onsengage/svgs/engagement4/engagement_4_moins-plastique.svg',
'/assets/images/onsengage/svgs/engagement4/engagement_4_recyclabilite.svg',
]
]
]
]
),
array_replace_recursive(
Engagement::getBlocks()[EngagementBlocType::bloc2()->value],
[
'type' => EngagementBlocType::bloc2(),
'content' => [
'img' => [
'alt' => 'Polystyrene',
'value' => '/assets/images/onsengage/images/engagement4/le-gaulois-engagement_384x260_Polystyrene.jpg'
],
'content' => [
'value' => '<h3>Le savez-vous ?</h3><p>Le plastique employé par Le Gaulois pour ses barquettes est du polystyrène expansé : un matériau très léger qui utilise 2,5 fois moins de plastique qu’une barquette classique.</p><br><p>Près de 70 % de nos barquettes bénéficient de ce matériau.</p>'
],
'link' => [
'status' => false
]
]
]
),
],
'status' => true
]
);
$engagement5->type = EngagementType::article();
$engagement5->saveOrFail();
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('engagements');
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 40 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 126 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 40 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 36 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 83 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 41 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 37 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 76 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 73 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 100 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 67 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 22 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 28 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 78 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 241 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 22 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 52 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 80 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 45 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 64 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 29 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 149 KiB

File diff suppressed because one or more lines are too long

After

Width:  |  Height:  |  Size: 51 KiB

File diff suppressed because one or more lines are too long

After

Width:  |  Height:  |  Size: 510 KiB

File diff suppressed because one or more lines are too long

After

Width:  |  Height:  |  Size: 373 KiB

File diff suppressed because one or more lines are too long

After

Width:  |  Height:  |  Size: 343 KiB

File diff suppressed because one or more lines are too long

After

Width:  |  Height:  |  Size: 596 KiB

File diff suppressed because one or more lines are too long

After

Width:  |  Height:  |  Size: 974 KiB

File diff suppressed because one or more lines are too long

After

Width:  |  Height:  |  Size: 529 KiB

File diff suppressed because one or more lines are too long

After

Width:  |  Height:  |  Size: 50 KiB

File diff suppressed because one or more lines are too long

After

Width:  |  Height:  |  Size: 139 KiB

File diff suppressed because one or more lines are too long

After

Width:  |  Height:  |  Size: 212 KiB

File diff suppressed because one or more lines are too long

After

Width:  |  Height:  |  Size: 196 KiB

File diff suppressed because one or more lines are too long

After

Width:  |  Height:  |  Size: 791 KiB

File diff suppressed because one or more lines are too long

After

Width:  |  Height:  |  Size: 152 KiB

File diff suppressed because one or more lines are too long

After

Width:  |  Height:  |  Size: 52 KiB

File diff suppressed because one or more lines are too long

After

Width:  |  Height:  |  Size: 260 KiB

File diff suppressed because one or more lines are too long

After

Width:  |  Height:  |  Size: 444 KiB

File diff suppressed because one or more lines are too long

After

Width:  |  Height:  |  Size: 730 KiB

File diff suppressed because one or more lines are too long

After

Width:  |  Height:  |  Size: 832 KiB

File diff suppressed because one or more lines are too long

After

Width:  |  Height:  |  Size: 540 KiB

File diff suppressed because one or more lines are too long

After

Width:  |  Height:  |  Size: 645 KiB

File diff suppressed because one or more lines are too long

After

Width:  |  Height:  |  Size: 396 KiB

File diff suppressed because one or more lines are too long

After

Width:  |  Height:  |  Size: 405 KiB

File diff suppressed because one or more lines are too long

After

Width:  |  Height:  |  Size: 285 KiB

File diff suppressed because one or more lines are too long

After

Width:  |  Height:  |  Size: 288 KiB

File diff suppressed because one or more lines are too long

After

Width:  |  Height:  |  Size: 316 KiB

File diff suppressed because one or more lines are too long

After

Width:  |  Height:  |  Size: 473 KiB

File diff suppressed because one or more lines are too long

After

Width:  |  Height:  |  Size: 1.7 MiB

File diff suppressed because one or more lines are too long

After

Width:  |  Height:  |  Size: 259 KiB

File diff suppressed because one or more lines are too long

After

Width:  |  Height:  |  Size: 177 KiB

File diff suppressed because one or more lines are too long

After

Width:  |  Height:  |  Size: 743 KiB

File diff suppressed because one or more lines are too long

After

Width:  |  Height:  |  Size: 410 KiB

File diff suppressed because one or more lines are too long

After

Width:  |  Height:  |  Size: 218 KiB

File diff suppressed because one or more lines are too long

After

Width:  |  Height:  |  Size: 1.5 MiB

File diff suppressed because one or more lines are too long

After

Width:  |  Height:  |  Size: 526 KiB

File diff suppressed because one or more lines are too long

After

Width:  |  Height:  |  Size: 52 KiB

File diff suppressed because one or more lines are too long

After

Width:  |  Height:  |  Size: 728 KiB

File diff suppressed because one or more lines are too long

After

Width:  |  Height:  |  Size: 667 KiB

File diff suppressed because one or more lines are too long

After

Width:  |  Height:  |  Size: 814 KiB

File diff suppressed because one or more lines are too long

After

Width:  |  Height:  |  Size: 485 KiB

File diff suppressed because one or more lines are too long

After

Width:  |  Height:  |  Size: 584 KiB

File diff suppressed because one or more lines are too long

After

Width:  |  Height:  |  Size: 332 KiB

File diff suppressed because one or more lines are too long

After

Width:  |  Height:  |  Size: 434 KiB

File diff suppressed because one or more lines are too long

After

Width:  |  Height:  |  Size: 1.2 MiB

File diff suppressed because one or more lines are too long

After

Width:  |  Height:  |  Size: 644 KiB

File diff suppressed because one or more lines are too long

After

Width:  |  Height:  |  Size: 575 KiB

File diff suppressed because one or more lines are too long

After

Width:  |  Height:  |  Size: 1.1 MiB

File diff suppressed because one or more lines are too long

After

Width:  |  Height:  |  Size: 223 KiB

File diff suppressed because one or more lines are too long

After

Width:  |  Height:  |  Size: 50 KiB

File diff suppressed because one or more lines are too long

After

Width:  |  Height:  |  Size: 256 KiB

File diff suppressed because one or more lines are too long

After

Width:  |  Height:  |  Size: 144 KiB

File diff suppressed because one or more lines are too long

After

Width:  |  Height:  |  Size: 174 KiB

File diff suppressed because one or more lines are too long

After

Width:  |  Height:  |  Size: 108 KiB

File diff suppressed because one or more lines are too long

After

Width:  |  Height:  |  Size: 264 KiB

View file

@ -63,6 +63,12 @@ $vegetalBodyBG: #8dd175;
$vegetalTitle: #64ab4b;
$pmuColor: #003b22;
// on s'engage
$engagementDarkerGreen: #082014;
$engagementDarkGreen: #006633;
$engagementLightGreen: #8AC51D;
$engagementMajorBreakPoint: $big_screen + 30px;
// Body
$body-bg: $color1;

View file

@ -921,6 +921,43 @@
}
}
.sub_header_onsengage {
background-image: url("~@/images/onsengage/onsengage_banner.jpg");
width: 100%;
height: 44em;
background-size: cover;
background-position: center center;
overflow: visible;
&:after {
content: "";
background-image: inherit;
background-repeat: no-repeat;
height: inherit;
width: inherit;
position: inherit;
}
& .logo {
position: absolute;
left: 50%;
top: 0;
transform: translateX(-50%);
margin: 8rem 0 0;
font-size: 1.2em;
}
// @include max-width($tablet + 60px) {
// height: 34em;
// & .title {
// font-size: 1em;
// }
// }
// @include max-width($tablet - 80px) {
// height: 28em;
// }
}
.sub_header_joinus {
background-image: url("~@/images/joinus/nr_banner.jpg");
width: 100%;

View file

@ -0,0 +1,127 @@
.content.onsengage {
.bloc1 {
display: flex;
flex-direction: row-reverse;
align-items: flex-start;
& > img {
position: absolute;
left: 0;
object-fit: contain;
width: 50%;
}
&.right {
flex-direction: row;
& > img {
position: absolute;
right: 0;
left:inherit;
}
& > .content {
position: relative;
right: inherit;
}
}
& > .content {
position: relative;
right: 0;
min-width: 46.132rem;
margin-top: 16rem;
background-color: #FFF;
padding: 3.466rem;
width: 55%;
& > .title {
font-family: 'Veneer';
font-size: 3.334rem;
color: $engagementDarkGreen;
}
& > .text {
padding-top: 1.6rem;
padding-bottom: 4.266rem;
font-family: 'Catamaran';
font-size: 1.6rem;
}
& > .link {
padding-top: 1.6rem;
padding-bottom: 4.266rem;
position: relative;
& > a {
background-color: $engagementDarkGreen;
color: #FFF;
display: inline-block;
min-height: 2.867rem;
font-family: 'Catamaran';
font-size: 1.066rem;
font-weight: bold;
padding: 0.6rem 1rem;
border-radius: 2rem;
text-transform: uppercase;
}
&::after {
position: absolute;
bottom: 0;
content: " ";
display: block;
height: 0.2rem;
width: 4.266rem;
background-color: $engagementLightGreen;
}
&.noborder::after {
display: none;;
}
}
& > .labels {
padding-top: 4.266rem;
display: flex;
flex-direction: row;
justify-content: space-between;
& > p {
color: $engagementDarkGreen;
width: 49%;
&.w-100 {
width: 100%;
}
& > span {
display: block;
}
& > span.bigText {
font-family: 'Veneer';
font-size: 2.8rem;
line-height: 2.8rem;
}
& > span.text {
font-family: 'Catamaran';
font-size: 1.2rem;
line-height: 1.2rem;
}
}
}
}
}
@include max-width($engagementMajorBreakPoint) {
.bloc1, & .bloc1.right {
flex-direction: column;
& > img {
position: relative;
right: inherit;
left: 50%;
transform: translateX(-50%);
width: 100%;
max-width: 792px;
}
& > .content {
position: relative;
right: inherit;
left: 50%;
margin-top: -2.6rem;
transform: translateX(-50%);
min-width: inherit;
max-width: 46.132rem;
width: calc(100vw - 1.334rem);
border-radius: 0.6rem;
@include max-width($mobile) {
padding: 2.466rem;
}
}
}
}
}

View file

@ -0,0 +1,60 @@
.content.onsengage {
.bloc2 {
background-color: $engagementLightGreen;
& > div {
display: flex;
flex-direction: row;
padding: 3.2rem 6.8rem 2.67rem 6.8rem;
@include max-width($desktop) {
padding: 3.2rem 1.1rem 2.67rem 1.1rem;
}
@include max-width($tablet) {
flex-direction: column;
}
& > img {
object-fit: contain;
max-width: 384px;
@include max-width($tablet) {
position: relative;
transform: translateX(-50%);
margin-bottom: 1.6rem;
left: 50%;
}
}
& > .content {
margin-left: 1.6rem;
font-family: 'Catamaran';
@include max-width($mobile) {
margin-left: 0;
}
& > .text {
& > * {
font-size: 1.2rem;
}
& h3 {
font-family: 'Catamaran';
font-size: 1.6rem;
line-height: 1.6rem;
font-weight: 500;
margin-bottom: 0.533rem;
}
}
& > .link {
margin-top: 1.6rem;
& > a {
background-color: $engagementDarkGreen;
color: #FFF;
display: inline-block;
min-height: 2.867rem;
font-family: 'Catamaran';
font-size: 1.066rem;
font-weight: bold;
padding: 0.6rem 1rem;
border-radius: 2rem;
text-transform: uppercase;
}
}
}
}
}
}

View file

@ -0,0 +1,153 @@
.content.onsengage {
.bloc3 {
position: relative;
display: flex;
flex-direction: row-reverse;
align-items: flex-end;
& > img {
position: absolute;
left: 0;
object-fit: contain;
width: 40%;
z-index: 1;
}
& > .content {
position: relative;
right: 0;
min-width: 46.132rem;
background-color: #FFF;
padding: 3.466rem;
width: 67%;
margin-bottom: 6.934rem;
padding-left: 10%;
& > .title {
font-family: 'Veneer';
font-size: 3.334rem;
color: $engagementDarkGreen;
}
& > .text {
padding-top: 1.6rem;
padding-bottom: 4.266rem;
font-family: 'Catamaran';
font-size: 1.6rem;
}
& > .link {
padding-top: 1.6rem;
padding-bottom: 4.266rem;
position: relative;
& > a {
background-color: $engagementDarkGreen;
color: #FFF;
display: inline-block;
min-height: 2.867rem;
font-family: 'Catamaran';
font-size: 1.066rem;
font-weight: bold;
padding: 0.6rem 1rem;
border-radius: 2rem;
text-transform: uppercase;
}
&::after {
position: absolute;
bottom: 0;
content: " ";
display: block;
height: 0.2rem;
width: 4.266rem;
background-color: $engagementLightGreen;
}
&.noborder::after {
display: none;;
}
}
& > .labels {
padding-top: 4.266rem;
display: flex;
flex-direction: row;
justify-content: space-between;
flex-wrap: wrap;
& > p {
color: $engagementDarkGreen;
width: 49%;
& > span {
display: block;
}
& > span.bigText {
font-family: 'Veneer';
font-size: 2.8rem;
line-height: 2.8rem;
}
& > span.text {
font-family: 'Catamaran';
font-size: 1.2rem;
line-height: 1.2rem;
}
&.w-100 {
width: 100%;
margin-bottom: 1.6rem;
& > span.bigText {
font-size: 3rem;
line-height: 3rem;
}
& > span.text {
font-size: 1.4rem;
line-height: 1.4rem;
}
}
}
}
}
&.right {
flex-direction: row;
& > img {
position: absolute;
right: 0;
left:inherit;
}
& > .content {
position: relative;
right: inherit;
padding-left: 3.466rem;
padding-right: 10%;
}
}
@include max-width($engagementMajorBreakPoint) {
flex-direction: column-reverse !important;
align-items: flex-start !important;
& > img {
position: relative !important;
right: inherit !important;
width: 100% !important;
max-width: 486px !important;
left: 50% !important;
transform: translateX(-50%) !important;
z-index: 0 !important;
border-radius: 0.6rem !important;
}
& > .content {
max-width: 46.132rem;
min-width: inherit !important;
width: 100%;
left: 50%;
transform: translateX(-50%);
margin: 0;
}
&::after {
content: ' ';
background-color: red;
display: block;
position: absolute;
max-width: 46.132rem;
width: 100%;
height: 100%;
z-index: -28;
left: 0;
left: 50%;
transform: translateX(-50%);
margin-bottom: -1.6rem;
background-color: #FFF;
}
}
}
}

View file

@ -0,0 +1,110 @@
.content.onsengage {
.bloc4 {
position: relative;
display: flex;
flex-direction: row;
align-items: flex-end;
& > img {
object-fit: contain;
width: 67%;
}
& > .content {
position: absolute;
right: 0;
min-width: 40.132rem;
background-color: #FFF;
padding: 3.466rem;
width: 40%;
margin-bottom: 6.934rem;
h1,h2,h3,h4,h5,h6,p {
font-family: 'Catamaran';
}
h6 {
font-size: 1.734rem;
}
p {
// reset font-size
font-size: 1.2rem;
}
& > .title {
font-family: 'Veneer';
font-size: 3.334rem;
color: $engagementDarkGreen;
}
& > .text {
padding-top: 1.6rem;
padding-bottom: 4.266rem;
font-family: 'Catamaran';
font-size: 1.6rem;
}
& > .link {
padding-top: 1.6rem;
position: relative;
& > a {
background-color: $engagementDarkGreen;
color: #FFF;
display: inline-block;
min-height: 2.867rem;
font-family: 'Catamaran';
font-size: 1.066rem;
font-weight: bold;
padding: 0.6rem 1rem;
border-radius: 2rem;
text-transform: uppercase;
}
&::after {
position: absolute;
bottom: 0;
content: " ";
display: block;
height: 0.2rem;
width: 4.266rem;
background-color: $engagementLightGreen;
}
&.noborder::after {
display: none;;
}
}
}
@include max-width($engagementMajorBreakPoint) {
flex-direction: column !important;
align-items: flex-start;
&:before {
position: absolute;
content: " ";
background-image: radial-gradient(rgba(255,255,255,0.15) 20%, transparent 20%), radial-gradient(rgba(255,255,255,0.25) 20%, transparent 20%);
background-color: rgba(0,0,0,0.04);
background-position: 0 0, 50px 50px;
background-size: 100px 100px;
height: 25rem;
width: 100%;
box-shadow: 0 0 0.5rem rgba(0,0,0,0.1) inset;
@include max-width(25rem) {
display: none;
}
}
& > img {
position: relative;
right: inherit;
left: 50%;
transform: translateX(-50%);
width: 100%;
max-width: 25rem;
}
& > .content {
position: relative;
right: inherit !important;
left: 50% !important;
margin-top: -2.6rem;
transform: translateX(-50%);
min-width: inherit;
max-width: 46.132rem;
width: calc(100vw - 1.334rem);
border-radius: 0.6rem;
@include max-width($mobile) {
padding: 2.466rem;
}
}
}
}
}

View file

@ -0,0 +1,176 @@
.content.onsengage {
.bloc5 {
width: 29.8rem;
text-align: center;
& > .titlePicto {
margin-bottom: 1.6rem;
@include max-width($mobile) {
& > img {
object-fit: contain;
width: calc(100% - 0.4rem);
margin: 0 0.2rem;
}
}
}
& > .pictos {
display: grid;
grid-template-columns: repeat(2, 1fr);
& > div {
border-right: 4px dotted $engagementLightGreen;
border-bottom: 4px dotted $engagementLightGreen;
& > img {
margin-top: inherit;
margin-bottom: 2.133rem;
}
&:nth-child(n+3) {
& > img {
margin-top: 2.133rem;
}
}
&:nth-child(2n) {
border-right: inherit;
}
&:nth-child(2n+1):nth-last-child(-n+2),&:nth-child(2n+1):nth-last-child(-n+2) ~ div {
border-bottom: inherit;
& > img {
margin-bottom: inherit;
margin-top: 2.133rem;
}
}
@include max-width($tablet) {
}
}
}
}
// bloc5 down the pages and specific selector for engagement 4
.bloc4:first-child + .bloc5 {
margin-top: 6.4rem;
}
.bloc5:nth-of-type(n+5), .bloc4:first-child + .bloc5 {
width: 100%;
& > .pictos {
grid-template-columns: repeat(4, 1fr);
& > div {
border-right: 4px dotted $engagementLightGreen;
border-bottom: 4px dotted $engagementLightGreen;
& > img {
margin-top: 2.133rem;
margin-bottom: 2.133rem;
}
&:nth-child(1),&:nth-child(2),&:nth-child(3),&:nth-child(4) {
& > img {
margin-top: inherit;
}
}
&:nth-child(2n) {
border-right: 4px dotted $engagementLightGreen;
}
&:nth-child(4n) {
border-right: inherit !important;
}
&:nth-child(4n+1):nth-last-child(-n+4), &:nth-child(4n+1):nth-last-child(-n+4) ~ div {
border-bottom: inherit;
& > img {
margin-bottom: inherit;
margin-top: 2.133rem;
}
}
}
}
@include max-width($tablet) {
& > .pictos {
grid-template-columns: repeat(2, 1fr);
& > div {
border-right: 4px dotted $engagementLightGreen;
border-bottom: 4px dotted $engagementLightGreen;
& > img {
margin-top: 2.133rem;
margin-bottom: 2.133rem;
}
&:nth-child(1),&:nth-child(2) {
& > img {
margin-top: inherit;
}
}
&:nth-child(3),&:nth-child(4) {
& > img {
margin-top: 2.133rem !important;
}
}
&:nth-child(2n) {
border-right: inherit !important;
}
&:nth-child(2n+1):nth-last-child(-n+2), &:nth-child(2n+1):nth-last-child(-n+2) ~ div {
border-bottom: inherit;
& > img {
margin-bottom: inherit;
margin-top: 2.133rem;
}
}
}
}
}
@include max-width($tablet) {
& > .pictos {
grid-template-columns: repeat(1, 1fr);
& > div {
border-right: inherit;
border-bottom: 4px dotted $engagementLightGreen;
& > img {
margin-bottom: 2.133rem;
}
&:nth-child(n+1) {
border-bottom: 4px dotted $engagementLightGreen !important;
& > img {
margin-top: 2.133rem !important;
margin-bottom: 2.133rem !important;
}
}
&:nth-last-child(1) {
border-bottom: inherit !important;
& > img {
margin-bottom: inherit !important;
margin-top: 2.133rem !important;
}
}
}
}
}
}
& .blocs > .bloc5, & .blocs > .bloc5 + .bloc1 + .bloc5 {
@include max-width($engagementMajorBreakPoint) {
position: relative !important;
margin-top: 1.6rem !important;
margin-left: inherit !important;
margin-right: inherit !important;
right: inherit !important;
left: 50% !important;
width: calc(100vw - 1.334rem) !important;
max-width: 65.132rem !important;
transform: translateX(-50%) !important;
}
@include max-width($tablet) {
& > .pictos {
grid-template-columns: repeat(1, 1fr);
& > div {
border-bottom: 4px dotted $engagementLightGreen !important;
border-right: inherit;
& > img {
margin-bottom: 2.133rem !important;
}
&:nth-child(2) > img {
margin-top: 2.133rem;
}
&:nth-last-child(1) {
border-bottom: inherit !important;
& > img {
margin-bottom: inherit !important;
}
}
}
}
}
}
}

View file

@ -0,0 +1,188 @@
.content.onsengage {
padding-top: 6rem;
padding-bottom: 6.467rem;
.bloc1,.bloc2,.bloc3,.bloc4,.bloc5 {
.content {
ul {
list-style-type: inherit;
}
p, ul, br, span, a {
// reset font-size
font-size: 1.2rem;
line-height: normal;
}
h1,h2,h3,h4,h5,h6,p {
font-family: 'Catamaran';
}
h6 {
font-size: 1.734rem;
}
@include max-width($engagementMajorBreakPoint) {
& > .title {
font-size: 2.9rem !important;
}
& > .text {
font-size: 1.5rem !important;
}
& > .labels {
& > p {
& > span.bigText {
font-size: 2.2rem !important;
line-height: 2.2rem !important;
}
}
}
}
}
}
.engagement {
padding-top: 4rem;
}
#onsengageIntro {
display: flex;
flex-direction: column;
align-items: center;
text-align: center;
& > span:first-child {
font-size: 4rem;
font-family: 'Veneer';
color: $engagementDarkGreen;
display: block;
@include max-width($tablet) {
font-size: 3rem;
}
}
& > p {
font-family: 'Catamaran';
max-width: 52.9rem;
font-size: 1.4rem;
margin: 2.67rem 1rem 3.734rem 1rem;
}
}
.titleBadge {
display: flex;
flex-direction: column;
align-items: center;
text-align: center;
& > img {
max-width: 6rem;
}
& > span {
margin-top: 1.6rem;
font-family: 'Veneer';
color: $engagementLightGreen;
font-size: 2.8rem;
@include max-width($tablet) {
font-size: 4.76em;
}
}
& > h1 {
margin-top: 1.6rem;
font-family: 'Veneer';
color: $engagementDarkGreen;
font-size: 5.76em;
padding: 0 1.6rem;
@include max-width($tablet) {
font-size: 4.76em;
}
}
}
.link > a:hover {
background-color: $engagementDarkerGreen;
text-decoration: underline;
cursor: pointer;
}
.blocs {
position: relative;
margin-top: 1.6 * 2rem;
& > div:nth-child(n+3) {
margin-top: 6.4rem;
}
// engagement 3 specific rules
& > .bloc1 + .bloc5 {
margin-left: -2.133rem;
margin-top: 34rem;
position: absolute;
top: 0;
left: 0;
&:nth-child(4) {
top: 50rem;
right: 0;
left: inherit;
}
&:nth-child(n+5) {
position: inherit;
top: inherit;
right: inherit;
left: inherit;
}
}
& > .bloc1.right + .bloc5 {
margin-left: inherit;
margin-right: -2.133rem;
right: 0;
left: inherit;
&:nth-child(4) {
top: 50rem;
right: inherit;
left: 0;
}
}
// engagement 3 second part
& > .bloc5 + .bloc1 {
height: 32rem;
margin-bottom: 50rem;
@include max-width($engagementMajorBreakPoint) {
height: inherit;
margin-bottom: inherit;
}
}
& > .bloc5 + .bloc1 + .bloc5 {
position: relative;
margin-top: -50rem;
top: 0 !important;
margin-right: inherit;
margin-left: 2.133rem;
left: 100% !important;
transform: translateX(-100%);
}
// engagement 4 specific rule
& > .bloc4:first-child {
flex-direction: row-reverse;
& > .content {
right: inherit;
left: 0;
}
}
h1,h2,h3,h4,h5,h6 {
color: $engagementDarkGreen !important;
}
a {
color: $engagementDarkGreen;
font-weight: bold;
&:hover {
text-decoration: underline;
}
}
}
@include max-width($mobile) {
.labels {
flex-direction: column !important;
& > p {
width: 100% !important;
margin-bottom: 1.6rem !important;
}
}
}
}

View file

@ -0,0 +1,20 @@
.content.onsengage {
.nav-onsengage {
position: relative;
top: inherit;
ul > li {
background-color: #FFFFFF;
margin-right: 1px ;
&:last-of-type {
margin-right: inherit;
}
&.active {
border-bottom: 5px solid $engagementDarkGreen !important;
}
&:hover {
border-bottom: 5px solid $engagementDarkGreen !important;
}
}
}
}

View file

@ -70,3 +70,11 @@
@import "front/pages/club/boutique/index";
@import "front/pages/club/boutique/validated";
@import "front/pages/club/bourse";
@import "front/pages/onsengage/nav";
@import "front/pages/onsengage/common";
@import "front/pages/onsengage/bloc1";
@import "front/pages/onsengage/bloc2";
@import "front/pages/onsengage/bloc3";
@import "front/pages/onsengage/bloc4";
@import "front/pages/onsengage/bloc5";

View file

@ -0,0 +1,51 @@
@extends('layouts.bo')
@section('content')
<div class="card">
<div class="card-header">
Modification d'une page engagement
<a href="{{route('bo.engagements.index')}}" class="btn btn-sm btn-primary float-right ml-2">Retour</a>
</div>
<div class="card-body">
<form id="engagementForm" action="{{route('bo.engagements.update', $engagement->id)}}" method="POST" enctype="multipart/form-data">
@method('PUT')
@csrf
<div class="row">
<div class="col-md-8 offset-md-2">
@if (session()->has('success'))
<div class="alert alert-success">
{{ session()->get('success') }}
</div>
@endif
@if ($errors->any())
<div class="alert alert-danger">
<ul>
@foreach ($errors->all() as $error)
<li>{{ $error }}</li>
@endforeach
</ul>
</div>
@endif
@include('bo.engagements.form-inputs')
<div class="form-group text-center">
<button type="submit" class="btn btn-secondary">{{ __('Modifier') }}</button>
</div>
</div>
</div>
</form>
</div>
</div>
@endsection
@push('scripts')
<script>
$('#engagementForm').on('submit', function(e) {
$('input[type="file"]').each(function(i, img) {
if ($(img).data('old-value')) {
$(img).attr('type', 'text').val($(img).data('old-value'));
}
});
});
</script>
@endpush

View file

@ -0,0 +1,206 @@
<div class="form-group">
<label for="title"><small>{{ __('Titre*') }}</small></label>
<input id="title" type="text" class="form-control" name="title" placeholder="Titre *" value="{{ old('title') ?? $engagement->title ?? '' }}" required>
</div>
<div class="form-group">
<label for="metaTitle"><small>{{ __('Titre meta*') }}</small></label>
<input id="metaTitle" type="text" class="form-control" name="metaTitle" placeholder="Meta Titre *" minlength="20" maxlength="60" value="{{ old('metaTitle') ?? $engagement->metaTitle ?? '' }}" required>
</div>
<div class="form-group">
<label for="metaDescription"><small>{{ __('Description meta*') }}</small></label>
<input id="metaDescription" type="text" class="form-control" name="metaDescription" placeholder="Meta Description *" minlength="130" maxlength="160" value="{{ old('metaDescription') ?? $engagement->metaDescription ?? '' }}" required>
</div>
@if($engagement->type->equals(EngagementType::header()))
<div class="form-group">
<label class="col-form-label">{{ __('Contenu entête') }}*</label>
<custom-ckeditor name="content" dbtext="{{ old('content.header') ?? $engagement->content['header'] ?? '' }}"></custom-ckeditor>
</div>
@else
@php
$content = $engagement->content;
@endphp
@foreach ($content as $i => $bloc)
<hr>
<div>
<h3>Partie&nbsp;:&nbsp;{{ $bloc['type']['label'] }}</h3>
<div>
@foreach($bloc['content'] as $k => $input)
@if(!$loop->first)
<hr class="w-25">
@endif
@switch($input['inputType']['value'])
@case(InputType::url()->value)
@case(InputType::string()->value)
<div class="form-group">
<label for="{{ $i.$k }}"><small>{{ $input['label'] }}*</small></label>
<input id="{{ $i.$k }}" type="text" class="form-control" name="content[{{$i}}][content][{{$k}}][value]" placeholder="{{ $input['label'] }}" value="{{ old("content.$i.content.$k.value") ?? $input['value'] ?? '' }}" required>
</div>
@break
@case(InputType::text()->value)
<div class="form-group">
<label class="col-form-label">{{ $input['label'] }}*</label>
<custom-ckeditor name="content[{{$i}}][content][{{$k}}][value]" dbtext="{{ old("content.$i.content.$k.value") ?? $input['value'] ?? '' }}"></custom-ckeditor>
</div>
@break
@case(InputType::boolean()->value)
<div class="form-group">
<label>
<input type="checkbox" name="content[{{$i}}][content][{{$k}}][value]" value="1" @if (( old("content.$i.content.$k.value") ?? $input['value'] ?? 0 ))checked @endif>
{{ $input['label'] }}*
</label>
</div>
@break
@case(InputType::image()->value)
<div class="form-group">
<label for="{{ $i.$k }}img">Visuel * de type JPEG/PNG/SVG - 2Mo max. - {{ isset($input['dimensions']) ? __('Dimensions :dimensions', ['dimensions' => $input['dimensions']]) : __('Dimensions Maximales :max', ['max' => $input['dimensionsMax']]) }} px</label>
<input id="{{ $i.$k }}img" type="file" name="content[{{$i}}][content][{{$k}}][value]" accept="image/png,image/jpeg,.svg">
<br>
<label for="{{ $i.$k }}alt"><small>{{ $input['label'] }} - {{ __('Texte alternatif') }}</small></label>
<input id="{{ $i.$k }}alt" type="text" class="form-control" name="content[{{$i}}][content][{{$k}}][alt]" placeholder="{{ __('Texte alternatif à l\'image') }}" value="{{ old("content.$i.content.$k.alt") ?? $input['alt'] ?? '' }}">
<br>
@if(isset($input['value']) and strlen($input['value']))
<img src="{{ $input['value'] }}" alt="image" style="max-height: 200px;">
@endif
</div>
@break
@case(InputType::imageArray()->value)
<div class="card">
<div class="card-header">
<h6>{{ __('Images Infographie') }}</h6>
</div>
<div class="card-body">
@include('bo.engagements.image-input', [
'i' => $i,
'k' => $k,
'tmpl' => true,
])
@foreach($input['value'] as $o => $image)
@include('bo.engagements.image-input', [
'i' => $i,
'k' => $k,
'o' => $o,
'tmpl' => false,
'image' => $image,
'input' => $input,
])
@endforeach
<div class="row d-flex justify-content-end">
<button class="btn btn-primary imageAdd">{{ __('Ajouter') }}</button>
</div>
</div>
</div>
@break
@case(InputType::labelArray()->value)
<div class="card">
<div class="card-header">
<h6>{{ __('Faits avec gros titres') }}</h6>
</div>
<div class="card-body">
@include('bo.engagements.label-input', [
'i' => $i,
'k' => $k,
'tmpl' => true,
])
@foreach($input['value'] as $o => $label)
@include('bo.engagements.label-input', [
'i' => $i,
'k' => $k,
'o' => $o,
'tmpl' => false,
'label' => $label,
])
@endforeach
<div class="row d-flex justify-content-end">
<button class="btn btn-primary labelAdd">{{ __('Ajouter') }}</button>
</div>
</div>
</div>
@break
@default
@dump('unknown input type')
@endswitch
@endforeach
</div>
</div>
@endforeach
@endif
<hr>
<div class="form-group">
<label>
<input type="checkbox" name="status" value="1" @if ((old('status') ?? $engagement->status ?? 0))checked @endif>
{{ __('Page Publiée ?') }}
</label>
</div>
@push('scripts')
<script>
$(document).ready(function() {
var cloneFn = function(e) {
e.preventDefault();
$(this).parent().fadeOut(300, function() { this.remove(); });
};
var replaceID = function(c, attr) {
return attr.replace('[X]', '[' + lastId +']');
};
var setDataNumLabel = function(c , div) {
if($(div).hasClass('d-none')) {
return;
}
$(div).find('input').each(function(o, el) {
if (el.id.length) {
let xid = el.id.split('_');
xid[2] = c;
el.id = xid.join('_');
}
if ($(el).prev().attr('for')) {
let xfor = $(el).prev().attr('for').split('_');
xfor[2] = c;
$(el).prev().attr('for', xfor.join('_'));
}
$(el).attr('name', $(el).attr('name')
.replace(/(?:\[(X|[0-9]*)\])\[(fullLine|bigtext|text)\]$/, '[' + (c-1) + '][$2]'));
});
};
var setDataNumImage = function(c , input) {
if(!c) {
return;
}
$(input).attr('name', $(input).attr('name')
.replace(/(\[(?:X|[0-9]*)\])$/, '[' + (c-1) + ']'));
};
$('.labelGroup,.imageGroup').each(function(k, grp) {
$(grp).children('button').first().on('click', cloneFn);
});
$('.labelAdd').on('click', function(e) {
e.preventDefault();
var $t = $($(this).parent().parent().find('.labelTemplate').first()).clone().removeClass('d-none');
var $self = $(this);
$t.insertBefore($(this).parent());
$t.children('button').first().on('click', cloneFn);
$self.parent().parent().find('div.alert').each(setDataNumLabel);
});
$('.labelAdd').parent().parent().on('click', 'button.close', function() {
var $self = $(this).parent().parent();
setTimeout(function() {
$self.find('div.alert').each(setDataNumLabel);
}, 400);
});
$('.imageAdd').on('click', function(e) {
e.preventDefault();
$t = $(this).parent().parent().find('.imageTemplate').first().clone().removeClass('d-none');
$t.insertBefore($(this).parent());
$t.find('input').first().attr('required', 'required');
$t.children('button').first().on('click', cloneFn);
$(this).parent().parent().find('input').each(setDataNumImage);
});
$('.imageAdd').parent().parent().on('click', 'button.close', function() {
var $self = $(this).parent().parent();
setTimeout(function() {
$self.find('input').each(setDataNumImage);
}, 400);
});
})
</script>
@endpush

View file

@ -0,0 +1,47 @@
@extends('layouts.bo')
@section('content')
<div class="card">
<div class="card-header">
Recettes misent en avant
</div>
<div class="card-body">
<form action="{{route('bo.recipes.store-highlights')}}" method="POST" enctype="multipart/form-data">
@method('PUT')
@csrf
@if (session('success'))
<div class="alert alert-success">
{{ session('success') }}
</div>
@endif
<p id="checkboxes">Choisissez jusqu'à trois recettes à mettre en avant sur la page Coté Cuisine</p>
@foreach ($r as $recipe)
<label class="form-control">
@if ($recipe->highlight)
<input type="checkbox" class="cb_recipe" name="recipes[]" value="{{$recipe->id}}" checked>
@else
<input type="checkbox" class="cb_recipe" name="recipes[]" value="{{$recipe->id}}">
@endif
{{$recipe->title}}
</label>
@endforeach
<div class="form-group text-center">
<input type="submit" class="btn btn-secondary" value="Valider">
</div>
</form>
</div>
</div>
@endsection
@section('scripts')
<script type="text/javascript">
$('.cb_recipe').click(function(event) {
if ($('.cb_recipe:checked').length > 3) {
event.preventDefault();
event.stopPropagation();
return false;
}
});
</script>
@endsection

View file

@ -0,0 +1,13 @@
<div data-num="{{$tmpl ? '' : $o}}" class="alert alert-warning @if(!$tmpl)imageGroup @else d-none imageTemplate @endif" role="alert">
<button type="button" class="close" aria-label="Close">
<span aria-hidden="true">&times;</span>
</button>
<div class="form-group">
<label>Visuel * de type JPEG/PNG/SVG - 2Mo max. - {{ isset($input['dimensions']) ? __('Dimensions :dimensions', ['dimensions' => $input['dimensions']]) : __('Dimensions Maximales :max', ['max' => $input['dimensionsMax']]) }} px</label>
<input type="file" name="content[{{$i}}][content][{{$k}}][value][{{$tmpl ? 'X' : $o}}]" accept="image/png,image/jpeg,.svg" @if(!$tmpl)data-old-value="{{ $image }}" @endif>
<br>
@if(!$tmpl)
<img class="img-responsive" src="{{ $image }}" alt="image" style="max-height: 200px;">
@endif
</div>
</div>

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