Notre Histoire

This commit is contained in:
Olivier Legat 2022-02-01 10:02:05 +01:00
parent 45ddacee92
commit 3d63fa2d59
14 changed files with 207 additions and 10 deletions

View file

@ -8,6 +8,7 @@ use App\Enums\Page;
use App\Models\Advice;
use App\Models\Encart;
use App\Models\Gamme;
use App\Models\Moment;
use App\Models\Picto;
use App\Models\PictoBrand;
use App\Models\Post;
@ -67,6 +68,8 @@ class InitVarsGlobals
$title_foodBloc2 = Title::where('page', Page::foodBloc2()->value)->first();
$title_newsPosts = Title::where('page', Page::newsPosts()->value)->first();
$moments = Moment::where('page', Page::marqueHistory()->value)->get();
View::share('encart_home', $encart_home);
View::share('encart_marqueHeader', $encart_marqueHeader);
View::share('encart_marqueBloc2', $encart_marqueBloc2);
@ -96,6 +99,8 @@ class InitVarsGlobals
View::share('title_foodBloc2', $title_foodBloc2);
View::share('title_newsPosts', $title_newsPosts);
View::share('moments', $moments);
return $next($request);
}
}

View file

@ -32,7 +32,7 @@ class UpdateEncartRequest extends FormRequest
// ],
'text' => 'required|max:2047',
'picture' => 'sometimes|image|mimes:jpeg,png,jpg|max:2048',
'alt_text_picture' => 'required|max:255',
'alt_text_picture' => 'sometimes|max:255',
];
}
}

View file

@ -0,0 +1,34 @@
<?php
namespace App\Http\Requests;
use Illuminate\Foundation\Http\FormRequest;
class UpdateMomentRequest extends FormRequest
{
/**
* Determine if the user is authorized to make this request.
*
* @return bool
*/
public function authorize()
{
return auth()->check();
}
/**
* Get the validation rules that apply to the request.
*
* @return array
*/
public function rules()
{
return [
'title' => 'required|max:255',
'subtitle' => 'sometimes|max:255',
'text' => 'required|max:2047',
'picture' => 'sometimes|image|mimes:jpeg,png,jpg|max:2048',
'alt_text_picture' => 'sometimes|max:255',
];
}
}

View file

@ -43,11 +43,77 @@ class MomentsSeeder extends Seeder
$moment->page = Page::marqueHistory();
$moment->title = "1961";
$moment->subtitle = "Le poulet prend son envol.";
$moment->text = "<p> Il s'exporte d’abord vers l’Allemagne et la Suisse, puis, dans les années 70 vers d’autres pays comme la Russie ou le Liban.</p>";
$moment->text = "<p>Il s'exporte d’abord vers l’Allemagne et la Suisse, puis, dans les années 70 vers d’autres pays comme la Russie ou le Liban.</p>";
$upload = new SplFileInfo(resource_path('seeds/moments/1961.jpg'));
$imgpath = Utils::storeImage($upload, $moment->getTable());
$moment->picture = $imgpath;
$moment->alt_text_picture = $moment->subtitle;
$moment->save();
$moment = new Moment();
$moment->page = Page::marqueHistory();
$moment->title = "1980";
$moment->subtitle = "L'expansion internationale se poursuit.";
$moment->text = "<p>Le développement de la marque à l'export continue tout au long de la décennie, principalement vers le Moyen-Orient mais aussi en Afrique.</p>";
$upload = new SplFileInfo(resource_path('seeds/moments/1980.jpg'));
$imgpath = Utils::storeImage($upload, $moment->getTable());
$moment->picture = $imgpath;
$moment->alt_text_picture = $moment->subtitle;
$moment->save();
$moment = new Moment();
$moment->page = Page::marqueHistory();
$moment->title = "1992";
$moment->subtitle = "La naissance d'un produit iconique !";
$moment->text = "<p>Le spécialiste de la volaille lance sa Chicken Franks Doux, un produit emblématique. Et vous l'adorez depuis !</p>";
$upload = new SplFileInfo(resource_path('seeds/moments/1992.jpg'));
$imgpath = Utils::storeImage($upload, $moment->getTable());
$moment->picture = $imgpath;
$moment->alt_text_picture = $moment->subtitle;
$moment->save();
$moment = new Moment();
$moment->page = Page::marqueHistory();
$moment->title = "1992";
$moment->subtitle = "Un nouveau défi.";
$moment->text = "<p>Toujours désireuse d'apporter plus de variété dans vos assiettes, la marque Doux se lance dans la production de produits élaborés destinés à l’export, tels que les nuggets, les burgers ou les escalopes panées.</p>";
$upload = new SplFileInfo(resource_path('seeds/moments/1992_bis.jpg'));
$imgpath = Utils::storeImage($upload, $moment->getTable());
$moment->picture = $imgpath;
$moment->alt_text_picture = $moment->subtitle;
$moment->save();
$moment = new Moment();
$moment->page = Page::marqueHistory();
$moment->title = "2018";
$moment->subtitle = "L'année du renouveau.";
$moment->text = "<p>La marque Doux intègre LDC, leader français de la volaille.</p>";
$upload = new SplFileInfo(resource_path('seeds/moments/2018.jpg'));
$imgpath = Utils::storeImage($upload, $moment->getTable());
$moment->picture = $imgpath;
$moment->alt_text_picture = $moment->subtitle;
$moment->save();
$moment = new Moment();
$moment->page = Page::marqueHistory();
$moment->title = "2019";
$moment->subtitle = "Un vent de fraicheur.";
$moment->text = "<p>La marque Doux s'offre un nouveau look plus moderne, sans rien changer au goût tant apprécié de ses produits.</p>";
$upload = new SplFileInfo(resource_path('seeds/moments/88832_2.png'));
$imgpath = Utils::storeImage($upload, $moment->getTable());
$moment->picture = $imgpath;
$moment->alt_text_picture = $moment->subtitle;
$moment->save();
$moment = new Moment();
$moment->page = Page::marqueHistory();
$moment->title = "2021";
$moment->subtitle = "Doux Innove...";
$moment->text = "<p>...et lance le Steak haché de poulet façon bouchère et les Mini Chicken Franks : Découvrez ces nouveaux produits inédits !</p>";
$upload = new SplFileInfo(resource_path('seeds/moments/2021.jpg'));
$imgpath = Utils::storeImage($upload, $moment->getTable());
$moment->picture = $imgpath;
$moment->alt_text_picture = $moment->subtitle;
$moment->save();
}
}

View file

@ -4140,6 +4140,8 @@ img{
width:-moz-max-content;
width:max-content;
margin:0 auto;
display:flex;
flex-direction:column;
}
#frise-autoscroll .img-frise .svg-mask{
position:-webkit-sticky;

View file

@ -28,6 +28,8 @@ img {
position: relative;
width: max-content;
margin: 0 auto;
display: flex;
flex-direction: column;
.svg-mask {
position: sticky;

Binary file not shown.

After

Width:  |  Height:  |  Size: 839 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 262 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 743 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 469 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.7 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.9 MiB

View file

@ -31,7 +31,7 @@
@include('back.modules.input-error', ['inputName'=>'text'])
</div>
<div class="form-group">
<label for="picture">{{ __('Image') }} <small class="text-muted">- JPEG/PNG, 2Mo max. Dimensions {{ Config::get('bo.moment_image_maxwidth') }} px par {{ Config::get('bo.moment_image_maxheight') }} px</small></label></br>
<label for="picture">{{ __('Image') }} <small class="text-muted">- JPEG/PNG, 2Mo max.</small></label></br>
<input type="file" id="picture" name="picture" accept="image/png, image/jpeg">
@if (!empty($moment->picture))
<br />
@ -47,3 +47,52 @@
</div>
</form>
@endsection
@push('scripts')
<script type="text/javascript">
var editorConfig = {
removePlugins: ["Image", "ImageCaption", "ImageStyle", "ImageToolbar", "ImageUpload"],
toolbar: ['heading', '|', 'bold', 'italic', 'link', 'bulletedList', 'numberedList', '|', 'blockQuote', 'insertTable', '|', 'undo', 'redo'],
heading: {
options: [{
model: 'paragraph',
title: 'Paragraph',
class: 'ck-heading_paragraph'
},
{
model: 'heading1',
view: 'h1',
title: 'Heading 1',
class: 'ck-heading_heading1'
},
{
model: 'heading2',
view: 'h2',
title: 'Heading 2',
class: 'ck-heading_heading2'
},
{
model: 'heading3',
view: 'h3',
title: 'Heading 3',
class: 'ck-heading_heading3'
},
{
model: 'heading4',
view: 'h4',
title: 'Heading 4',
class: 'ck-heading_heading4'
}
]
},
table: {
contentToolbar: ['tableColumn', 'tableRow', 'mergeTableCells']
}
};
ClassicEditor
.create(document.querySelector('#text'), editorConfig)
.catch(error => {
console.error(error);
});
</script>
@endpush

View file

@ -33,7 +33,7 @@
<h1 class="align-center"><i class="mascotte"></i>{{ $encart_marqueHeader->title}}</h1>
</div>
<h2 class="align-center">{{ $encart_marqueHeader->subtitle}}</h2>
<p class="align-center">{{ $encart_marqueHeader->text}}</p>
<span class="align-center">{!! $encart_marqueHeader->text !!}</span>
</div>
</section>
<section id="reassurances">
@ -73,15 +73,53 @@
<section class="container">
<span id="notre-histoire" class="offset-anchor"></span>
<div class="wrapper">
<h2 class="sectiontitle align-center animate__animated fadeInUp animate__slow">Notre histoire</h2>
<h2 class="sectiontitle align-center animate__animated fadeInUp animate__slow">{{ __('Notre histoire') }}</h2>
<div class="timeline">
<div id="frise-autoscroll">
<div class="img-frise">
<img src="{{ asset('assets/images/story-line.png') }}" alt="File de l'histoire">
<img src="{{ asset('assets/images/story-line.png') }}" alt="Fil de l'histoire">
<img src="{{ asset('assets/images/story-line.png') }}" alt="Fil de l'histoire">
<img src="{{ asset('assets/images/story-line.png') }}" alt="Fil de l'histoire">
<div class="svg-mask"></div>
</div>
</div>
@foreach ($moments as $moment)
@if ($loop->first)
<div class="step is-flex start right p-rel animate__animated fadeInRight animate__slow">
<span class="year">{{$moment->title}}</span>
<div class="step_content">
<h3 class="step_title bold">{{$moment->subtitle}}</h3>
<p class="align-justify">{!! $moment->text !!}</p>
<img src="{{ asset($moment->picture) }}" alt="{{$moment->alt_text_picture}}">
</div>
</div>
@else
@if ($loop->iteration % 2 == 0)
<div class="step left p-rel desk-mt-n95 smrt-order animate__animated fadeInLeft animate__slow">
<img src="{{ asset($moment->picture) }}" alt="{{$moment->alt_text_picture}}">
<span class="year">{{$moment->title}}</span>
<div class="step_content">
<h3 class="step_title bold">{{$moment->subtitle}}</h3>
<p class="align-justify">{!! $moment->text !!}</p>
</div>
</div>
@else
<div class="step special right p-rel desk-ml-150 smrt-order animate__animated fadeInRight animate__slow">
<img src="{{ asset($moment->picture) }}" alt="{{$moment->alt_text_picture}}">
<span class="year">{{$moment->title}}</span>
<div class="step_content">
<h3 class="step_title bold">{{$moment->subtitle}}</h3>
<p class="align-justify">{!! $moment->text !!}</p>
</div>
</div>
@endif
@endif
@endforeach
{{--
<div class="step is-flex start right p-rel animate__animated fadeInRight animate__slow">
<span class="year">1920</span>
@ -114,6 +152,7 @@
</div>
</div>
--}}
</div>
</div>
</section>
@ -126,12 +165,12 @@
<div class="w50 smrt-mb-100">
<img src="{{ asset($encart_marqueBloc4l->picture) }}" alt="{{ $encart_marqueBloc4l->alt_text_picture}}" class="animate__animated fadeInLeft animate__slow">
<h3 class="color-yellow">{{ $encart_marqueBloc4l->title}}</h3>
<p class="align-justify">{{ $encart_marqueBloc4l->text}}</p>
<p class="align-justify">{!! $encart_marqueBloc4l->text !!}</p>
</div>
<div class="w50 smrt-mb-100">
<img src="{{ asset($encart_marqueBloc4r->picture) }}" alt="{{ $encart_marqueBloc4r->alt_text_picture}}" class="animate__animated fadeInLeft animate__slow">
<h3 class="color-yellow">{{ $encart_marqueBloc4r->title}}</h3>
<p class="align-justify">{{ $encart_marqueBloc4r->text}}</p>
<p class="align-justify">{!! $encart_marqueBloc4r->text !!}</p>
</div>
</div>
<div class="mt50 video-wrapper">
@ -147,7 +186,7 @@
<div class="is-flex">
<div class="w50 animate__animated fadeInLeft animate__slow">
<h3 class="color-yellow">{{ $encart_marqueFooter->subtitle}}</h3>
<p class="align-justify">{{ $encart_marqueFooter->text}}</p>
<p class="align-justify">{!! $encart_marqueFooter->text !!}</p>
</div>
<div class="w50 animate__animated fadeInRight animate__slow">
<img src="{{ asset($encart_marqueFooter->picture) }}" alt="{{ $encart_marqueFooter->alt_text_picture}}">
@ -156,4 +195,4 @@
</div>
</section>
@endsection
@endsection