Merge branch 'develop' into trunk

This commit is contained in:
Vincent BRIDIER 2023-06-26 15:16:34 +02:00
commit 6b234cd0cc
No known key found for this signature in database
GPG key ID: 8571BFA20420D512
15 changed files with 165 additions and 173 deletions

View file

@ -47,6 +47,7 @@ class SecureHeaders
'\'self\'',
'https://www.youtube.com',
'https://vimeo.com/',
'https://player.vimeo.com/',
'https://www.google.com/recaptcha/',
'https://recaptcha.google.com/recaptcha/'
]) . ';',
@ -72,7 +73,7 @@ class SecureHeaders
);
$response->headers->set('Feature-Policy', \implode(',', [
'fullscreen', 'accelerometer', 'encrypted-media',
'gyroscope', 'picture-in-picture', '\'self\''
'gyroscope', 'picture-in-picture'
]) . ';');
return $response;
}

View file

@ -207,7 +207,10 @@ class RouteServiceProvider extends ServiceProvider
{
Route::middleware('web')
->namespace($this->namespace)
->group(base_path('routes/web.php'));
->group(base_path('routes/web-bo.php'));
Route::middleware('web')
->namespace($this->namespace)
->group(base_path('routes/web-fo.php'));
}
/**

View file

@ -20,8 +20,8 @@
"guzzlehttp/guzzle": "^7.4",
"kwaadpepper/enum": "^2.1",
"kwaadpepper/image-resizer": "^0.1.0",
"kwaadpepper/refresh-sitemap": "^1.0",
"kwaadpepper/serial-int-caster": "^1.0",
"kwaadpepper/refresh-sitemap": "1.0.0",
"kwaadpepper/serial-int-caster": "1.0.1",
"laravel/framework": "^8.0",
"laravel/tinker": "^2.0",
"laravel/ui": "^3.0",

73
composer.lock generated
View file

@ -4,7 +4,7 @@
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
"This file is @generated automatically"
],
"content-hash": "d4726f38d43585d27af789c4a2b8f7b6",
"content-hash": "6eeaf24f9fa2752d9918c3dcef949575",
"packages": [
{
"name": "asm89/stack-cors",
@ -2387,16 +2387,16 @@
},
{
"name": "kwaadpepper/refresh-sitemap",
"version": "1.1.0",
"version": "1.0.0",
"source": {
"type": "git",
"url": "https://github.com/Kwaadpepper/refresh-sitemap.git",
"reference": "4fdae6d0e9423f5af9216c74814929744807b6bb"
"reference": "003b116bff9f9531d8ca69cd1fc529878b8b54a6"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/Kwaadpepper/refresh-sitemap/zipball/4fdae6d0e9423f5af9216c74814929744807b6bb",
"reference": "4fdae6d0e9423f5af9216c74814929744807b6bb",
"url": "https://api.github.com/repos/Kwaadpepper/refresh-sitemap/zipball/003b116bff9f9531d8ca69cd1fc529878b8b54a6",
"reference": "003b116bff9f9531d8ca69cd1fc529878b8b54a6",
"shasum": ""
},
"require": {
@ -2440,31 +2440,29 @@
],
"support": {
"issues": "https://github.com/Kwaadpepper/refresh-sitemap/issues",
"source": "https://github.com/Kwaadpepper/refresh-sitemap/tree/1.1.0"
"source": "https://github.com/Kwaadpepper/refresh-sitemap/tree/1.0.0"
},
"time": "2023-03-06T08:27:09+00:00"
"time": "2022-06-10T17:46:53+00:00"
},
{
"name": "kwaadpepper/serial-int-caster",
"version": "1.1.0",
"version": "1.0.1",
"source": {
"type": "git",
"url": "https://github.com/Kwaadpepper/serial-int-caster.git",
"reference": "26f23d8e98460ebfb3e703053cab75f71b8e3b2f"
"reference": "bbba003ff5379576f05114386b5ebe8b33bc4705"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/Kwaadpepper/serial-int-caster/zipball/26f23d8e98460ebfb3e703053cab75f71b8e3b2f",
"reference": "26f23d8e98460ebfb3e703053cab75f71b8e3b2f",
"url": "https://api.github.com/repos/Kwaadpepper/serial-int-caster/zipball/bbba003ff5379576f05114386b5ebe8b33bc4705",
"reference": "bbba003ff5379576f05114386b5ebe8b33bc4705",
"shasum": ""
},
"require": {
"php": ">=7.3.0",
"ruafozy/mersenne-twister": "^1.3"
"php": ">=7.3.0"
},
"require-dev": {
"phpunit/phpunit": "^9.5",
"slevomat/coding-standard": "^8.6",
"squizlabs/php_codesniffer": "^3.6"
},
"type": "library",
@ -2486,9 +2484,9 @@
"description": "Convert int To as serial number and reverse",
"support": {
"issues": "https://github.com/Kwaadpepper/serial-int-caster/issues",
"source": "https://github.com/Kwaadpepper/serial-int-caster/tree/1.1.0"
"source": "https://github.com/Kwaadpepper/serial-int-caster/tree/1.0.1"
},
"time": "2022-12-11T00:45:50+00:00"
"time": "2021-05-16T15:50:37+00:00"
},
{
"name": "laravel/framework",
@ -5546,49 +5544,6 @@
},
"time": "2017-09-02T08:11:53+00:00"
},
{
"name": "ruafozy/mersenne-twister",
"version": "1.3.0",
"source": {
"type": "git",
"url": "https://github.com/ruafozy/php-mersenne-twister.git",
"reference": "83ca113aa1e5f924d3b5f03679b1480063cc7d94"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/ruafozy/php-mersenne-twister/zipball/83ca113aa1e5f924d3b5f03679b1480063cc7d94",
"reference": "83ca113aa1e5f924d3b5f03679b1480063cc7d94",
"shasum": ""
},
"require": {
"php": ">=5.3.0"
},
"require-dev": {
"phpunit/phpunit": "~4.1.4"
},
"type": "library",
"autoload": {
"files": [
"src/mersenne_twister.php"
]
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"description": "Pure-PHP Mersenne Twister",
"homepage": "https://github.com/ruafozy/php-mersenne-twister",
"keywords": [
"PRNG",
"mersenne",
"random"
],
"support": {
"issues": "https://github.com/ruafozy/php-mersenne-twister/issues",
"source": "https://github.com/ruafozy/php-mersenne-twister/tree/master"
},
"time": "2015-02-21T10:26:45+00:00"
},
{
"name": "sentry/sdk",
"version": "3.3.0",

Binary file not shown.

Before

Width:  |  Height:  |  Size: 371 KiB

After

Width:  |  Height:  |  Size: 50 KiB

43
resources/js/main.js vendored
View file

@ -41,6 +41,49 @@ pages.keys().map(key => {
});
});
document.addEventListener('DOMContentLoaded', function () {
// * Video frames.
const videoFrameList = document.querySelectorAll(".video-frame");
for (const videoLink of videoFrameList) {
if (!videoLink.dataset.type) {
throw new Error("Missing dataset type");
}
if (!videoLink.dataset.frame) {
throw new Error("Missing dataset frame");
}
// @ts-ignore
window.__CN_VIDEO = window.__CN_VIDEO ?? {};
const newIframe = document.createElement("iframe");
newIframe.frameBorder = "0";
newIframe.allow = "fullscreen";
newIframe.width = "1920px";
newIframe.height = "1080px";
newIframe.setAttribute("allowfullscreen", "allowfullscreen");
// @ts-ignore
const instance = new FsLightbox();
instance.props.sources = [newIframe];
setTimeout(() => {
videoLink.addEventListener("click", (e) => {
e.preventDefault();
// * This comes fslightbox lib
// @ts-ignore
instance.open();
setTimeout(function () {
// @ts-ignore
newIframe.src = window.__CN_VIDEO[videoLink.dataset.type]
? String(videoLink.href)
: String(videoLink.dataset.frame);
}, 50);
return false;
});
}, 300);
}
})
let vueOptions = {
el: "#app"
};

View file

@ -1 +1,32 @@
.absolute {
position: absolute;
}
.relative {
position: relative;
}
.vimeo-play-button {
top: 50%;
left: 50%;
font-size: 3rem;
transform: translateX(-50%) translateY(-50%);
color: #fff;
}
.top-50 {
top: 50%
}
.left-50 {
left: 50%;
}
@media screen and (min-width: 1230px) {
.video-frame > img {
height: 14vw;
min-height: 22.13112rem;
width: 24vw;
min-width: 39.12942rem;
}
}

View file

@ -8,11 +8,13 @@
top: 8.666rem;
left: 0;
z-index: 1;
max-width: 100%;
& > .video {
height: 14vw;
min-height: 22.13112rem;
width: 24vw;
min-width: 39.12942rem;
max-width: 90vw;
height: auto;
& > img {
max-width: 100%;
}
}
}
& > .content {
@ -99,15 +101,7 @@
top: 0;
left: 50%;
transform: translateX(-50%);
width: 100%;
max-width: inherit;
z-index: 0;
& > .video {
height: 22.13112rem;
width: inherit;
min-height: 22.13112rem;
min-width: inherit;
}
}
& > .content {
position: relative;

View file

@ -83,8 +83,8 @@
</div>
<div>
<label>
<input class="changeLength" type="checkbox" name="optin" @if($crmCustomer->opt_in === 1)checked @endif >
{{ __('J’accepte de recevoir les actualités et bons plans Le Gaulois') }}
<input class="changeLength" type="checkbox" name="optin" @if($crmCustomer->opt_in)checked @endif >
{{ __('J\'accepte de recevoir les actualités et bons plans Le Gaulois') }}
</label>
</div>
<button type="submit" class="btn-red">{{ __('Enregistrer') }}</button>

View file

@ -1,3 +1,8 @@
<div class="video vimeo" data-authorize="0">
<iframe src="/frame/vimeo" data-src="https://player.vimeo.com/video{{ parse_url($url, PHP_URL_PATH) }}" width="100%" height="100%" frameborder="0" allow="fullscreen"></iframe>
</div>
<a class="video vimeo video-frame" style="display: block" data-type="vimeo" data-frame="{{ route('front.frame', ['type' => 'vimeo']) }}" href="https://player.vimeo.com/video{{ parse_url($url, PHP_URL_PATH) }}" data-authorize="0">
<img
src="https://vumbnail.com/{{ parse_url($url, PHP_URL_PATH) }}.jpg"
alt="Alt"
title="Title"
>
<i class="vimeo-play-button absolute top-50 left-50 fa fa-regular fa-play-circle"></i>
</a>

View file

@ -37,7 +37,7 @@
</div>
<iframe id="opinsta-ytbe" class="video youtube" src="{{ route('front.frame', ['type' => 'youtube']) }}" data-src=" https://www.youtube.com/embed/vQz8xzUfhsg" data-authorize="0" frameBorder="0" allow="fullscreen; accelerometer; encrypted-media; gyroscope; picture-in-picture" width="315px" height="560px">
<iframe id="opinsta-ytbe" class="video youtube" src="{{ route('front.frame', ['type' => 'youtube']) }}" data-src="https://www.youtube.com/embed/9wB3qOdAoSY" data-authorize="0" frameBorder="0" allow="fullscreen; accelerometer; encrypted-media; gyroscope; picture-in-picture" width="315px" height="560px">
</iframe>
{{-- https://youtube.com/shorts/vQz8xzUfhsg?feature=share --}}
@ -152,4 +152,4 @@
</section>
</div>
@endsection
@endsection

View file

@ -159,8 +159,7 @@ $vegetal = ($vegetal || isset($gamme) && $gamme && $gamme->slug === "le-vegetal"
@if (isset($gamme))
@if($vegetal)
<h2 class="gammeDescription vegetal">
Découvrez les produits Le Gaulois Végétal : du végétal sans concession avec des produits SANS VIANDE, 100% GOURMANDS, élaborés EN FRANCE à partir de soja SANS OGM.<br>
NOUVEAU: Découvrez notre gamme 100% BIO élaborée à partir de FÈVES
Découvrez les produits Le Gaulois Végétal : du végétal sans concession avec des produits SANS VIANDE, 100% GOURMANDS, élaborés EN FRANCE à partir de soja SANS OGM.
</h2>
<div class="btn-vegetal-2">
<a href="#bloc-vegetal" class="boutons">Découvrir la démarche Le Gaulois Végétal</a>

View file

@ -41,86 +41,46 @@ $cookies = [];
// YOUTUBE
$cookies['youtube'] = [
'name' => 'VIDEOS - Youtube',
'description' => __('Les cookies déposés via les services de partage de vidéo ont pour finalité de permettre à l’utilisateur de visionner directement sur le site le contenu multimédia.'),
'name' => __('cookie-notice.custom.youtube.name'),
'description' => __('cookie-notice.custom.youtube.name'),
'labelLink' => __('cookie-notice.custom.youtube.labelLink'),
'link' => 'https://policies.google.com/technologies/cookies?hl=fr&utm_source=ucb',
'labelLink' => __('En savoir +'),
'cookies' => ['NID', 'VISITOR_INFO1_LIVE', 'YSC']
];
$cookies['youtube']['script'] = <<<SCRIPT
function () {
let frames = document.querySelectorAll('.video.youtube');
for (let frame of frames) {
frame.dataset.authorize = 1;
let iframe = frame.querySelector('iframe') ?? frame;
if (iframe) {
iframe.src = iframe.dataset.src;
}
}
window.__CN_VIDEO = window.__CN_VIDEO ?? {};
window.__CN_VIDEO.youtube = true;
}
SCRIPT;
$cookies['youtube']['fallback'] = <<<FALLBACK
function () {
let youtubeVids = document.getElementsByClassName('.video.youtube');
for (let item of youtubeVids) {
let a = document.createElement('a');
a.innerText = 'Autoriser';
a.classList.add('cn-cookie-link');
a.classList.add('btn-autorize');
a.onclick = function () {
CookieNotice.openModal();
};
let e = document.createElement('p');
e.innerHTML = 'Youtube est désactivé. ';
item.innerHTML = "";
e.appendChild(a);
item.appendChild(e);
}
window.__CN_VIDEO = window.__CN_VIDEO ?? {};
window.__CN_VIDEO.youtube = false;
}
FALLBACK;
// VIMEO
$cookies['vimeo'] = [
'name' => 'VIDEOS - Vimeo',
'description' => __('Les cookies déposés via les services de partage de vidéo ont pour finalité de permettre à l’utilisateur de visionner directement sur le site le contenu multimédia.'),
'name' => __('cookie-notice.custom.vimeo.name'),
'description' => __('cookie-notice.custom.vimeo.description'),
'labelLink' => __('cookie-notice.custom.vimeo.labelLink'),
'link' => 'https://vimeo.com/cookie_policy',
'labelLink' => __('En savoir +'),
'cookies' => []
];
$cookies['vimeo']['script'] = <<<SCRIPT
function () {
setTimeout(() => {
let frames = document.querySelectorAll('.video.vimeo');
for (let frame of frames) {
frame.dataset.authorize = 1;
let iframe = frame.querySelector('iframe');
iframe = iframe ? iframe : frame;
if (iframe) {
iframe.src = iframe.dataset.src;
}
}
}, 200)
window.__CN_VIDEO = window.__CN_VIDEO ?? {};
window.__CN_VIDEO.vimeo = true;
}
SCRIPT;
$cookies['vimeo']['fallback'] = <<<FALLBACK
function () {
let vimeoVids = document.getElementsByClassName('.video.vimeo');
for (let item of vimeoVids) {
let a = document.createElement('a');
a.innerText = 'Autoriser';
a.classList.add('cn-cookie-link');
a.classList.add('btn-autorize');
a.onclick = function () {
CookieNotice.openModal();
};
let e = document.createElement('p');
e.innerHTML = 'Vimeo est désactivé. ';
item.innerHTML = "";
e.appendChild(a);
item.appendChild(e);
}
window.__CN_VIDEO = window.__CN_VIDEO ?? {};
window.__CN_VIDEO.vimeo = false;
}
FALLBACK;
@ -241,23 +201,26 @@ SCRIPT;
@push('scripts')
<script nonce="{{ $nonce ?? '' }}">
window.WebCookieNotice = {};
@foreach($cookies as $index_name => $cookie)
window.WebCookieNotice['{{ $index_name }}'] = {};
window.WebCookieNotice['{{ $index_name }}'].tmp = {};
// SCRIPT
window.WebCookieNotice['{{ $index_name }}'].tmp.script = {!! strip_tags($cookie['script']) !!};
@php unset($cookie['script']); @endphp
// FALLBACK
@if(isset($cookie['fallback']))
window.WebCookieNotice['{{ $index_name }}'].tmp.fallback = {!! strip_tags($cookie['fallback']) !!};
@php unset($cookie['fallback']); @endphp
@endif
window.WebCookieNotice['{{ $index_name }}'].conf = @json($cookie);
window.WebCookieNotice['{{ $index_name }}'].conf.script = window.WebCookieNotice['{{ $index_name }}'].tmp.script;
window.WebCookieNotice['{{ $index_name }}'].conf.fallback = window.WebCookieNotice['{{ $index_name }}'].tmp.fallback;
window.WebCookieNotice['{{ $index_name }}'] = window.WebCookieNotice['{{ $index_name }}'].conf;
@endforeach
window.WebCookieNotice = new CookieNotice(window.WebCookieNotice);
document.addEventListener('DOMContentLoaded', function () {
window.WebCookieNotice = {};
@foreach($cookies as $index_name => $cookie)
window.WebCookieNotice['{{ $index_name }}'] = {};
window.WebCookieNotice['{{ $index_name }}'].tmp = {};
// SCRIPT
window.WebCookieNotice['{{ $index_name }}'].tmp.script = {!! strip_tags($cookie['script']) !!};
@php unset($cookie['script']); @endphp
// FALLBACK
@if(isset($cookie['fallback']))
window.WebCookieNotice['{{ $index_name }}'].tmp.fallback = {!! strip_tags($cookie['fallback']) !!};
@php unset($cookie['fallback']); @endphp
@endif
window.WebCookieNotice['{{ $index_name }}'].conf = @json($cookie);
window.WebCookieNotice['{{ $index_name }}'].conf.script = window.WebCookieNotice['{{ $index_name }}'].tmp.script;
window.WebCookieNotice['{{ $index_name }}'].conf.fallback = window.WebCookieNotice['{{ $index_name }}'].tmp.fallback;
window.WebCookieNotice['{{ $index_name }}'] = window.WebCookieNotice['{{ $index_name }}'].conf;
@endforeach
window.WebCookieNotice = new CookieNotice(window.WebCookieNotice);
});
</script>
@endpush

View file

@ -51,4 +51,4 @@
<!-- STYLES -->
<link rel="stylesheet" href="{{ mix('css/preload-main.css') }}">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.3/css/all.min.css" integrity="sha512-iBBXm8fW90+nuLcSKlbmrPcLa0OT92xO1BIsZ+ywDWZCvqsWgccV3gFoRBv0z+8dLJgyAHIhR35VZc2oM/gI1w==" crossorigin="anonymous" />
@stack('styles')
@stack('styles')

View file

@ -49,8 +49,6 @@ use Illuminate\View\Middleware\ShareErrorsFromSession;
* pour être exclue du sitemap
*/
require_once __DIR__ . '/web-bo.php';
Route::get('/', [HomeController::class, 'index'])->name('home');
Route::get('/de-smaak-om-te-delen', [OnePageController::class, 'index'])->name('home-nl');
@ -74,11 +72,11 @@ Route::prefix('/produits')
});
Route::prefix('/produit')
->name('product.')
->group(function () {
Route::get('/{publishedProduct:slug}', [ProductsController::class, 'show'])
->middleware('redirect-slugs')->name('show');
});
->name('product.')
->group(function () {
Route::get('/{publishedProduct:slug}', [ProductsController::class, 'show'])
->middleware('redirect-slugs')->name('show');
});
Route::prefix('/cote-cuisine')->name('kitchen-side.')->group(function () {
Route::get('/', [RecipesController::class, 'kitchenside'])->name('index');
@ -206,14 +204,14 @@ Route::prefix('/on-s-engage')
});
Route::prefix(Str::slug(GeneralConfig::where('type', GeneralConfigType::breedingPage())
->first()->data['breeding_header_title']['value']))
->name('breeding-page.')
->group(function () {
Route::get('/', [BreedingPageController::class, 'index'])->name('index');
Route::get('/{breedingPageType}', [BreedingPageController::class, 'list'])->name('list');
Route::get('/{breedingPageType}/{publishedBreedingPage}', [BreedingPageController::class, 'show'])
->middleware('redirect-slugs')->name('show');
});
->first()->data['breeding_header_title']['value']))
->name('breeding-page.')
->group(function () {
Route::get('/', [BreedingPageController::class, 'index'])->name('index');
Route::get('/{breedingPageType}', [BreedingPageController::class, 'list'])->name('list');
Route::get('/{breedingPageType}/{publishedBreedingPage}', [BreedingPageController::class, 'show'])
->middleware('redirect-slugs')->name('show');
});
// * Unsubscribe from newsletter
Route::get('/{unsubscribe}', [CustomerController::class, 'unscribeNewsletter'])