This commit is contained in:
parent
f37a549e9f
commit
80813ab9e5
15 changed files with 227 additions and 133 deletions
|
|
@ -27,8 +27,6 @@ class ContactFormRequest extends FormRequest
|
|||
'city' => Str::of($this->post('city'))->value(),
|
||||
'postal_code' => Str::of($this->post('postal_code'))->value(),
|
||||
'message' => Str::of($this->post('message'))->value(),
|
||||
// * boolean
|
||||
'terms' => $this->post('terms') ? true : false,
|
||||
// * integer
|
||||
'batch_number' => $this->post('batch_number') ? intval($this->post('batch_number')) : null,
|
||||
]);
|
||||
|
|
@ -66,8 +64,6 @@ class ContactFormRequest extends FormRequest
|
|||
'postal_code' => 'present|min:0|postal_code:FR|max:25',
|
||||
'message' => 'present|min:20|max:35656',
|
||||
'file' => 'nullable|file|mimes:jpg,jpeg,png,pdf|max:2048',
|
||||
// * obligatoire
|
||||
'terms' => 'required|boolean|accepted',
|
||||
|
||||
// * Conditional fields
|
||||
// * obligatoire si type == product
|
||||
|
|
@ -99,7 +95,6 @@ class ContactFormRequest extends FormRequest
|
|||
return [
|
||||
'subject' => trans('validation.attributes.subject'),
|
||||
'file' => trans('validation.custom.attachment'),
|
||||
'terms' => trans('validation.attributes.terms'),
|
||||
'expiration_date' => trans('validation.custom.expiration_date'),
|
||||
'batch_number' => trans('validation.custom.batch_number'),
|
||||
'job_title' => trans('validation.custom.job_title'),
|
||||
|
|
@ -115,7 +110,8 @@ class ContactFormRequest extends FormRequest
|
|||
{
|
||||
return [
|
||||
'postal_code' => trans('validation.custom.postal_code', [
|
||||
'countries' => Country::france->label(), 'examples' => 72000
|
||||
'countries' => Country::france->label(),
|
||||
'examples' => 72000
|
||||
]),
|
||||
'phone.phone' => trans('validation.custom.phone'),
|
||||
];
|
||||
|
|
|
|||
8
package-lock.json
generated
8
package-lock.json
generated
|
|
@ -12,7 +12,7 @@
|
|||
"@fortawesome/free-regular-svg-icons": "^6.5.1",
|
||||
"@fortawesome/free-solid-svg-icons": "^6.5.1",
|
||||
"@fortawesome/vue-fontawesome": "^3.0.5",
|
||||
"@ldc-web/cookie-notice": "^3.1.2",
|
||||
"@ldc-web/cookie-notice": "^6.1.0",
|
||||
"@sipec/vue3-tags-input": "^3.0.4",
|
||||
"@types/bootstrap": "^5.2.7",
|
||||
"@types/node": "^20.8.2",
|
||||
|
|
@ -1050,9 +1050,9 @@
|
|||
"dev": true
|
||||
},
|
||||
"node_modules/@ldc-web/cookie-notice": {
|
||||
"version": "3.1.3",
|
||||
"resolved": "https://lab.s-web.fr/api/v4/projects/50/packages/npm/@ldc-web/cookie-notice/-/@ldc-web/cookie-notice-3.1.3.tgz",
|
||||
"integrity": "sha1-+VPwI1VOhD+nWZeutLhT+on02CU=",
|
||||
"version": "6.1.0",
|
||||
"resolved": "https://lab.s-web.fr/api/v4/projects/50/packages/npm/@ldc-web/cookie-notice/-/@ldc-web/cookie-notice-6.1.0.tgz",
|
||||
"integrity": "sha1-bzewvM6mGuWr3Ju8/HWkxXm60+A=",
|
||||
"dev": true
|
||||
},
|
||||
"node_modules/@nodelib/fs.scandir": {
|
||||
|
|
|
|||
|
|
@ -20,7 +20,7 @@
|
|||
"@fortawesome/free-regular-svg-icons": "^6.5.1",
|
||||
"@fortawesome/free-solid-svg-icons": "^6.5.1",
|
||||
"@fortawesome/vue-fontawesome": "^3.0.5",
|
||||
"@ldc-web/cookie-notice": "^3.1.2",
|
||||
"@ldc-web/cookie-notice": "^6.1.0",
|
||||
"@sipec/vue3-tags-input": "^3.0.4",
|
||||
"@types/bootstrap": "^5.2.7",
|
||||
"@types/node": "^20.8.2",
|
||||
|
|
|
|||
|
|
@ -1,26 +1,26 @@
|
|||
<?php
|
||||
|
||||
// * Version 3.1.2
|
||||
// phpcs:disable
|
||||
return [
|
||||
'button_customize_cookies' => 'Customize cookies',
|
||||
'button_close_cookies' => 'Close cookie window',
|
||||
'button_forbid' => 'Prohibit',
|
||||
'button_allow' => 'Allow',
|
||||
'button_forbid_all' => 'Reject all',
|
||||
'button_toggle_cookie' => 'Accept or refuse',
|
||||
'button_forbid_all' => 'Refuse all',
|
||||
'button_allow_all' => 'Accept all',
|
||||
'button_allow' => 'Accept',
|
||||
'button_forbid_all_title' => 'Refuse all cookies and close the cookies panel',
|
||||
'button_allow_all_title' => 'Accept all cookies and close the cookies panel',
|
||||
'button_customize' => 'Customize',
|
||||
'button_back' => 'Back',
|
||||
'button_validate_and_close' => 'Confirm and close',
|
||||
'button_title_open_new_tab' => 'Open link in new tab',
|
||||
'banner_title' => 'The :site_name website uses cookies!',
|
||||
'banner_text' => 'We use cookies to ensure the proper functioning of our site and for analytical purposes.
|
||||
You can change your mind at any time by clicking on the icon on any page of our site.
|
||||
By authorizing these third-party services, you agree to the deposit and reading of cookies and the use of tracking technologies necessary for their proper operation.',
|
||||
'panel_title' => 'Cookie management panel',
|
||||
'modal_title' => 'Cookie management window',
|
||||
'panel_content' => 'Cookie management panel content',
|
||||
'panel_subtitle' => 'Your privacy is our priority',
|
||||
'panel_details' => 'The functionalities of this site are based on services provided by third parties. If you accept, these third parties will deposit cookies that will enable you to view content on the site hosted by these third parties. Through these cookies, these third parties will collect and use your browsing data for their own purposes, in accordance with their privacy policy (link below). This page allows you to give or withdraw your consent, either globally or service by service.',
|
||||
'picture_cookie_title' => 'Image of a nice big cookie',
|
||||
'navigation_title' => 'Cookies panel navigation',
|
||||
'custom' => [
|
||||
'matomo' => [
|
||||
'title' => 'Matomo',
|
||||
|
|
@ -31,7 +31,8 @@ return [
|
|||
'title' => 'reCAPTCHA',
|
||||
'description' => 'The purpose of the cookies placed on forms via the recaptcha is to prevent them from being submitted by robots.',
|
||||
'labelLink' => 'Learn more',
|
||||
'warning' => 'You must accept cookies to send the form',
|
||||
'warning' => 'You must accept reCAPTCHA cookies to send the form',
|
||||
'accept' => 'Accept this cookie to use the forms'
|
||||
]
|
||||
]
|
||||
];
|
||||
|
|
|
|||
|
|
@ -1,37 +1,38 @@
|
|||
<?php
|
||||
|
||||
// * Version 3.1.2
|
||||
// phpcs:disable
|
||||
return [
|
||||
'button_customize_cookies' => 'Personnaliser les cookies',
|
||||
'button_close_cookies' => 'Fermer la fenêtre des cookies',
|
||||
'button_forbid' => 'Interdire',
|
||||
'button_allow' => 'Autoriser',
|
||||
'button_toggle_cookie' => 'Autoriser ou refuser',
|
||||
'button_forbid_all' => 'Tout refuser',
|
||||
'button_allow_all' => 'Tout accepter',
|
||||
'button_allow' => 'Autoriser',
|
||||
'button_forbid_all_title' => 'Refuser tous les cookies et fermer le panneau des cookies',
|
||||
'button_allow_all_title' => 'Accepter tous les cookies et fermer le panneau des cookies',
|
||||
'button_customize' => 'Personnaliser',
|
||||
'button_back' => 'Retour',
|
||||
'button_validate_and_close' => 'Valider et fermer',
|
||||
'button_title_open_new_tab' => 'Ouvrir le lien dans un nouvel onglet',
|
||||
'banner_title' => 'Le site internet :site_name utilise des cookies !',
|
||||
'banner_text' => 'Nous utilisons des cookies pour nous assurer du bon fonctionnement de notre site et à des fins analytiques.
|
||||
Vous pouvez changer d\'avis à tout moment en cliquant sur l\'icône présente sur chaque page de notre site.
|
||||
En autorisant ces services tiers, vous acceptez le dépôt et la lecture de cookies et l\'utilisation de technologies de suivi nécessaires à leur bon fonctionnement.',
|
||||
'panel_title' => 'Panneau de gestion des cookies',
|
||||
Vous pouvez changer d’avis à tout moment en cliquant sur l’icône présente sur chaque page de notre site.
|
||||
En autorisant ces services tiers, vous acceptez le dépôt et la lecture de cookies et l’utilisation de technologies de suivi nécessaires à leur bon fonctionnement.',
|
||||
'modal_title' => 'Fenêtre de gestion de cookies',
|
||||
'panel_content' => 'Contenu du panneau des cookies',
|
||||
'panel_subtitle' => 'Le respect de votre vie privée est notre priorité',
|
||||
'panel_details' => 'Les fonctionnalités de ce site s’appuient sur des services proposés par des tiers. Si vous acceptez, ces tiers déposeront des cookies qui vous permettront de visualiser sur le site du contenu hébergé par ces tiers. Via ces cookies, ces tiers collecteront et utiliseront vos données de navigation pour des finalités qui leur sont propres, conformément à leur politique de confidentialité (lien ci-dessous). Cette page vous permet de donner ou de retirer votre consentement, soit globalement soit service par service.',
|
||||
'picture_cookie_title' => 'Image d’un bon gros cookie',
|
||||
'navigation_title' => 'Navigation du panneau des cookies',
|
||||
'custom' => [
|
||||
'matomo' => [
|
||||
'title' => 'Matomo',
|
||||
'description' => 'Les services de mesure d\'audience permettent de générer des statistiques de fréquentation utiles à l\'amélioration du site.',
|
||||
'description' => 'Les services de mesure d’audience permettent de générer des statistiques de fréquentation utiles à l’amélioration du site.',
|
||||
'labelLink' => 'En apprendre plus',
|
||||
],
|
||||
'recaptcha' => [
|
||||
'title' => 'reCAPTCHA',
|
||||
'description' => 'Les cookies qui sont déposés via le recaptcha sur les formulaires ont pour finalité d\'empêcher que ceux-ci ne soient soumis par des robots.',
|
||||
'description' => 'Les cookies qui sont déposés via le recaptcha sur les formulaires ont pour finalité d’empêcher que ceux-ci ne soient soumis par des robots.',
|
||||
'labelLink' => 'En apprendre plus',
|
||||
'warning' => 'Vous devez accepter les cookies pour envoyer le formulaire',
|
||||
'warning' => 'Vous devez accepter les cookies reCAPTCHA pour envoyer le formulaire',
|
||||
'accept' => 'Acceptez ce cookie pour utiliser les formulaires'
|
||||
]
|
||||
]
|
||||
];
|
||||
|
|
|
|||
|
|
@ -210,18 +210,6 @@ document.addEventListener("DOMContentLoaded", function () {
|
|||
animateSeagull();
|
||||
}
|
||||
|
||||
// document.addEventListener("scroll", () => {
|
||||
// const seagullsScroll = document.getElementById("seagulls-scroll");
|
||||
// if (seagullsScroll) {
|
||||
// // Animate the seagulls on scroll
|
||||
// const seagullsOffset = Number.parseInt(String(seagullsScroll.dataset.offset ?? 16));
|
||||
// const percent = (- (100 * seagullsScroll.getBoundingClientRect().top / window.innerHeight - 100) );
|
||||
// if (percent > 0 && percent < 100) {
|
||||
// seagullsScroll.style.top = `calc(${percent}% - ${(seagullsOffset + seagullsScroll.getBoundingClientRect().height) * percent / 100}px)`;
|
||||
// }
|
||||
// }
|
||||
// });
|
||||
|
||||
// * Keyboard navigation for news slider
|
||||
const newsSlider = document.getElementById("swiper-news");
|
||||
if (newsSlider) {
|
||||
|
|
|
|||
|
|
@ -1,6 +1,8 @@
|
|||
import CookieNotice from "@ldc-web/cookie-notice";
|
||||
import axios from "axios";
|
||||
import * as bootstrap from "bootstrap";
|
||||
import bsTooltips from "./../../modules/bsTooltips";
|
||||
import recaptcha from "./../../modules/recaptcha";
|
||||
|
||||
/**
|
||||
* We'll load the axios HTTP library which allows us to easily issue requests
|
||||
|
|
@ -19,3 +21,6 @@ window.axios = axios;
|
|||
window.bootstrap = bootstrap;
|
||||
|
||||
bsTooltips.methods.initTooltips();
|
||||
|
||||
window.CookieNotice = CookieNotice;
|
||||
window.Recaptcha = recaptcha;
|
||||
|
|
|
|||
5
resources/ts/index.d.ts
vendored
5
resources/ts/index.d.ts
vendored
|
|
@ -2,6 +2,7 @@ export { };
|
|||
import CookieNotice from "@ldc-web/cookie-notice";
|
||||
import type VueTagsInput from "@sipec/vue3-tags-input";
|
||||
import { AxiosStatic } from "axios";
|
||||
import { type recaptcha } from "./modules/recaptcha";
|
||||
|
||||
// * Enum
|
||||
interface EnumInterface {
|
||||
|
|
@ -76,6 +77,10 @@ declare global {
|
|||
Swal: Function;
|
||||
vueDebug: boolean | undefined;
|
||||
CookieNotice: typeof CookieNotice;
|
||||
__CN_Recaptcha: Function;
|
||||
__CN_Recaptcha_Reset: Function;
|
||||
__CN_Recaptcha_Loaded: Function;
|
||||
Recaptcha: recaptcha;
|
||||
__SYSTEM: {
|
||||
_asset: string;
|
||||
_locale: string;
|
||||
|
|
|
|||
46
resources/ts/modules/recaptcha.ts
Normal file
46
resources/ts/modules/recaptcha.ts
Normal file
|
|
@ -0,0 +1,46 @@
|
|||
export default {
|
||||
methods: {
|
||||
// * Set recaptcha window variables and init it.
|
||||
init(forms: Array<HTMLFormElement>) {
|
||||
if(forms.length) {
|
||||
window.__CN_Recaptcha = function () {
|
||||
forms.map((form) => {
|
||||
if (!form.querySelector(".r_captcha > div")) {
|
||||
const newDiv = document.createElement("div");
|
||||
newDiv.classList.add("g-recaptcha");
|
||||
form.querySelector(".r_captcha")?.appendChild(newDiv);
|
||||
}
|
||||
form.inert = true;
|
||||
});
|
||||
(function(d, t) {
|
||||
const g = d.createElement(t) as HTMLIFrameElement,
|
||||
s = d.getElementsByTagName(t)[0];
|
||||
g.src = "https://www.google.com/recaptcha/api.js?render=explicit&onload=__CN_Recaptcha_Loaded";
|
||||
s.parentNode?.insertBefore(g, s);
|
||||
}(document, "script"));
|
||||
};
|
||||
window.__CN_Recaptcha_Reset = function() {
|
||||
forms.map((form) => {
|
||||
form.querySelector(".r_captcha > div")?.remove();
|
||||
form.inert = true;
|
||||
});
|
||||
};
|
||||
window.__CN_Recaptcha_Loaded = function() {
|
||||
forms.map((form) => {
|
||||
form.inert = false;
|
||||
if (form.querySelector(".r_captcha > div") !== null) {
|
||||
// @ts-ignore
|
||||
grecaptcha.render(document.querySelector(".r_captcha > div"), {
|
||||
"sitekey": form.dataset.recaptchaKey ?? ""
|
||||
});
|
||||
}
|
||||
});
|
||||
};
|
||||
// @ts-ignore
|
||||
if (window.WebCookieNotice.getCnCookieStatus("recaptcha") === "true") {
|
||||
window.__CN_Recaptcha();
|
||||
}
|
||||
}
|
||||
},
|
||||
},
|
||||
};
|
||||
|
|
@ -0,0 +1,41 @@
|
|||
<div data-cookie-name="recaptcha" @class([
|
||||
'fw-bold rounded-4 cn-cookie-activate d-flex flex-column flex-md-row mx-3 mb-3 mt-4 border p-3 text-start',
|
||||
'bg-white' => !$shouldBeDark,
|
||||
'bg-primary' => $shouldBeDark,
|
||||
])>
|
||||
<span class="d-flex flex-column w-md-75 w-100">
|
||||
<strong @class([
|
||||
'text-underline text-bold fs-5 mb-2',
|
||||
'text-primary' => !$shouldBeDark,
|
||||
'text-tertiary' => $shouldBeDark,
|
||||
])>
|
||||
{{ __('cookie-notice.custom.recaptcha.warning') }}
|
||||
</strong>
|
||||
<br><br>
|
||||
<small @class([
|
||||
'fw-normal fs-5',
|
||||
'text-success' => !$shouldBeDark,
|
||||
'text-white' => $shouldBeDark,
|
||||
])>
|
||||
{{ __('cookie-notice.custom.recaptcha.accept') }}
|
||||
</small>
|
||||
</span>
|
||||
<button id="recaptcha-accept" @class([
|
||||
'btn btn-primary w-lg-25 h-50 fs-5 rounded-4 mt-md-0 mt-3 border-0',
|
||||
'btn-primary' => !$shouldBeDark,
|
||||
'btn-white' => $shouldBeDark,
|
||||
])>
|
||||
{{ __('cookie-notice.button_allow') }}
|
||||
</button>
|
||||
</div>
|
||||
|
||||
@push('scripts')
|
||||
<script nonce="{{ $nonce }}">
|
||||
document.addEventListener('DOMContentLoaded', function() {
|
||||
document.getElementById("recaptcha-accept")?.addEventListener("click", function(e) {
|
||||
e.preventDefault();
|
||||
window.WebCookieNotice.acceptCookie("recaptcha");
|
||||
});
|
||||
});
|
||||
</script>
|
||||
@endpush
|
||||
|
|
@ -2,8 +2,7 @@
|
|||
|
||||
@section('title', __($staticPageModel->seo_title))
|
||||
@section('description', __($staticPageModel->seo_description))
|
||||
@section('breadcrumb',
|
||||
request()->route()->getName())
|
||||
@section('breadcrumb', request()->route()->getName())
|
||||
|
||||
@section('main-bg-class', 'bg-textured')
|
||||
|
||||
|
|
@ -15,7 +14,12 @@
|
|||
<img class="img-fluid flex-shrink-1 mb-3 flex-grow-0"
|
||||
src="{{ Vite::asset('resources/assets/images/global/underline-yellow.svg') }}" alt="{{ __('Trait souligné') }}">
|
||||
|
||||
<form method="POST" action="{{ route('fo.register') }}">
|
||||
<div class="px-xl-3">
|
||||
<x-fo.contact.need-recaptcha-banner :shouldBeDark="true" />
|
||||
</div>
|
||||
|
||||
<form class="recaptcha-form" data-recaptcha-key="{{ config('services.google.recaptcha.public') }}" inert
|
||||
enctype="multipart/form-data" method="POST" action="{{ route('fo.register') }}">
|
||||
@csrf
|
||||
|
||||
<fieldset class="container-fluid p-md-5 pt-md-1">
|
||||
|
|
@ -51,6 +55,16 @@
|
|||
<div class="invalid-feedback d-block">{{ $message }}</div>
|
||||
@endforeach
|
||||
</div>
|
||||
|
||||
<div class="col col-md-8 text-primary lh-sm px-0 py-2">
|
||||
<p>
|
||||
{{ __('Les informations recueillies à partir de ce formulaire sont traitées par le Responsable de Traitement pour la création de votre compte utilisateur. Pour connaître vos droits, vous pouvez consulter la') }}
|
||||
<a href="{{ route('fo.policies.show') }}"
|
||||
title="{{ __('Accéder à la Charte de confidentialité') }}">{{ __('Charte de confidentialité') }}</a>
|
||||
</p>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="row justify-content-center mb-3">
|
||||
|
|
@ -59,6 +73,18 @@
|
|||
</div>
|
||||
</div>
|
||||
|
||||
{{-- RECAPTCHA --}}
|
||||
<div class="col-12 text-center">
|
||||
<div class="d-flex flex-column justify-content-center align-items-center my-3">
|
||||
<div class="r_captcha"></div>
|
||||
@if ($errors->has('g-recaptcha-response'))
|
||||
<div class="mb-6">
|
||||
<span class="text-danger">{{ $errors->first('g-recaptcha-response') }}</span>
|
||||
</div>
|
||||
@endif
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row justify-content-center mb-3">
|
||||
<div class="col col-md-10 col-lg-8 mb-2 py-2 text-end">
|
||||
<button class="btn btn-primary text-tertiary btn-lg rounded-0 px-5 py-2" type="submit">
|
||||
|
|
|
|||
|
|
@ -81,7 +81,7 @@
|
|||
<div class="col d-flex flex-column d-sm-block">
|
||||
<span class="text-secondary">©2023 Tre Galette</span>
|
||||
<a class="text-secondary" href="{{ route('fo.legals.show') }}"
|
||||
title="{{ __('Aller sur la page mentions légales') }}">{{ __('Mentions légales') }}</a>
|
||||
title="{{ __('Aller sur la page mentions légales et CGU') }}">{{ __('Mentions légales et CGU') }}</a>
|
||||
<a class="text-secondary" href="{{ route('fo.policies.show') }}"
|
||||
title="{{ __('Aller sur la page politique de confidentialités') }}">{{ __('Politique de confidentialités') }}</a>
|
||||
<a class="text-secondary cn-cookie-link" href="#" title="{{ __('Afficher le panneau de gestion des cookies') }}"
|
||||
|
|
|
|||
|
|
@ -2,8 +2,7 @@
|
|||
|
||||
@section('title', __($staticPageModel->seo_title))
|
||||
@section('description', __($staticPageModel->seo_description))
|
||||
@section('breadcrumb',
|
||||
request()->route()->getName())
|
||||
@section('breadcrumb', request()->route()->getName())
|
||||
|
||||
@section('main-bg-class', 'has-banner')
|
||||
|
||||
|
|
@ -78,7 +77,10 @@
|
|||
</div>
|
||||
@endif
|
||||
|
||||
<form id="contact-page-form" method="POST" action="{{ route('fo.contact-submit') }}" enctype="multipart/form-data">
|
||||
<x-fo.contact.need-recaptcha-banner :shouldBeDark="false" />
|
||||
|
||||
<form class="recaptcha-form" id="contact-page-form" data-recaptcha-key="{{ config('services.google.recaptcha.public') }}" inert
|
||||
method="POST" action="{{ route('fo.contact-submit') }}" enctype="multipart/form-data">
|
||||
@csrf
|
||||
|
||||
<fieldset class="container-fluid p-md-5 pt-md-1 pb-md-0">
|
||||
|
|
@ -270,25 +272,14 @@
|
|||
</div>
|
||||
|
||||
<div class="row">
|
||||
{{-- TERMS --}}
|
||||
<div class="col-12 col-md-8 py-2">
|
||||
<div class="d-flex">
|
||||
<input
|
||||
class="form-check-input border-tertiary @if ($errors->has('terms')) is-invalid @endif mx-auto me-1"
|
||||
id="terms" name="terms" type="checkbox" value="1"
|
||||
aria-label="{{ __('validation.attributes.terms') }}" autocomplete="disabled" required />
|
||||
<label class="form-check-label ms-1" for="terms">*
|
||||
{{ Str::ucfirst(__('Les informations recueillies à partir de ce formulaire sont traitées par le Responsable de Traitement pour donner suite à votre demande de contact. Pour connaître vos droits, vous pouvez consulter la')) }}
|
||||
<a class="text-white" href="{{ route('fo.policies.show') }}"
|
||||
target="_blank">{{ __('Charte de confidentialité') }}</a>.</label>
|
||||
</div>
|
||||
@foreach ($errors->get('terms') as $message)
|
||||
<div class="invalid-feedback d-block">{{ $message }}</div>
|
||||
@endforeach
|
||||
</div>
|
||||
<p>
|
||||
{{ __('Les informations recueillies à partir de ce formulaire sont traitées par le Responsable de Traitement pour donner suite à votre demande de contact. Pour connaître vos droits, vous pouvez consulter la') }}
|
||||
<a class="text-white" href="{{ route('fo.policies.show') }}"
|
||||
title="{{ __('Accéder à la Charte de confidentialité') }}">{{ __('Charte de confidentialité') }}</a>
|
||||
</p>
|
||||
|
||||
{{-- FILE --}}
|
||||
<div class="col-12 col-md-4 py-2">
|
||||
<div class="col-12 col-md-4 mx-auto py-2">
|
||||
<div class="mb-3">
|
||||
<label class="btn btn-lg btn-tertiary f-intro-head-b-base px-3 py-2" id="fileAddon" for="file"
|
||||
role="button" tabindex="0">
|
||||
|
|
@ -314,23 +305,21 @@
|
|||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row mb-3" id="recaptcha-warning">
|
||||
<div class="col text-center">
|
||||
<strong
|
||||
class="text-danger">{{ __('Vous devez activer les cookies recaptcha pour utiliser le formulaire de contact.') }}</strong>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row mb-3">
|
||||
<div class="col d-flex justify-content-center">
|
||||
<div id="r_captcha"></div>
|
||||
{{-- RECAPTCHA --}}
|
||||
<div class="col-12 text-center">
|
||||
<div class="d-flex flex-column justify-content-center align-items-center my-3">
|
||||
<div class="r_captcha"></div>
|
||||
@if ($errors->has('g-recaptcha-response'))
|
||||
<div class="mb-6">
|
||||
<span class="text-danger">{{ $errors->first('g-recaptcha-response') }}</span>
|
||||
</div>
|
||||
@endif
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row" id="submit-btn-row">
|
||||
<div class="col text-center">
|
||||
<button class="g-recaptcha btn btn-tertiary btn-lg rounded-0 fs-4 px-5 py-3"
|
||||
data-sitekey="{{ config('services.google.recaptcha.public') }}" type="submit" render="explicit">
|
||||
<button class="btn btn-tertiary btn-lg rounded-0 fs-4 px-5 py-3" type="submit" render="explicit">
|
||||
{{ __('Envoyer') }}
|
||||
</button>
|
||||
</div>
|
||||
|
|
@ -344,25 +333,3 @@
|
|||
</div>
|
||||
</div>
|
||||
@endsection
|
||||
|
||||
@push('scripts')
|
||||
<script nonce="{{ $nonce }}">
|
||||
document.addEventListener('DOMContentLoaded', function() {
|
||||
window.__CN_Recaptcha = function() {
|
||||
(function(d, t) {
|
||||
let g = d.createElement(t),
|
||||
s = d.getElementsByTagName(t)[0];
|
||||
g.src = 'https://www.google.com/recaptcha/api.js?render=explicit&onload=__CN_Recaptcha_Loaded';
|
||||
s.parentNode.insertBefore(g, s)
|
||||
}(document, 'script'));
|
||||
};
|
||||
window.__CN_Recaptcha_Loaded = function() {
|
||||
grecaptcha.render('r_captcha', {
|
||||
'sitekey': '{{ config('services.google.recaptcha.public') }}'
|
||||
});
|
||||
document.getElementById('recaptcha-warning').remove();
|
||||
document.getElementById('contact-page-form').inert = false;
|
||||
};
|
||||
});
|
||||
</script>
|
||||
@endpush
|
||||
|
|
|
|||
56
resources/views/vendor/cn-cookies.blade.php
vendored
56
resources/views/vendor/cn-cookies.blade.php
vendored
|
|
@ -7,37 +7,43 @@ $logo_title_text = __('Logo du site :name', ['name' => $site_name]);
|
|||
$logo_alt_text = __('Logo :name', ['name' => $site_name]);
|
||||
|
||||
$strings = (object)[
|
||||
'modal_title' => __('Fenêtre de gestion de cookies'),
|
||||
'modal_title' => __('cookie-notice.modal_title'),
|
||||
'button_customize_cookies' => __('cookie-notice.button_customize_cookies'),
|
||||
'button_close_cookies' => __('cookie-notice.button_close_cookies'),
|
||||
'button_title_open_new_tab' => __('Ouvrir le lien dans un nouvel onglet'),
|
||||
'button_forbid' => __('cookie-notice.button_forbid'),
|
||||
'button_allow' => __('cookie-notice.button_allow'),
|
||||
'button_forbid_all' => Str::upper(__('cookie-notice.button_forbid_all')),
|
||||
'button_allow_all' => Str::upper(__('cookie-notice.button_allow_all')),
|
||||
'button_customize' => Str::upper(__('cookie-notice.button_customize')),
|
||||
'button_title_open_new_tab' => __('cookie-notice.button_title_open_new_tab'),
|
||||
'button_toggle_cookie' => __('cookie-notice.button_toggle_cookie'),
|
||||
'button_forbid_all' => str(__('cookie-notice.button_forbid_all'))->upper(),
|
||||
'button_allow_all' => str(__('cookie-notice.button_allow_all'))->upper(),
|
||||
'button_customize' => str(__('cookie-notice.button_customize'))->upper(),
|
||||
'button_forbid_all_title' => __('cookie-notice.button_forbid_all_title'),
|
||||
'button_allow_all_title' => __('cookie-notice.button_allow_all_title'),
|
||||
'button_back' => Str::upper(__('cookie-notice.button_back')),
|
||||
'button_validate_and_close' => str(__('cookie-notice.button_validate_and_close'))->upper(),
|
||||
'banner_title' => __('cookie-notice.banner_title', ['site_name' => $site_name]),
|
||||
'banner_text' => __('cookie-notice.banner_text'),
|
||||
'banner_text' => sprintf(
|
||||
"%s<br><br>%s",
|
||||
"Nous utilisons des cookies pour nous assurer du bon fonctionnement de notre site et à des fins analytiques. Vous pouvez changer d'avis à tout moment en cliquant sur l'icône présente sur chaque page de notre site. En autorisant ces services tiers, vous acceptez le dépôt et la lecture de cookies et l'utilisation de technologies de suivi nécessaires à leur bon fonctionnement.",
|
||||
sprintf(
|
||||
"<a href=\"%s\">Charte de confidentialité</a>",
|
||||
route('fo.policies.show')
|
||||
)
|
||||
),
|
||||
'panel_title' => __('cookie-notice.panel_title'),
|
||||
'panel_content' => __('cookie-notice.panel_content'),
|
||||
'panel_subtitle' => __('cookie-notice.panel_subtitle'),
|
||||
'panel_details' => __('cookie-notice.panel_details'),
|
||||
'picture_cookie_title' => __('Image d\'un bon gros cookie'),
|
||||
'navigation_title' => __('Navigation du panneau des cookie'),
|
||||
'picture_cookie_title' => __('cookie-notice.picture_cookie_title'),
|
||||
'navigation_title' => __('cookie-notice.navigation_title'),
|
||||
];
|
||||
|
||||
$cookies = [];
|
||||
|
||||
// RECAPTCHA
|
||||
$cookies['recaptcha'] = [
|
||||
'name' => __('cookie-notice.custom.recaptcha.title'),
|
||||
'description' => __('cookie-notice.custom.recaptcha.description'),
|
||||
'link' => 'https://policies.google.com/privacy',
|
||||
'labelLink' => __('En savoir +'),
|
||||
'cookies' => ['NID', '__Secure-3PAPISID', '__Secure-3PSID', '__Secure-3PSIDCC']
|
||||
'name' => __('cookie-notice.custom.recaptcha.title'),
|
||||
'description' => __('cookie-notice.custom.recaptcha.description'),
|
||||
'link' => 'https://policies.google.com/privacy',
|
||||
'labelLink' => __('En savoir +'),
|
||||
'cookies' => ['NID', '__Secure-3PAPISID', '__Secure-3PSID', '__Secure-3PSIDCC']
|
||||
];
|
||||
|
||||
$cookies['recaptcha']['script'] = <<<SCRIPT
|
||||
|
|
@ -45,8 +51,25 @@ function () {
|
|||
if (window.__CN_Recaptcha) {
|
||||
window.__CN_Recaptcha();
|
||||
}
|
||||
[...document.getElementsByClassName('cn-cookie-activate')].forEach(function(el) {
|
||||
if (el.dataset.cookieName === 'recaptcha') {
|
||||
el.classList.add('d-none');
|
||||
}
|
||||
});
|
||||
}
|
||||
SCRIPT;
|
||||
$cookies['recaptcha']['fallback'] = <<<FALLBACK
|
||||
function () {
|
||||
if (window.__CN_Recaptcha_Reset) {
|
||||
window.__CN_Recaptcha_Reset();
|
||||
}
|
||||
[...document.getElementsByClassName('cn-cookie-activate')].forEach(function(el) {
|
||||
if (el.dataset.cookieName === 'recaptcha') {
|
||||
el.classList.remove('d-none');
|
||||
}
|
||||
});
|
||||
}
|
||||
FALLBACK;
|
||||
|
||||
// MATOMO
|
||||
$cookies['matomo'] = [
|
||||
|
|
@ -106,6 +129,7 @@ document.addEventListener('DOMContentLoaded', function () {
|
|||
window.WebCookieNotice['{{ $index_name }}'] = window.WebCookieNotice['{{ $index_name }}'].conf;
|
||||
@endforeach
|
||||
window.WebCookieNotice = new window.CookieNotice(window.WebCookieNotice);
|
||||
window.Recaptcha.methods.init([].slice.call(document.querySelectorAll(".recaptcha-form")));
|
||||
});
|
||||
</script>
|
||||
@endpush
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
<div class="position-relative" id="cn-wrapper" title="{{ $strings->modal_title }}" role="alertdialog" tabindex="-1">
|
||||
<div id="cn-wrapper" title="{{ $strings->modal_title }}" role="alertdialog" tabindex="-1">
|
||||
<button id="cn-cookie-btn" title="{{ $strings->button_customize_cookies }}">
|
||||
{{-- COOKIE SVG --}}
|
||||
<svg viewBox="0 0 28 28" xmlns="http://www.w3.org/2000/svg">
|
||||
|
|
@ -30,18 +30,15 @@
|
|||
</div>
|
||||
<div class="cn-banner-text">
|
||||
<div class="cn-banner-title">
|
||||
<span class="fw-normal">{!! nl2br(e($strings->banner_title)) !!}</span>
|
||||
<span>{!! nl2br(e($strings->banner_title)) !!}</span>
|
||||
</div>
|
||||
<div class="cn-banner-para-p">
|
||||
<p>{!! nl2br(e($strings->banner_text)) !!}</p>
|
||||
<p>{!! clean($strings->banner_text) !!}</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{{-- 2ND PAGE CUSTOMIZE PANEL --}}
|
||||
<div class="cn-modal-container d-none">
|
||||
<p class="cn-modal-title" aria-level="h2">{{ $strings->panel_title }}</p>
|
||||
<p class="cn-modal-subtitle">{!! nl2br(e($strings->panel_subtitle)) !!}</p>
|
||||
<p class="cn-modal-description">{!! nl2br(e($strings->panel_details)) !!}</p>
|
||||
<div class="cn-modal-wrapper">
|
||||
{{-- COOKIES LIST --}}
|
||||
<ul id="cn-modal-list"></ul>
|
||||
|
|
@ -54,7 +51,7 @@
|
|||
title="{{ $strings->button_forbid_all_title }}">{{ $strings->button_forbid_all }}</button>
|
||||
<button class="cn-banner-btn cn-accept" id="cn-accept-banner"
|
||||
title="{{ $strings->button_allow_all_title }}">{{ $strings->button_allow_all }}</button>
|
||||
<button class="cn-banner-btn cn-custom" id="cn-settings-banner" data-open-modal="{{ $strings->button_back }}"
|
||||
<button class="cn-banner-btn cn-custom" id="cn-settings-banner" data-open-modal="{{ $strings->button_validate_and_close }}"
|
||||
data-close-modal="{{ $strings->button_customize }}">{{ $strings->button_customize }}</button>
|
||||
</div>
|
||||
|
||||
|
|
@ -67,14 +64,11 @@
|
|||
<a class="cn-cookie-link" title="{{ $strings->button_title_open_new_tab }}" target="blank">#link</a>
|
||||
</div>
|
||||
<div class="cn-cookie-buttons">
|
||||
<div class="deny">
|
||||
<input id="" name="" data-name="" data-status="false" type="radio">
|
||||
<label for="" role="button" tabindex="0">{{ $strings->button_forbid }}</label>
|
||||
</div>
|
||||
<div class="accept">
|
||||
<input id="" name="" data-name="" data-status="true" type="radio">
|
||||
<label for="" role="button" tabindex="0">{{ $strings->button_allow }}</label>
|
||||
</div>
|
||||
<label class="cn-switch" title="{{ $strings->button_toggle_cookie }}" role="checkbox"
|
||||
aria-label="{{ $strings->button_toggle_cookie }}" aria-checked="undefined" tabindex="0">
|
||||
<input type="checkbox" tabindex="-1" />
|
||||
<span></span>
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue