Merge branch 'newsletter' into 'develop'
feat: ✨ newsletter / image-cropper / scripts / 404
See merge request ldc-web/projets/ldc!126
This commit is contained in:
commit
8d5636e55e
19 changed files with 522 additions and 77 deletions
|
|
@ -2,6 +2,7 @@
|
|||
|
||||
namespace App\Http\Controllers\Front;
|
||||
|
||||
use App\Http\Requests\Front\SingleOptinRequest;
|
||||
use App\Http\Requests\Front\UnsubscribeNewsletterRequest;
|
||||
use Illuminate\Support\Facades\Log;
|
||||
use LDC\LDCCRM\Enums\ApiError;
|
||||
|
|
@ -63,4 +64,30 @@ class HomeController extends Controller
|
|||
}
|
||||
return view('front.pages.newsletter-unsubscribe');
|
||||
}
|
||||
|
||||
/**
|
||||
* Call the CRM to add a single optin
|
||||
*
|
||||
* @param \App\Http\Requests\Fo\SingleOptinRequest $request
|
||||
* @return string|array|null|\Illuminate\Contracts\Translation\Translator
|
||||
* @throws \LDC\LDCCRM\Exceptions\ValidationException ValidationException.
|
||||
* @throws \Illuminate\Contracts\Container\BindingResolutionException BindingResolutionException.
|
||||
*/
|
||||
public function addOptIn(SingleOptinRequest $request)
|
||||
{
|
||||
try {
|
||||
SingleOptin::setStatus($request->email, true);
|
||||
return \response(trans("Votre inscription à la newsletter a été prise en compte"), 200);
|
||||
} catch (ApiErrorException $e) {
|
||||
// Il y a deja un customerInfo avec optin a true pour ce customer.
|
||||
if ($e->getApiError()->equals(ApiError::singleOptinCustomerExists)) {
|
||||
return trans('Vous êtes déjà inscrit avec cette adresse email');
|
||||
}
|
||||
\report($e);
|
||||
return \response(trans('Une erreur est survenue, merci de réessayer ultérieurement'), 404);
|
||||
} catch (CrmException $e) {
|
||||
\report($e);
|
||||
return \response(trans('Une erreur est survenue, merci de réessayer ultérieurement'), 404);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
20
app/Http/Requests/Front/SingleOptinRequest.php
Normal file
20
app/Http/Requests/Front/SingleOptinRequest.php
Normal file
|
|
@ -0,0 +1,20 @@
|
|||
<?php
|
||||
|
||||
namespace App\Http\Requests\Front;
|
||||
|
||||
use Illuminate\Foundation\Http\FormRequest;
|
||||
|
||||
class SingleOptinRequest extends FormRequest
|
||||
{
|
||||
/**
|
||||
* Get the validation rules that apply to the request.
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function rules(): array
|
||||
{
|
||||
return [
|
||||
'email' => 'required|email:rfc,dns,spoof',
|
||||
];
|
||||
}
|
||||
}
|
||||
|
|
@ -14,8 +14,8 @@ return [
|
|||
"description" => "Désolé, vous n’êtes pas autorisé à accéder à cette page.",
|
||||
],
|
||||
"404" => [
|
||||
"title" => "Page introuvable",
|
||||
"description" => "Désolé, la page que vous recherchez est introuvable.",
|
||||
"title" => "VOUS ÊTES PERDU ?",
|
||||
"description" => "Erreur 404, malheureusement cette page n'existe pas ou n'existe plus.",
|
||||
],
|
||||
"405" => [
|
||||
"title" => "Méthode non autorisée",
|
||||
|
|
|
|||
|
|
@ -4,7 +4,7 @@ return [
|
|||
"multiple_choice" => 'choix multiple',
|
||||
"required_field" => 'champs obligatoires',
|
||||
"go_to_the_back_end" => "accéder au back-office",
|
||||
"back_to_homepage" => "Revenir à la page d'accueil",
|
||||
"back_to_homepage" => "Retour à la page d'accueil",
|
||||
"homepage" => "LDC",
|
||||
"nos-engagements" => "nos engagements",
|
||||
"nos-engagements" => [
|
||||
|
|
|
|||
|
|
@ -5,3 +5,6 @@
|
|||
|
||||
// * VENDOR
|
||||
@use './vendor/cookie-notice';
|
||||
|
||||
// * BASE
|
||||
@use './base/common';
|
||||
|
|
|
|||
16
resources/sass/front/base/_common.scss
Normal file
16
resources/sass/front/base/_common.scss
Normal file
|
|
@ -0,0 +1,16 @@
|
|||
#newsletter-message {
|
||||
|
||||
margin: 6px 0;
|
||||
|
||||
&.text-success {
|
||||
color: green;
|
||||
}
|
||||
|
||||
&.text-danger {
|
||||
color: red;
|
||||
}
|
||||
|
||||
&.d-none {
|
||||
display: none;
|
||||
}
|
||||
}
|
||||
|
|
@ -36,6 +36,7 @@ type CompleteInputFileProps = FileValidation & {
|
|||
parentErrors?: Record<string, string> | null,
|
||||
setData: (name: string, value: File | string | null) => void;
|
||||
reset: (name?: string) => void;
|
||||
hasFile?: (hasFile: boolean) => void;
|
||||
};
|
||||
/* eslint-enable no-unused-vars, @typescript-eslint/no-unused-vars */
|
||||
|
||||
|
|
@ -56,6 +57,7 @@ export default function CompleteInputFile(props: CompleteInputFileProps) {
|
|||
inputType = enumDynamicFieldTypes.image.value,
|
||||
fileName = "image",
|
||||
hasRefreshBtn = true,
|
||||
hasFile
|
||||
} = props;
|
||||
const { toast } = useToast();
|
||||
const { errors } = usePage().props;
|
||||
|
|
@ -67,7 +69,7 @@ export default function CompleteInputFile(props: CompleteInputFileProps) {
|
|||
return { preview: `${url}/${localData}` } as FileWithPreview;
|
||||
} return null;
|
||||
}
|
||||
const isRefreshDisabled = value != null && typeof value === 'string'
|
||||
const isRefreshDisabled = value != null && typeof value === 'string';
|
||||
|
||||
const [selectedFile, setSelectedFile] = useState<FileWithPreview | null>(
|
||||
() => {
|
||||
|
|
@ -168,6 +170,10 @@ export default function CompleteInputFile(props: CompleteInputFileProps) {
|
|||
// eslint-disable-next-line react-hooks/exhaustive-deps
|
||||
}, []);
|
||||
|
||||
useEffect(() => {
|
||||
hasFile?.(selectedFile ? true : false);
|
||||
}, [selectedFile, hasFile]);
|
||||
|
||||
// This error message for the useDropZone can not be used directly in the hook because or react hook error,
|
||||
// they have to be used as they actually are.
|
||||
const dropErrorMessages = {
|
||||
|
|
|
|||
|
|
@ -136,59 +136,90 @@ import { cn } from "@/lib/utils";
|
|||
* @return string
|
||||
*/
|
||||
function getCroppedImg(image: HTMLImageElement, crop: PixelCrop): string {
|
||||
const canvas = document.createElement("canvas");
|
||||
canvas.width = validationRules.width;
|
||||
canvas.height = validationRules.height;
|
||||
const ctx = canvas.getContext("2d")!;
|
||||
|
||||
const tmpCanvas = document.createElement("canvas");
|
||||
tmpCanvas.width = maxContainerWidth;
|
||||
tmpCanvas.height = maxContainerHeight;
|
||||
const tmpCtx = tmpCanvas.getContext("2d")!;
|
||||
|
||||
tmpCtx.save();
|
||||
|
||||
// Taille de l'image affichée avec zoom
|
||||
const displayedWidth = originalDimensions.width * scaleFactor * (1 + zoom);
|
||||
const displayedHeight = originalDimensions.height * scaleFactor * (1 + zoom);
|
||||
|
||||
// Coin supérieur gauche réel après zoom
|
||||
const offsetX = imagePosition.x - (displayedWidth - originalDimensions.width * scaleFactor) / 2;
|
||||
const offsetY = imagePosition.y - (displayedHeight - originalDimensions.height * scaleFactor) / 2;
|
||||
|
||||
// Déplacer au centre pour rotation + flip
|
||||
tmpCtx.translate(offsetX + displayedWidth / 2, offsetY + displayedHeight / 2);
|
||||
tmpCtx.rotate((rotation * Math.PI) / 180);
|
||||
tmpCtx.scale(flipX ? -1 : 1, flipY ? -1 : 1);
|
||||
|
||||
// Appliquer les filtres
|
||||
tmpCtx.filter = `brightness(${brightness}%) contrast(${contrast}%) saturate(${saturation}%) sepia(${sepia}%) grayscale(${grayscale}%)`;
|
||||
|
||||
// Dessiner l'image centrée
|
||||
tmpCtx.drawImage(
|
||||
image,
|
||||
-displayedWidth / 2,
|
||||
-displayedHeight / 2,
|
||||
displayedWidth,
|
||||
displayedHeight
|
||||
);
|
||||
|
||||
tmpCtx.restore();
|
||||
|
||||
// Extraire la zone cropée visible
|
||||
ctx.drawImage(
|
||||
tmpCanvas,
|
||||
crop.x,
|
||||
crop.y,
|
||||
crop.width,
|
||||
crop.height,
|
||||
0,
|
||||
0,
|
||||
canvas.width,
|
||||
canvas.height
|
||||
);
|
||||
|
||||
return canvas.toDataURL("image/png");
|
||||
const canvas = document.createElement("canvas");
|
||||
canvas.width = validationRules.width;
|
||||
canvas.height = validationRules.height;
|
||||
const ctx = canvas.getContext("2d")!;
|
||||
|
||||
// Calculer le ratio entre l'affichage et les dimensions originales
|
||||
const displayScale = scaleFactor * (1 + zoom);
|
||||
|
||||
// Position de l'image affichée avec zoom
|
||||
const displayedWidth = originalDimensions.width * displayScale;
|
||||
const displayedHeight = originalDimensions.height * displayScale;
|
||||
const offsetX = imagePosition.x - (displayedWidth - originalDimensions.width * scaleFactor) / 2;
|
||||
const offsetY = imagePosition.y - (displayedHeight - originalDimensions.height * scaleFactor) / 2;
|
||||
|
||||
// Centre de l'image dans le container d'affichage
|
||||
const imageCenterX = offsetX + displayedWidth / 2;
|
||||
const imageCenterY = offsetY + displayedHeight / 2;
|
||||
|
||||
// Centre du crop dans le container d'affichage
|
||||
const cropCenterX = crop.x + crop.width / 2;
|
||||
const cropCenterY = crop.y + crop.height / 2;
|
||||
|
||||
// Distance du centre du crop au centre de l'image (en pixels d'affichage)
|
||||
const deltaX = cropCenterX - imageCenterX;
|
||||
const deltaY = cropCenterY - imageCenterY;
|
||||
|
||||
// Calculer le ratio de qualité : on veut travailler à la résolution originale
|
||||
// Le ratio est : taille originale / taille affichée
|
||||
const qualityRatio = 1 / displayScale;
|
||||
|
||||
// Taille du canvas temporaire basée sur la résolution originale de la zone croppée
|
||||
// On limite toutefois pour éviter des canvas trop grands (max 4x la taille finale)
|
||||
const maxRatio = Math.min(qualityRatio, 4);
|
||||
const tmpWidth = Math.ceil(crop.width / displayScale);
|
||||
const tmpHeight = Math.ceil(crop.height / displayScale);
|
||||
|
||||
// Créer un canvas temporaire à haute résolution
|
||||
const tmpCanvas = document.createElement("canvas");
|
||||
tmpCanvas.width = tmpWidth;
|
||||
tmpCanvas.height = tmpHeight;
|
||||
const tmpCtx = tmpCanvas.getContext("2d")!;
|
||||
|
||||
tmpCtx.save();
|
||||
|
||||
// Appliquer les filtres
|
||||
tmpCtx.filter = `brightness(${brightness}%) contrast(${contrast}%) saturate(${saturation}%) sepia(${sepia}%) grayscale(${grayscale}%)`;
|
||||
|
||||
// Translater au centre du canvas temporaire
|
||||
tmpCtx.translate(tmpWidth / 2, tmpHeight / 2);
|
||||
|
||||
// Appliquer rotation et flip
|
||||
tmpCtx.rotate((rotation * Math.PI) / 180);
|
||||
tmpCtx.scale(flipX ? -1 : 1, flipY ? -1 : 1);
|
||||
|
||||
// Calculer où dessiner l'image pour que la zone croppée soit centrée
|
||||
// deltaX/deltaY sont en pixels d'affichage, on les convertit en pixels originaux
|
||||
const originalDeltaX = deltaX / displayScale;
|
||||
const originalDeltaY = deltaY / displayScale;
|
||||
|
||||
// Dessiner l'image originale à sa pleine résolution
|
||||
tmpCtx.drawImage(
|
||||
image,
|
||||
-originalDimensions.width / 2 - originalDeltaX,
|
||||
-originalDimensions.height / 2 - originalDeltaY,
|
||||
originalDimensions.width,
|
||||
originalDimensions.height
|
||||
);
|
||||
|
||||
tmpCtx.restore();
|
||||
|
||||
// Redimensionner vers la taille finale en une seule opération
|
||||
ctx.drawImage(
|
||||
tmpCanvas,
|
||||
0,
|
||||
0,
|
||||
tmpWidth,
|
||||
tmpHeight,
|
||||
0,
|
||||
0,
|
||||
canvas.width,
|
||||
canvas.height
|
||||
);
|
||||
|
||||
return canvas.toDataURL("image/png");
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -1,7 +1,22 @@
|
|||
import "../../sass/front/app.scss";
|
||||
import Chart from 'chart.js/auto';
|
||||
import axios from "axios";
|
||||
|
||||
axios.defaults.headers.common = {
|
||||
Accept: "application/json, text/plain, */*",
|
||||
"X-Requested-With": "XMLHttpRequest",
|
||||
"X-CSRF-TOKEN": document
|
||||
.querySelector("meta[name=\"csrf-token\"]")!
|
||||
.getAttribute("content"),
|
||||
};
|
||||
|
||||
window.axios = axios;
|
||||
|
||||
|
||||
// COOKIES
|
||||
import CookieNotice from "@ldc-web/cookie-notice";
|
||||
window.CookieNotice = CookieNotice;
|
||||
window.Chart = Chart;
|
||||
|
||||
// LOCAL IMPORTS
|
||||
import "./base/common";
|
||||
|
|
|
|||
48
resources/ts/front/base/common.ts
Normal file
48
resources/ts/front/base/common.ts
Normal file
|
|
@ -0,0 +1,48 @@
|
|||
import route from "../modules/route";
|
||||
|
||||
const laravelRoute = route.methods.route;
|
||||
|
||||
document.addEventListener("DOMContentLoaded", function () {
|
||||
// * NEWSLETTER
|
||||
const newsletterSubmitBtn = document.getElementById("newsletter-submit");
|
||||
const newsletterEmailInput = document.getElementById("newsletter-email") as HTMLInputElement;
|
||||
const newsletterMessageDiv = document.getElementById("newsletter-message");
|
||||
if (newsletterSubmitBtn && newsletterEmailInput && newsletterMessageDiv) {
|
||||
// Submit the request
|
||||
newsletterSubmitBtn.addEventListener("click", function () {
|
||||
|
||||
const addSingleOptinRoute = laravelRoute("front.add-single-optin");
|
||||
if (addSingleOptinRoute === null) {
|
||||
return;
|
||||
}
|
||||
// Reset error field
|
||||
newsletterMessageDiv.classList.remove("text-success");
|
||||
newsletterMessageDiv.classList.remove("text-danger");
|
||||
newsletterMessageDiv.textContent = "";
|
||||
window.axios.post("/optin", {
|
||||
email: newsletterEmailInput.value,
|
||||
})
|
||||
.then(function (response) {
|
||||
newsletterMessageDiv.classList.remove("d-none");
|
||||
newsletterMessageDiv.classList.add("text-success");
|
||||
newsletterMessageDiv.textContent = String(response.data);
|
||||
newsletterEmailInput.value = "";
|
||||
})
|
||||
.catch(function (error) {
|
||||
newsletterMessageDiv.classList.remove("d-none");
|
||||
newsletterMessageDiv.classList.add("text-danger");
|
||||
if (error.response.status == 422) {
|
||||
const errors = error.response.data.errors;
|
||||
for (const errorKey in errors) {
|
||||
const errorP = document.createElement("p");
|
||||
errorP.classList.add("m-0");
|
||||
errorP.textContent = errors[errorKey];
|
||||
newsletterMessageDiv.appendChild(errorP);
|
||||
}
|
||||
} else {
|
||||
newsletterMessageDiv.textContent = error.response.data;
|
||||
}
|
||||
});
|
||||
});
|
||||
}
|
||||
});
|
||||
12
resources/ts/front/index.d.ts
vendored
Normal file
12
resources/ts/front/index.d.ts
vendored
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
import type CookieNotice from "@ldc-web/cookie-notice";
|
||||
import { Chart } from "chart.js";
|
||||
|
||||
declare global {
|
||||
interface Window {
|
||||
CookieNotice: typeof CookieNotice;
|
||||
Chart: typeof Chart;
|
||||
__SYSTEM: {
|
||||
_routes: Record<string, string>;
|
||||
};
|
||||
}
|
||||
}
|
||||
97
resources/ts/front/modules/route.ts
Normal file
97
resources/ts/front/modules/route.ts
Normal file
|
|
@ -0,0 +1,97 @@
|
|||
const route = {
|
||||
methods: {
|
||||
/**
|
||||
* Same behavior as laravel route
|
||||
*
|
||||
* ! window.__SYSTEM._routes has to be defined
|
||||
*
|
||||
* @param routeName The route name.
|
||||
* @param parameters Parameters, if a parameter name matches a route path level,
|
||||
* it will be replaced, otherwise it will appear in query.
|
||||
* @param keepActualQueries Pass this to keep current url queries.
|
||||
* @param keepActualHashes Pass this to keep current url fragments
|
||||
* @returns The newly formated string
|
||||
*/
|
||||
route(
|
||||
routeName: string,
|
||||
parameters: Record<
|
||||
string,
|
||||
string | number | Array<string | number>
|
||||
> = {},
|
||||
keepActualQueries: boolean = false,
|
||||
keepActualHashes: boolean = false
|
||||
): string | null {
|
||||
const routes = route.flattenProperties(window.__SYSTEM._routes);
|
||||
const routeUrl =
|
||||
Object.keys(routes).indexOf(routeName) !== -1
|
||||
? (routes[routeName] as string)
|
||||
: null;
|
||||
|
||||
// * Return null if route url could not be found
|
||||
if (!routeUrl) {
|
||||
return null;
|
||||
}
|
||||
|
||||
const queryParameters: Record<string, number | string> = {},
|
||||
url = new URL(window.location.origin),
|
||||
searchParams = new URL(String(window.location)).searchParams,
|
||||
hash = window.location.hash;
|
||||
let pathname = routeUrl.replace(origin, "");
|
||||
|
||||
// * Replace parameters in path name.
|
||||
for (const paramName in parameters) {
|
||||
const paramValue = String(parameters[paramName]);
|
||||
if (pathname.indexOf(paramName) !== -1) {
|
||||
// * Replace pathname part with parameter
|
||||
pathname = pathname.replace(paramName, paramValue);
|
||||
} else {
|
||||
// * push parameter to be in queries
|
||||
queryParameters[paramName] = paramValue;
|
||||
}
|
||||
}
|
||||
url.pathname = pathname;
|
||||
|
||||
// * Build query
|
||||
if (keepActualQueries) {
|
||||
// * Push actual queries
|
||||
for (const param of searchParams) {
|
||||
url.searchParams.set(param[0], param[1]);
|
||||
}
|
||||
}
|
||||
// * Push request queries
|
||||
for (const paramName in queryParameters) {
|
||||
url.searchParams.set(
|
||||
paramName,
|
||||
String(queryParameters[paramName])
|
||||
);
|
||||
}
|
||||
|
||||
if (keepActualHashes) {
|
||||
url.hash = hash;
|
||||
}
|
||||
|
||||
return String(url);
|
||||
},
|
||||
},
|
||||
flattenProperties(
|
||||
obj: Record<PropertyKey, unknown>,
|
||||
parent: string | null = null,
|
||||
res: Record<PropertyKey, unknown> = {}
|
||||
): Record<PropertyKey, unknown> {
|
||||
for (const key of Object.keys(obj)) {
|
||||
const propName = parent ? parent + "." + key : key;
|
||||
if (obj[key] instanceof Object) {
|
||||
route.flattenProperties(
|
||||
obj[key] as Record<PropertyKey, unknown>,
|
||||
propName,
|
||||
res
|
||||
);
|
||||
} else {
|
||||
res[propName] = obj[key];
|
||||
}
|
||||
}
|
||||
return res;
|
||||
},
|
||||
};
|
||||
|
||||
export default route;
|
||||
146
resources/views/components/front/page-404.blade.php
Normal file
146
resources/views/components/front/page-404.blade.php
Normal file
|
|
@ -0,0 +1,146 @@
|
|||
<div class="page-error">
|
||||
<div class="hero-static fw">
|
||||
<div class="hero-static__wrapper wrapper">
|
||||
<div class="lapki">
|
||||
<svg version="1.1" id="Pattes" xmlns="http://www.w3.org/2000/svg"
|
||||
xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" viewBox="0 0 268.8 400"
|
||||
style="enable-background:new 0 0 268.8 400;" xml:space="preserve">
|
||||
<path class="st1"
|
||||
d="M28.2,20.4L5.3,2C5.2,1.6,4.9,1.2,4.4,1C3.7,0.9,3.1,1.2,2.9,1.9C2.8,2.3,2.9,2.7,3.1,3L1,32.9
|
||||
c0,0.3,0.2,0.6,0.5,0.6c0,0,0.1,0,0.1,0c0.3,0,0.6-0.2,0.7-0.5l4.3-20.2L19.2,37c0.2,0.3,0.5,0.4,0.8,0.3c0.3-0.1,0.4-0.5,0.3-0.8
|
||||
l-9.5-25.3l16.7,10.2c0.3,0.2,0.6,0.1,0.8-0.2C28.5,21,28.5,20.6,28.2,20.4z">
|
||||
</path>
|
||||
<path class="st1"
|
||||
d="M62.4,33.9L42.7,12.1c-0.5,0-0.9-0.3-1-0.8c-0.2-0.6,0.1-1.3,0.8-1.5c0.4-0.1,0.8-0.1,1.1,0.2L73.2,6
|
||||
c0.3,0,0.6,0.1,0.7,0.4c0,0,0,0.1,0,0.1c0.1,0.3-0.1,0.6-0.4,0.7l-19.9,5.5l24.9,11.2c0.3,0.1,0.4,0.5,0.3,0.8
|
||||
C78.7,25,78.3,25.1,78,25l-25.8-8l11.2,16.1c0.2,0.3,0.1,0.6-0.1,0.8C63,34.2,62.6,34.1,62.4,33.9z">
|
||||
</path>
|
||||
<path class="st1"
|
||||
d="M79.2,66.3l-27-11.7c-0.2-0.4-0.6-0.7-1.1-0.7c-0.7,0-1.2,0.5-1.2,1.2c0,0.4,0.2,0.8,0.5,1l5.9,29.4
|
||||
c0.1,0.3,0.3,0.5,0.6,0.5c0,0,0.1,0,0.1,0c0.3,0,0.6-0.3,0.5-0.7l-1.2-20.6l18.6,20c0.2,0.2,0.6,0.3,0.8,0.1
|
||||
c0.3-0.2,0.3-0.6,0.1-0.8L60,62l18.8,5.4c0.3,0.1,0.6-0.1,0.8-0.4C79.7,66.7,79.5,66.4,79.2,66.3z">
|
||||
</path>
|
||||
|
||||
<path class="st1"
|
||||
d="M114.7,67.6L89.3,52.7c-0.5,0.1-0.9-0.1-1.2-0.5c-0.4-0.5-0.3-1.3,0.3-1.7c0.3-0.2,0.7-0.3,1.1-0.2l27.2-12.6
|
||||
c0.3-0.1,0.6,0,0.8,0.2c0,0,0,0,0,0.1c0.2,0.3,0.1,0.6-0.2,0.8L99.8,50l27.1,3.2c0.3,0,0.6,0.3,0.5,0.7c0,0.3-0.3,0.6-0.6,0.6
|
||||
l-27,0.1l15.5,12c0.3,0.2,0.3,0.6,0.1,0.8C115.3,67.7,114.9,67.7,114.7,67.6z">
|
||||
</path>
|
||||
<path class="st1"
|
||||
d="M128.3,100.5l-25.9-13.9c-0.2-0.4-0.6-0.8-1-0.8c-0.7-0.1-1.3,0.4-1.3,1.1c0,0.4,0.1,0.8,0.4,1l3.3,29.8
|
||||
c0,0.3,0.3,0.5,0.6,0.5c0,0,0.1,0,0.1,0c0.3,0,0.6-0.3,0.6-0.6l0.5-20.7l16.8,21.5c0.2,0.3,0.6,0.3,0.8,0.1c0.3-0.2,0.3-0.6,0.2-0.8
|
||||
l-14-23.1l18.3,7c0.3,0.1,0.6,0,0.8-0.3C128.7,101,128.6,100.6,128.3,100.5z">
|
||||
</path>
|
||||
|
||||
<path class="st1"
|
||||
d="M164.5,105.6l-24.3-16.5c-0.5,0.1-0.9-0.1-1.2-0.6c-0.4-0.6-0.2-1.3,0.4-1.7c0.3-0.2,0.8-0.2,1.1-0.1l27.9-10.8
|
||||
c0.3-0.1,0.6,0,0.7,0.2c0,0,0,0,0,0.1c0.1,0.3,0,0.6-0.3,0.8l-18.1,10l26.9,5c0.3,0.1,0.5,0.4,0.5,0.7c0,0.3-0.3,0.6-0.7,0.5
|
||||
l-27-1.7l14.7,13c0.2,0.2,0.3,0.6,0.1,0.8C165.2,105.7,164.8,105.8,164.5,105.6z">
|
||||
</path>
|
||||
<path class="st1"
|
||||
d="M190.3,137.9L164.4,124c-0.2-0.4-0.6-0.8-1-0.8c-0.7-0.1-1.3,0.4-1.3,1.1c0,0.4,0.1,0.8,0.4,1l3.3,29.8
|
||||
c0,0.3,0.3,0.5,0.6,0.5c0,0,0.1,0,0.1,0c0.3,0,0.6-0.3,0.6-0.6l0.5-20.7l16.8,21.5c0.2,0.3,0.6,0.3,0.8,0.1c0.3-0.2,0.3-0.6,0.2-0.8
|
||||
l-14-23.1l18.3,7c0.3,0.1,0.6,0,0.8-0.3C190.7,138.4,190.6,138.1,190.3,137.9z">
|
||||
</path>
|
||||
|
||||
<path class="st1"
|
||||
d="M226.3,143.1L202,126.6c-0.5,0.1-0.9-0.1-1.2-0.6c-0.4-0.6-0.2-1.3,0.4-1.7c0.3-0.2,0.8-0.2,1.1-0.1l27.9-10.8
|
||||
c0.3-0.1,0.6,0,0.7,0.2c0,0,0,0,0,0.1c0.1,0.3,0,0.6-0.3,0.8l-18.1,10l26.9,5c0.3,0.1,0.5,0.4,0.5,0.7c0,0.3-0.3,0.6-0.7,0.5
|
||||
l-27-1.7l14.7,13c0.2,0.2,0.3,0.6,0.1,0.8C226.9,143.2,226.5,143.3,226.3,143.1z">
|
||||
</path>
|
||||
<path class="st1"
|
||||
d="M219.2,186.2l-14.3-25.7c0.1-0.5,0-0.9-0.4-1.2c-0.5-0.4-1.3-0.3-1.7,0.2c-0.3,0.3-0.3,0.7-0.2,1.1l-13.3,26.9
|
||||
c-0.1,0.3-0.1,0.6,0.2,0.8c0,0,0,0,0.1,0c0.3,0.2,0.6,0.1,0.8-0.2l11.6-17.1l2.5,27.2c0,0.3,0.3,0.6,0.6,0.6c0.3,0,0.6-0.3,0.6-0.6
|
||||
l0.7-27l11.6,15.8c0.2,0.3,0.6,0.3,0.8,0.2C219.3,186.8,219.4,186.5,219.2,186.2z">
|
||||
</path>
|
||||
|
||||
<path class="st1"
|
||||
d="M248.4,210l-12.2-26.7c-0.4-0.2-0.7-0.6-0.7-1.1c0-0.7,0.5-1.2,1.2-1.2c0.4,0,0.8,0.2,1,0.5l29.5,5.2
|
||||
c0.3,0.1,0.5,0.3,0.5,0.6c0,0,0,0.1,0,0.1c0,0.3-0.3,0.6-0.6,0.6l-20.7-0.8l20.4,18.2c0.2,0.2,0.3,0.6,0.1,0.8
|
||||
c-0.2,0.3-0.6,0.3-0.8,0.1l-22.2-15.4l5.8,18.7c0.1,0.3-0.1,0.6-0.4,0.8C248.8,210.4,248.5,210.3,248.4,210z">
|
||||
</path>
|
||||
<path class="st1"
|
||||
d="M219.7,246.9l0-29.4c0.3-0.3,0.4-0.8,0.2-1.3c-0.3-0.6-1-0.9-1.6-0.6c-0.4,0.2-0.6,0.5-0.7,0.9l-24.7,17
|
||||
c-0.2,0.2-0.3,0.5-0.2,0.8c0,0,0,0,0,0.1c0.2,0.3,0.5,0.4,0.8,0.2l18.5-9.3l-11,25c-0.1,0.3,0,0.7,0.3,0.8c0.3,0.2,0.7,0,0.8-0.2
|
||||
l13.8-23.2l2.5,19.4c0,0.3,0.3,0.6,0.7,0.5C219.4,247.5,219.7,247.2,219.7,246.9z">
|
||||
</path>
|
||||
|
||||
<path class="st1"
|
||||
d="M233.8,279.5l1-29.4c-0.3-0.4-0.4-0.9-0.2-1.3c0.3-0.6,1-0.9,1.6-0.6c0.4,0.2,0.6,0.5,0.7,0.9l24.1,17.8
|
||||
c0.2,0.2,0.3,0.5,0.2,0.8c0,0,0,0,0,0.1c-0.2,0.3-0.5,0.4-0.8,0.2l-18.2-9.9l10.2,25.4c0.1,0.3,0,0.7-0.3,0.8
|
||||
c-0.3,0.1-0.7,0-0.8-0.3l-13-23.7l-3.1,19.3c-0.1,0.3-0.3,0.5-0.7,0.5C234.1,280.1,233.8,279.8,233.8,279.5z">
|
||||
</path>
|
||||
<path class="st1"
|
||||
d="M191.6,301.5l9.2-27.9c0.4-0.2,0.7-0.7,0.6-1.2c-0.1-0.7-0.7-1.2-1.3-1.1c-0.4,0-0.8,0.3-0.9,0.6l-28.7,8.5
|
||||
c-0.3,0.1-0.5,0.4-0.4,0.7c0,0,0,0.1,0,0.1c0.1,0.3,0.4,0.5,0.7,0.5l20.5-3.1l-18.3,20.3c-0.2,0.2-0.2,0.6,0,0.8
|
||||
c0.2,0.2,0.6,0.2,0.8,0l20.3-17.8l-3.7,19.2c-0.1,0.3,0.1,0.6,0.5,0.7C191.2,302,191.5,301.8,191.6,301.5z">
|
||||
</path>
|
||||
|
||||
<path class="st1"
|
||||
d="M192.3,339.3l11.8-26.9c-0.1-0.4,0-0.9,0.3-1.3c0.5-0.5,1.3-0.4,1.7,0.1c0.3,0.3,0.4,0.7,0.3,1.1l15.7,25.5
|
||||
c0.2,0.3,0.1,0.6-0.1,0.8c0,0,0,0-0.1,0.1c-0.3,0.2-0.6,0.1-0.8-0.1l-13.2-16l0,27.3c0,0.3-0.3,0.6-0.6,0.6c-0.3,0-0.6-0.2-0.7-0.5
|
||||
l-3.3-26.8l-10.1,16.8c-0.2,0.3-0.5,0.4-0.8,0.2C192.3,340,192.2,339.6,192.3,339.3z">
|
||||
</path>
|
||||
<path class="st1"
|
||||
d="M155.1,348.4l9.2-27.9c0.4-0.2,0.7-0.7,0.6-1.2c-0.1-0.7-0.7-1.2-1.3-1.1c-0.4,0-0.8,0.3-0.9,0.6l-28.7,8.5
|
||||
c-0.3,0.1-0.5,0.4-0.4,0.7c0,0,0,0.1,0,0.1c0.1,0.3,0.4,0.5,0.7,0.5l20.5-3.1l-18.3,20.3c-0.2,0.2-0.2,0.6,0,0.8
|
||||
c0.2,0.2,0.6,0.2,0.8,0l20.3-17.8l-3.7,19.2c-0.1,0.3,0.1,0.6,0.5,0.7C154.7,348.9,155,348.7,155.1,348.4z">
|
||||
</path>
|
||||
|
||||
<path class="st1"
|
||||
d="M154,385.9l13.5-26.1c-0.1-0.4,0-0.9,0.4-1.3c0.5-0.4,1.3-0.3,1.7,0.2c0.3,0.3,0.3,0.7,0.2,1.1l14,26.5
|
||||
c0.1,0.3,0.1,0.6-0.2,0.8c0,0,0,0-0.1,0c-0.3,0.2-0.6,0.1-0.8-0.2l-12.1-16.8l-1.8,27.3c0,0.3-0.3,0.6-0.6,0.6
|
||||
c-0.3,0-0.6-0.3-0.6-0.6l-1.5-27l-11.2,16.1c-0.2,0.3-0.6,0.3-0.8,0.2C154,386.5,153.9,386.2,154,385.9z">
|
||||
</path>
|
||||
|
||||
</svg>
|
||||
</div>
|
||||
<div class="hero-static__slider-wrap">
|
||||
<div
|
||||
class="swiper-container hero-static__slider swiper-container-fade swiper-container-initialized swiper-container-horizontal">
|
||||
<div class="swiper-wrapper" style="transition-duration: 0ms;">
|
||||
<div class="swiper-slide hero-static__slide image-border-wrap swiper-slide-active"
|
||||
style="background-image: url(/storage/uploads/2020/02/error_1.webp); width: 1200px; opacity: 1; transform: translate3d(0px, 0px, 0px); transition-duration: 0ms;">
|
||||
</div>
|
||||
<div class="swiper-slide hero-static__slide image-border-wrap swiper-slide-next"
|
||||
style="background-image: url(/storage/uploads/2020/02/error_2.webp); width: 1200px; opacity: 0; transform: translate3d(-1200px, 0px, 0px); transition-duration: 0ms;">
|
||||
</div>
|
||||
<x-front.borders :borders="[
|
||||
'desktop' => [
|
||||
'left' => true,
|
||||
'right' => true,
|
||||
'top' => true,
|
||||
'bottom' => true,
|
||||
],
|
||||
'mobile' => [
|
||||
'left' => true,
|
||||
'right' => true,
|
||||
'top' => true,
|
||||
'bottom' => true,
|
||||
],
|
||||
]" />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="hero-static__block-wrapper">
|
||||
<div class="hero-static__block">
|
||||
<h1 class="hero__block-title">{{ __('errors.404.title') }}</h1>
|
||||
<h2 class="hero__block-text description">{{ __('errors.404.description') }}</h2>
|
||||
<a class="hero__block-btn btn arrow-btn" href="/"
|
||||
title="Retour à la page d’accueil">{{ trans('front.back_to_homepage') }}<i
|
||||
class="btn__icon btn__icon_arrow-right"></i>
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="breadcrumbs fw">
|
||||
<div class="breadcrumbs__wrapper wrapper">
|
||||
<span property="itemListElement" typeof="ListItem"><a property="item" title="LDC" href="/"
|
||||
class="home"><span property="name">LDC</span></a>
|
||||
<meta property="position" content="1">
|
||||
</span> > <span class="404 current-item">{{ __('errors.404.title') }}</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
|
@ -27,10 +27,10 @@
|
|||
occasionnée. Nous nous efforçons de rétablir le service dans les meilleurs délais.
|
||||
</p>
|
||||
<div class="finance-api__text description">
|
||||
@if(isset($bourseSection['wysiwyg_description']))
|
||||
<p>
|
||||
{!! $bourseSection['wysiwyg_description'] !!}
|
||||
</p>
|
||||
@if (isset($bourseSection['wysiwyg_description']))
|
||||
<p>
|
||||
{!! $bourseSection['wysiwyg_description'] !!}
|
||||
</p>
|
||||
@endif
|
||||
<p> </p>
|
||||
@if (!empty($bourseSection['string_subtitle']))
|
||||
|
|
@ -99,19 +99,21 @@
|
|||
@endif
|
||||
<br><br>
|
||||
<h3 class="finance-api__title subtitle">Inscrivez-vous à notre newsletter !</h3>
|
||||
<form id="newsletter_cta">
|
||||
<input id="newsletter_cta_email" type="email" class="form__input"
|
||||
<div class="newsletter-form">
|
||||
<input id="newsletter-email" type="email" class="form__input"
|
||||
placeholder="Renseignez votre email" pattern="[a-z0-9._%+-]+@[a-z0-9.-]+\.[a-z]{2,4}$"
|
||||
required="" autocomplete="off">
|
||||
<div class="newsletter-confirm-box">
|
||||
<button type="submit" class="btn">Valider</button>
|
||||
{{-- # FIXME --}}
|
||||
<button type="button" id="newsletter-submit" class="btn">Valider</button>
|
||||
<span>Pour toute information complémentaire concernant vos données personnelles et vos
|
||||
droits, merci de consulter notre <a class="cn-link"
|
||||
href="{{ \App\Helpers\RouteHelper::routeNameChecker('front.dynamic-pages.politique-de-confidentialite') }}">Charte de
|
||||
href="{{ \App\Helpers\RouteHelper::routeNameChecker('front.dynamic-pages.politique-de-confidentialite') }}">Charte
|
||||
de
|
||||
confidentialité</a>.</span>
|
||||
</div>
|
||||
</form>
|
||||
{{-- Error/Success message container --}}
|
||||
<div class="d-none" id="newsletter-message"></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@if (!empty($closedWindows))
|
||||
|
|
@ -125,10 +127,12 @@
|
|||
</div>
|
||||
@if (!empty($closedWindows['list_document'][0]))
|
||||
<div class="finance-price__btn-wrap"">
|
||||
<x-front.cta :title="$closedWindows['list_document'][0]['string_button_label'] ?? ''" :url="\App\Models\Document::getAccessModel($closedWindows['list_document'][0]['model_internal_link'])" :download="$closedWindows['list_document'][0]['boolean_force_download'] ?? false" :target="$closedWindows['list_document'][0]['boolean_target_blank'] ?? false
|
||||
? '_blank'
|
||||
: '_self'"
|
||||
buttonIcon="btn__icon_view" class="finance-price__btn" />
|
||||
<x-front.cta :title="$closedWindows['list_document'][0]['string_button_label'] ?? ''" :url="\App\Models\Document::getAccessModel(
|
||||
$closedWindows['list_document'][0]['model_internal_link'],
|
||||
)" :download="$closedWindows['list_document'][0]['boolean_force_download'] ?? false" :target="$closedWindows['list_document'][0]['boolean_target_blank'] ?? false
|
||||
? '_blank'
|
||||
: '_self'"
|
||||
buttonIcon="btn__icon_view" class="finance-price__btn" />
|
||||
</div>
|
||||
@endif
|
||||
@endif
|
||||
|
|
|
|||
|
|
@ -46,7 +46,7 @@
|
|||
|
||||
@stack('scripts')
|
||||
|
||||
|
||||
@include('front.modules.script-routes')
|
||||
@include('front.layouts.footer')
|
||||
</body>
|
||||
|
||||
|
|
|
|||
11
resources/views/front/modules/script-routes.blade.php
Normal file
11
resources/views/front/modules/script-routes.blade.php
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
{{-- blade-formatter-disable --}}
|
||||
<script nonce="{{ $nonce ?? '' }}">
|
||||
if (!window.__SYSTEM) {
|
||||
window.__SYSTEM = {};
|
||||
}
|
||||
if (!window.__SYSTEM._routes) {
|
||||
window.__SYSTEM._routes = {};
|
||||
}
|
||||
|
||||
window.__SYSTEM._routes['front.add-single-optin'] = '{{ route('front.add-single-optin') }}';
|
||||
</script>
|
||||
|
|
@ -4,7 +4,13 @@
|
|||
@section('description', trans("errors.$status.description"))
|
||||
|
||||
@section('content')
|
||||
<h1>{{ sprintf("%s - %s", $status, trans("errors.$status.title")) }}</h1>
|
||||
<p>{{ trans("errors.$status.description") }}</p>
|
||||
<a href="/">{{ trans("front.back_to_homepage") }}</a>
|
||||
|
||||
|
||||
@if ($status === 404)
|
||||
<x-front.page-404 />
|
||||
@else
|
||||
<h1>{{ sprintf('%s - %s', $status, trans("errors.$status.title")) }}</h1>
|
||||
<p>{{ trans("errors.$status.description") }}</p>
|
||||
<a href="/">{{ trans('front.back_to_homepage') }}</a>
|
||||
@endif
|
||||
@endsection
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
@extends('front.layouts.layout')
|
||||
|
||||
@section('title', __('Désincription à la newsletter'))
|
||||
@section('description', __('Page de désincription à la newsletter du site le Gaulois'))
|
||||
@section('description', __('Page de désincription à la newsletter du site LDC'))
|
||||
|
||||
@section('content')
|
||||
<div class="container mt-5 pt-5 mb-3">
|
||||
|
|
|
|||
|
|
@ -21,11 +21,14 @@ Route::group(
|
|||
Route::post('/nous-contacter', 'send')->name('send');
|
||||
});
|
||||
|
||||
// Newsletter routes.
|
||||
// * Newsletter routes.
|
||||
Route::post('/optin', [HomeController::class, 'addOptIn'])->name('add-single-optin');
|
||||
// * Unsubscribe from newsletter
|
||||
Route::get('/{unsubscribe}', [HomeController::class, 'unsubscribeNewsletter'])
|
||||
->where('unsubscribe', 'unsubscribe|unsubscribe.php|unsubscribe.html|newsletter')
|
||||
->name('unsubscribeNewsletter');
|
||||
|
||||
|
||||
// Search routes.
|
||||
Route::get(LaravelLocalization::transRoute('routes.search'), [SearchController::class, 'search'])->name('search');
|
||||
Route::post('/search/load/results', [SearchController::class, 'ajaxSearchLoadResults'])->name('search.ajax.news');
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue