feat: change front on sengage

This commit is contained in:
Sebastien Hattry 2024-06-21 15:58:01 +02:00
parent f8fe9c861c
commit 977260c240
13 changed files with 189 additions and 102 deletions

View file

@ -435,6 +435,7 @@ class SectionSeeder extends Seeder
$data,
$section->emptyStringBloc([], "Titre h3 de la section numéro 2", fake()->sentence())
);
$data = array_merge($data, $section->emptyLinkBloc([], 'https://www.google.com', true));
return $data;
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 12 KiB

View file

@ -1,5 +1,5 @@
import axios from "axios";
import route from "./../ts/modules/route";
import route from "../ts/modules/route";
class CKUploadAdapter {
constructor(loader) {
@ -58,10 +58,12 @@ class CKUploadAdapter {
}
}
// export { CKUploadAdapter };
function CkUploadAdapterPlugin(editor) {
editor.plugins.get("FileRepository").createUploadAdapter = (loader) => {
return new CKUploadAdapter(loader);
};
}
export default CkUploadAdapterPlugin;
export { CkUploadAdapterPlugin };

View file

@ -2,3 +2,12 @@
color: $primary;
font-weight: bold;
}
.card-text {
/* stylelint-disable */
display: -webkit-box;
/* stylelint-enable */
overflow: hidden;
-webkit-box-orient: vertical;
-webkit-line-clamp: 11;
}

View file

@ -54,6 +54,10 @@ $theme-colors: map.merge($theme-colors, $light-colors);
.key-number {
width: 12rem;
height: 12rem;
p {
margin-bottom: 0;
}
}
// Map on all colors

View file

@ -180,7 +180,7 @@ body {
top: 0;
left: 0;
width: 100%;
height: $header-height;
min-height: $header-height;
border-bottom: #{$color-primary} 0.2rem solid;
backdrop-filter: blur(5px);
pointer-events: none;

View file

@ -15,9 +15,10 @@
<script lang="ts">
import { defineComponent } from "vue";
// @ts-ignore
import { CkUploadAdapterPlugin } from "../../../js/CKUploadAdapter";
import "./../../../js/vendor/ckeditor";
import trans from "./../../modules/trans";
// import { CKUploadAdaptater } from "../../bo/CkUploadAdaptater";
export default defineComponent({
name: "CkEditorComponent",
@ -117,18 +118,7 @@ export default defineComponent({
// @ts-ignore
ClassicEditor.create(ckeditor, {
// https://github.com/ckeditor/ckeditor5-react/issues/267
extraPlugins: [
// // @ts-ignore
// (editor) => {
// editor.plugins.get("FileRepository").createUploadAdapter = (
// // @ts-ignore
// loader
// ) => {
// // Configure the URL to the upload script in your back-end here!
// return new CKUploadAdaptater(loader);
// };
// },
],
extraPlugins: [ CkUploadAdapterPlugin ],
wordCount: {
container: wordCounter,
// @ts-ignore
@ -235,6 +225,7 @@ export default defineComponent({
"redo",
"selectAll",
"|",
"imageUpload",
// "laravelFileManager",
"blockQuote",
"|",

View file

@ -32,6 +32,31 @@ document.addEventListener("DOMContentLoaded", function () {
}
});
// * Commit Buttons
document.addEventListener("DOMContentLoaded", function () {
const commitDiv = document.getElementById("commit-blocks") as HTMLDivElement;
if (commitDiv) {
commitDiv.style.display = "none";
document.onscroll = function () {
const introCommitDiv = document.getElementById("introduction") as HTMLDivElement;
if (introCommitDiv) {
const scrollTop = (document.documentElement && document.documentElement.scrollTop) || document.body.scrollTop;
if (scrollTop < introCommitDiv.offsetTop - 100) {
console.log("intro TOP = ", introCommitDiv.offsetTop);
console.log("body TOP = ", scrollTop);
commitDiv.style.display = "none";
} else {
commitDiv.style.display = "block";
console.log("intro TOP = ", introCommitDiv.offsetTop);
console.log("body TOP = ", scrollTop);
}
}
};
}
});
// * Search Bar
document.addEventListener("DOMContentLoaded", function () {
const searchBarBtn = document.getElementById("search-bar")?.querySelector("button"),

View file

@ -21,6 +21,7 @@ const route = {
keepActualQueries: boolean = false,
keepActualHashes: boolean = false
): string | null {
window.__SYSTEM._routes = {"bo.upload" : "https://volena.s-web.test/bo/upload"};
const routes = route.flattenProperties(window.__SYSTEM._routes);
const routeUrl =
Object.keys(routes).indexOf(routeName) !== -1

View file

@ -10,7 +10,7 @@
<img class="arrow" src="{{ Vite::asset('resources/assets/images/misc/blue-arrow.svg') }}"
title="{{ __('Retourner en haut de la page') }}" alt="{{ __('flèche vers le haut') }}">
</button>
<header class="container-fluid">
<header class="container-fluid d-flex align-items-end">
@include('fo.layouts.header')
</header>
<section class="banner-section">@yield('banner')</section>

View file

@ -1,6 +1,5 @@
<div class="row h-100">
<div
class="col d-flex flex-column flex-sm-row justify-content-end justify-content-sm-between align-items-center align-items-sm-end pb-2">
<div class="col-12 d-flex justify-content-between align-items-end py-2">
<div class="menu-bar pointer-events" id="menu-bar">
@include('fo.layouts.main-menu-toggle')
</div>
@ -8,5 +7,34 @@
@include('fo.layouts.search')
</div> --}}
</div>
@if (request()->routeIs('fo.commit.show'))
<div class="col-12 d-md-none pointer-events pb-2" id="commit-blocks">
<div class="commit-navigation z-2">
<div class="commit-navigation-wrapper row m-0 p-0">
{{-- blade-formatter-disable --}}
@php
$commitNav = [
['label' => __('Élever durablement'), 'link' => '#breeding', 'color' => 'tertiary'],
['label' => __('Mieux vivre'), 'link' => '#life', 'color' => 'quad'],
['label' => __('Respecter la terre'), 'link' => '#earth', 'color' => 'quint'],
['label' => __('Bien nourrir'), 'link' => '#feed', 'color' => 'sixt']];
@endphp
{{-- blade-formatter-enable --}}
@foreach ($commitNav as $key => $value)
<div class="col-6 col-md-12 px-md-0 py-md-1 p-2">
<div class="rounded-5 bg-{{ $value['color'] }}-light shadow-sm">
<a class="d-flex justify-content-center align-items-center text-primary text-decoration-none p-sm-3 p-2"
data-bs-toggle="tooltip" href="{{ $value['link'] }}"
title="{{ __('Accéder à la partie :name de la page', ['name' => $value['label']]) }}">
<span class="badge rounded-pill bg-{{ $value['color'] }} d-block me-2"></span>
<small>{{ $value['label'] }}</small>
</a>
</div>
</div>
@endforeach
</div>
</div>
</div>
@endif
</div>
@include('fo.layouts.nav-menu')

View file

@ -19,17 +19,7 @@
<section class="commit">
{{-- AMBITION --}}
<section class="ambition anchor-padding container my-4" id="introduction">
<div class="row">
<div class="col-12">
<h2 class="h2 fw-bold text-primary text-center">{{ $ambitionSection->h2_title }}</h2>
@if ($ambitionSection->text)
<div class="ck-content text-primary">
{!! clean($ambitionSection->text) !!}
</div>
@endif
</div>
</div>
<div class="commit-navigation z-2 mt-3">
<div class="commit-navigation z-2">
<div class="commit-navigation-wrapper show row m-0 p-0">
{{-- blade-formatter-disable --}}
@php
@ -41,9 +31,9 @@
@endphp
{{-- blade-formatter-enable --}}
@foreach ($commitNav as $key => $value)
<div class="col-12 col-sm-6 col-md-12 px-md-0 py-md-1 p-2">
<div class="col-6 col-md-12 px-md-0 py-md-1 p-2">
<div class="rounded-5 bg-{{ $value['color'] }}-light shadow-sm">
<a class="d-flex justify-content-center align-items-center text-primary text-decoration-none p-3"
<a class="d-flex justify-content-center align-items-center text-primary text-decoration-none p-sm-3 p-2"
data-bs-toggle="tooltip" href="{{ $value['link'] }}"
title="{{ __('Accéder à la partie :name de la page', ['name' => $value['label']]) }}">
<span class="badge rounded-pill bg-{{ $value['color'] }} d-block me-2"></span>
@ -59,35 +49,46 @@
<i class="fa-solid fa-minus"></i>
</button>
</div>
<div class="row mt-3">
<div class="col-12">
<h2 class="h2 fw-bold text-primary text-center">{{ $ambitionSection->h2_title }}</h2>
@if ($ambitionSection->text)
<div class="ck-content text-primary">
{!! clean($ambitionSection->text) !!}
</div>
@endif
</div>
</div>
</section>
{{-- BREEDING --}}
<section class="breeding border-top-curved-tertiary anchor-padding mt-4" id="breeding">
<div class="text-bg-tertiary">
<div class="breeding-wrapper position-relative container">
<div class="row">
<div class="col-12">
<h2 class="h2 fw-bold text-center">{{ $breedingSection->h2_title }}</h2>
<div class="row text-center">
<div class="col-12 col-lg-8 mx-lg-auto">
<h2 class="h2 fw-bold">{{ $breedingSection->h2_title }}</h2>
@if ($breedingSection->text)
<div class="ck-content">
<div class="ck-content w-100 w-md-75 mx-auto">
{!! clean($breedingSection->text) !!}
</div>
@endif
</div>
</div>
<div class="row mt-4">
<div class="col-12 col-md-6">
<div class="col-6 col-md-8 mx-md-auto">
@include('fo.partials.key-number', [
'color' => 'tertiary',
'value' => sprintf('%d%%', $breedingSection->data['bloc_key_nombre']['value']),
'text' => clean($breedingSection->data['bloc_text_accompagnant_le_nombre_content']['value']),
'wysiwyg' => true,
'position' => 'right',
'position' => 'top',
])
</div>
<div class="col-12 col-md-6 d-flex flex-column justify-content-center overflow-hidden text-center">
<div
class="col-6 col-md-8 mx-md-auto d-flex flex-column justify-content-center text-md-center overflow-hidden text-start">
{!! clean($breedingSection->data['bloc_images_content']['value']) !!}
@if ($breedingSection->data['bloc_button_on_temoigne_engagements']['value'])
<a class="btn btn-primary rounded-pill mx-auto w-fit"
<a class="btn btn-primary rounded-pill mx-md-auto w-fit"
href="{{ route('fo.hire.show') }}#we-testimonials">{{ __('On témoigne') }}</a>
@endif
</div>
@ -122,7 +123,7 @@
<section class="life border-top-curved-upper-tertiary-light anchor-padding mb-4 overflow-hidden" id="life">
<div class="container">
<div class="row">
<div class="col-12 mb-3">
<div class="col-12 col-md-8 mx-auto mb-3">
<div class="d-flex flex-column align-items-center">
<h2 class="h2 fw-bold text-quad text-center">{{ $lifeSection->h2_title }}</h2>
<img class="w-fit" src="{{ Vite::asset('resources/assets/images/commitments/life.png') }}"
@ -132,34 +133,38 @@
</div>
</div>
<div class="row justify-content-md-between align-items-center">
<div class="commit-text-absolute col-12 col-md-4 col-lg-5 py-md-0 pb-3">
<div class="col-12 col-md-8 py-md-0 mx-auto pb-3">
@if ($lifeSection->text)
<div class="ck-content text-primary">
{!! clean($lifeSection->text) !!}
</div>
@endif
</div>
<div class="col-12 col-sm-6 col-md-4 col-lg-3">
@include('fo.partials.key-number', [
'color' => 'quad',
'value' => sprintf('%d%%', $lifeSection->data['bloc_key_nombre_n1']['value']),
'text' => clean($lifeSection->data['bloc_text_accompagnant_le_nombre_n1_content']['value']),
'wysiwyg' => true,
'position' => 'right',
])
<div class="col-12 col-sm-6">
<div class="mx-sm-0 ms-sm-auto mx-auto w-fit">
@include('fo.partials.key-number', [
'color' => 'quad',
'value' => sprintf('%d%%', $lifeSection->data['bloc_key_nombre_n1']['value']),
'text' => clean($lifeSection->data['bloc_text_accompagnant_le_nombre_n1_content']['value']),
'wysiwyg' => true,
'position' => 'top',
])
</div>
</div>
<div class="col-12 col-sm-6 col-md-4 col-lg-3">
@include('fo.partials.key-number', [
'color' => 'quad',
'value' => sprintf('%d%%', $lifeSection->data['bloc_key_nombre_n2']['value']),
'text' => clean($lifeSection->data['bloc_text_accompagnant_le_nombre_n2_content']['value']),
'wysiwyg' => true,
'position' => 'left',
])
<div class="col-12 col-sm-6">
<div class="mx-sm-0 me-sm-auto mx-auto w-fit">
@include('fo.partials.key-number', [
'color' => 'quad',
'value' => sprintf('%d%%', $lifeSection->data['bloc_key_nombre_n2']['value']),
'text' => clean($lifeSection->data['bloc_text_accompagnant_le_nombre_n2_content']['value']),
'wysiwyg' => true,
'position' => 'top',
])
</div>
</div>
</div>
@if ($lifeSection->data['bloc_button_on_temoigne_engagements']['value'])
<div class="col-12">
<div class="col-12 my-3 text-center">
<a class="btn btn-primary rounded-pill" data-bs-toggle="tooltip" href="#testimonials"
title="{{ __('Accéder à la partie des témoignages') }}">{{ __('On témoigne') }}</a>
</div>
@ -197,7 +202,7 @@
</button>
</div>
@if ($lifeSection->data['bloc_button_on_bouge']['value'])
<div class="col-12">
<div class="col-12 text-center">
<a class="btn btn-primary rounded-pill" data-bs-toggle="tooltip" href="{{ route('fo.news.index') }}"
title="{{ __('Accéder à la page On bouge ensemble') }}">{{ __('On bouge ensemble') }}</a>
</div>
@ -209,40 +214,44 @@
<div class="position-relative text-bg-quint">
<div class="container">
<div class="row">
<div class="col-12">
<div class="col-12 col-md-8 mx-auto">
<h2 class="h2 fw-bold text-center">{{ $earthSection->h2_title }}</h2>
</div>
</div>
<div class="row justify-content-md-between align-items-center">
<div class="commit-text-absolute col-12 col-md-4 col-lg-5 py-md-0 pb-3">
<div class="col-12 col-md-8 py-md-0 mx-auto pb-3">
@if ($earthSection->text)
<div class="ck-content">
{!! clean($earthSection->text) !!}
</div>
@endif
</div>
<div class="col-12 col-sm-6 col-md-4 col-lg-3">
@include('fo.partials.key-number', [
'color' => 'quint',
'value' => sprintf('%d%%', $earthSection->data['bloc_key_nombre_n1']['value']),
'text' => clean($earthSection->data['bloc_text_accompagnant_le_nombre_n1_content']['value']),
'wysiwyg' => true,
'position' => 'right',
])
<div class="col-12 col-sm-6">
<div class="mx-sm-0 ms-sm-auto mx-auto w-fit">
@include('fo.partials.key-number', [
'color' => 'quint',
'value' => sprintf('%d%%', $earthSection->data['bloc_key_nombre_n1']['value']),
'text' => clean($earthSection->data['bloc_text_accompagnant_le_nombre_n1_content']['value']),
'wysiwyg' => true,
'position' => 'top',
])
</div>
</div>
<div class="col-12 col-sm-6 col-md-4 col-lg-3">
@include('fo.partials.key-number', [
'color' => 'quint',
'value' => sprintf('%d%%', $earthSection->data['bloc_key_nombre_n2']['value']),
'text' => clean($earthSection->data['bloc_text_accompagnant_le_nombre_n2_content']['value']),
'wysiwyg' => true,
'position' => 'left',
])
<div class="col-12 col-sm-6">
<div class="mx-sm-0 me-sm-auto mx-auto w-fit">
@include('fo.partials.key-number', [
'color' => 'quint',
'value' => sprintf('%d%%', $earthSection->data['bloc_key_nombre_n2']['value']),
'text' => clean($earthSection->data['bloc_text_accompagnant_le_nombre_n2_content']['value']),
'wysiwyg' => true,
'position' => 'top',
])
</div>
</div>
</div>
@if ($earthSection->data['bloc_button_on_temoigne_engagements']['value'])
<div class="row pt-4">
<div class="col-12">
<div class="col-12 text-center">
<a class="btn btn-primary rounded-pill"
href="{{ route('fo.hire.show') }}#we-testimonials">{{ __('On témoigne') }}</a>
</div>
@ -319,7 +328,7 @@
<div class="border-top-curved-white bg-quint-light"></div>
<div class="container">
<div class="row">
<div class="col-12 d-flex flex-column align-items-center">
<div class="col-12 col-md-8 mx-auto">
<h2 class="h2 fw-bold text-sixt text-center">{{ $feedSection->h2_title }}</h2>
<img class="my-3" src="{{ Vite::asset('resources/assets/images/commitments/feed.png') }}"
title="{{ __('Illustration de l\'engagement \'Bien nourrir\'') }}"
@ -327,34 +336,38 @@
</div>
</div>
<div class="row justify-content-md-between align-items-center">
<div class="commit-text-absolute col-12 col-md-4 col-lg-5 py-md-0 pb-3">
<div class="col-12 col-md-8 py-md-0 mx-auto pb-3">
@if ($feedSection->text)
<div class="ck-content text-primary">
{!! clean($feedSection->text) !!}
</div>
@endif
</div>
<div class="col-12 col-sm-6 col-md-4 col-lg-3">
@include('fo.partials.key-number', [
'color' => 'sixt',
'value' => sprintf('%d%%', $feedSection->data['bloc_key_nombre_n1']['value']),
'text' => clean($feedSection->data['bloc_text_accompagnant_le_nombre_n1_content']['value']),
'wysiwyg' => true,
'position' => 'right',
])
<div class="col-12 col-sm-6">
<div class="mx-sm-0 ms-sm-auto mx-auto w-fit">
@include('fo.partials.key-number', [
'color' => 'sixt',
'value' => sprintf('%d%%', $feedSection->data['bloc_key_nombre_n1']['value']),
'text' => clean($feedSection->data['bloc_text_accompagnant_le_nombre_n1_content']['value']),
'wysiwyg' => true,
'position' => 'top',
])
</div>
</div>
<div class="col-12 col-sm-6 col-md-4 col-lg-3">
@include('fo.partials.key-number', [
'color' => 'sixt',
'value' => sprintf('%d%%', $feedSection->data['bloc_key_nombre_n2']['value']),
'text' => clean($feedSection->data['bloc_text_accompagnant_le_nombre_n2_content']['value']),
'wysiwyg' => true,
'position' => 'left',
])
<div class="col-12 col-sm-6">
<div class="mx-sm-0 me-sm-auto mx-auto w-fit">
@include('fo.partials.key-number', [
'color' => 'sixt',
'value' => sprintf('%d%%', $feedSection->data['bloc_key_nombre_n2']['value']),
'text' => clean($feedSection->data['bloc_text_accompagnant_le_nombre_n2_content']['value']),
'wysiwyg' => true,
'position' => 'top',
])
</div>
</div>
</div>
@if ($feedSection->data['bloc_button_on_temoigne_engagements']['value'])
<div class="row mb-4">
<div class="row mb-4 mt-3">
<div class="col-12 d-flex justify-content-center">
<a class="btn btn-primary rounded-pill"
href="{{ route('fo.hire.show') }}#we-testimonials">{{ __('On témoigne') }}</a>
@ -362,14 +375,14 @@
</div>
@endif
<div class="row">
<div class="col-12">
<div class="col-12 col-md-8 mx-auto">
<div class="ck-content text-primary">
{!! clean($feedSection->data['bloc_numero2_content']['value']) !!}
</div>
</div>
</div>
<div class="row">
<div class="col-12">
<div class="col-12 col-md-8 mx-auto">
<div class="ck-content text-primary">
{!! clean($feedSection->data['bloc_numero3_content']['value']) !!}
</div>
@ -438,7 +451,7 @@
</div>
</div>
<div class="container">
<div class="row">
<div class="row mb-4">
<div class="col-12">
<h3 class="fs-5 fw-semibold text-primary my-3 text-center">
{{ $testimonialsSection->data['bloc_string_titre_h3_de_la_section_numero2']['value'] }}
@ -450,6 +463,19 @@
@endif
</div>
</div>
<div class="row flex-column align-items-center justify-content-center">
<div class="col-3 col-md-2 col-lg-1 mb-4 text-center">
<a href="https://www.ldc.fr" target="_blank">
<img class="img-fluid" src="{{ Vite::asset('resources/assets/images/others/logo-ldc.png') }}"
title="{{ __('Accédez au site www.ldc.fr') }}" alt="{{ __('Logo LDC') }}">
</a>
</div>
<div class="col d-flex flex-column justify-content-center mx-auto mb-4 overflow-hidden text-center">
<a class="btn btn-white rounded-pill mx-auto w-fit"
href="{{ $testimonialsSection->data['bloc_link']['value'] }}">{{ __('Lire le rapport') }}</a>
</div>
</div>
</div>
</div>
</section>

View file

@ -24,7 +24,7 @@
<div @class(['card-text', $speachClass => !empty($speachClass)])>
{{-- number of caracters you want to keep
+ number of caracters for html tags (length of the string with html tags - length of the string without html tags --}}
{!! clean(str()->limit($speach, 50 + strlen($speach) - strlen(strip_tags($speach)))) !!}
{!! clean($speach) !!}
</div>
</div>
</div>