From: soufiane Date: Mon, 30 Sep 2024 16:15:12 +0000 (+0200) Subject: wip #7098 @14:00 X-Git-Url: http://git.cubedesigners.com/?a=commitdiff_plain;h=b31e83cc05699fcab0efe8e432bbd7ae4cc6fa2b;p=pmi.git wip #7098 @14:00 --- diff --git a/.env.dev b/.env.dev index cc07b24..0305ea1 100644 --- a/.env.dev +++ b/.env.dev @@ -8,11 +8,11 @@ APP_VARIANTS=PMI,MICHSCI LOG_CHANNEL=stack DB_CONNECTION=mysql -DB_HOST=pmi-dev-mariadb +DB_HOST=pmi-mariadb DB_PORT=3306 -DB_DATABASE=pmi-dev +DB_DATABASE=pmi DB_USERNAME=root -DB_PASSWORD=PFBq8Exwz7ys5CzR +DB_PASSWORD=uOvpiRwybTsT1Gyc BROADCAST_DRIVER=log CACHE_DRIVER=redis diff --git a/app/SubForms/Faq.php b/app/SubForms/Faq.php new file mode 100644 index 0000000..e8769fd --- /dev/null +++ b/app/SubForms/Faq.php @@ -0,0 +1,31 @@ +addField(['name' => 'question', + 'label' => 'Question', + 'type' => 'Textarea', + 'attributes' => [ + 'rows' => 3, + ], + ]); + + $this->addField(['name' => 'response', + 'label' => 'Réponse', + 'type' => 'Textarea', + 'attributes' => [ + 'rows' => 3, + ], + ]); + } +} diff --git a/app/SubForms/OurSolutionsUSP.php b/app/SubForms/OurSolutionsUSP.php new file mode 100644 index 0000000..9703950 --- /dev/null +++ b/app/SubForms/OurSolutionsUSP.php @@ -0,0 +1,33 @@ +addField(['name' => 'title', + 'label' => 'Titre', + 'type' => 'Text']); + + $this->addField(['name' => 'text', + 'label' => 'Texte', + 'type' => 'Textarea', + 'attributes' => [ + 'rows' => 10, + ]]); + + $this->addField(['name' => 'image', + 'label' => 'Image', + 'type' => 'Images']); + + $this->addField(['name' => 'page', + 'label' => 'Lien vers', + 'type' => 'PageInternal']); + } +} diff --git a/app/SubForms/TitleTextImage.php b/app/SubForms/TitleTextImage.php new file mode 100644 index 0000000..aa2d962 --- /dev/null +++ b/app/SubForms/TitleTextImage.php @@ -0,0 +1,29 @@ +addField(['name' => 'title', + 'label' => 'Titre', + 'type' => 'Text']); + + $this->addField(['name' => 'text', + 'label' => 'Texte', + 'type' => 'Textarea', + 'attributes' => [ + 'rows' => 10, + ]]); + + $this->addField(['name' => 'image', + 'label' => 'Image', + 'type' => 'Images']); + } +} diff --git a/app/Templates/Base.php b/app/Templates/Base.php index 7ba53a9..a93e98a 100644 --- a/app/Templates/Base.php +++ b/app/Templates/Base.php @@ -38,6 +38,7 @@ class Base extends TemplatePage 'name' => 'form', 'type' => 'BunchOfFieldsMultiple', 'bunch' => 'App\SubForms\FormField', + 'edit_label'=>"%type", 'label' => 'Champs du formulaire', 'tab' => $tab, ]); diff --git a/app/Templates/OurSolutions.php b/app/Templates/OurSolutions.php new file mode 100644 index 0000000..e5d9b38 --- /dev/null +++ b/app/Templates/OurSolutions.php @@ -0,0 +1,93 @@ +addField(['name' => 'hero', + 'label' => 'Hero', + 'type' => 'BunchOfFields', + 'bunch' => 'App\SubForms\ImageBlock', + 'tab' => 'Hero bloc']); + + parent::init(); + + $this->addField(['name' => 'intro', + 'label' => 'Introduction', + 'type' => 'BunchOfFields', + 'bunch' => 'App\SubForms\Intro', + 'tab' => 'Introduction']); + + $this->addField(['name' => 'markets_title', + 'label' => 'Titre', + 'type' => 'BunchOfFields', + 'bunch' => 'App\SubForms\Intro', + 'tab' => 'Marchés cibles']); + + $this->addField(['name' => 'markets', + 'label' => 'Marchés cibles', + 'type' => 'BunchOfFieldsMultiple', + 'bunch' => 'App\SubForms\ImageBlock', + 'edit_label'=>"%title", + 'tab' => 'Marchés cibles']); + + $this->addField(['name' => 'usp_title', + 'label' => 'Titre', + 'type' => 'BunchOfFields', + 'bunch' => 'App\SubForms\Intro', + 'tab' => 'USP']); + + $this->addField(['name' => 'usp_items', + 'label' => 'USP', + 'type' => 'BunchOfFieldsMultiple', + 'bunch' => 'App\SubForms\TitleTextImage', + 'edit_label'=>"%title", + 'tab' => 'USP']); + + $this->addField(['name' => 'our_solutions_title', + 'label' => 'Titre', + 'type' => 'text', + 'tab' => 'Nos solutions']); + + $this->addField(['name' => 'our_solutions_items', + 'label' => 'Marchés cibles', + 'type' => 'BunchOfFieldsMultiple', + 'bunch' => 'App\SubForms\OurSolutionsUSP', + 'edit_label'=>"%title", + 'tab' => 'Nos solutions']); + + $this->addField(['name' => 'faqs', + 'label' => 'FAQs', + 'type' => 'BunchOfFieldsMultiple', + 'edit_label'=>"%question", + 'bunch' => 'App\SubForms\Faq', + 'tab' => 'FAQs']); + + $this->addForm(); + } + + // Set extra data for Home blade view + public function setData(&$data) + { + // Latest News posts + $data['news'] = News::getPosts(4); + } + +} diff --git a/resources/js/app.js b/resources/js/app.js index b40e350..a01fa7d 100644 --- a/resources/js/app.js +++ b/resources/js/app.js @@ -762,3 +762,6 @@ $(document).on("click", "#open-configurator", function () { $("#product-price-container, #features-quotes").removeClass("hidden") }) +$(document).on("click", ".faq-container-item .faq-item", function() { + $(this).toggleClass("active") +}) diff --git a/resources/styles/components/faq.styl b/resources/styles/components/faq.styl new file mode 100644 index 0000000..91371f8 --- /dev/null +++ b/resources/styles/components/faq.styl @@ -0,0 +1,39 @@ +.faq + &-container-item + +below(768px) + padding: 0 !important + + &-item + border-bottom: 1px solid #BEC5D0 + cursor: pointer + transition: all .3s + + &.active + @apply pl-6 + background-color: #fff + + svg + transform: rotate(180deg) + + svg + transition: transform .3s + + .question + line-height: normal + +below(768px) + font-size: 17px + + path + stroke: theme('colors.navy') + + &-response + color: #6B7287 + display: none + visibility: none + opacity: 0 + transition: opacity .3s + + .active & + display: block + visibility: visible + opacity: 1 diff --git a/resources/styles/components/our-solutions.styl b/resources/styles/components/our-solutions.styl new file mode 100644 index 0000000..5029d17 --- /dev/null +++ b/resources/styles/components/our-solutions.styl @@ -0,0 +1,20 @@ +.hero + + &-bg + position: absolute + width: 100% + height: 100% + left: 0 + top: 0 + background-repeat: no-repeat + background-size: cover + background-position: center + &:before + content: "" + background: linear-gradient(to right, theme('colors.navy'), transparent) + width: 100% + height: 100% + position: absolute + + .text-block + position: relative diff --git a/resources/views/components/text-block.blade.php b/resources/views/components/text-block.blade.php index 3c1c6d2..aadeeda 100644 --- a/resources/views/components/text-block.blade.php +++ b/resources/views/components/text-block.blade.php @@ -12,7 +12,7 @@ {{ $preTitle ?? '' }} @isset($title) - <{{ $titleTag }} class="{{ $titleClass }}">{{ $title }} + <{{ $titleTag }} class="{{ $titleClass }}">{!! nl2br($title) !!} @endisset
diff --git a/resources/views/pages/our_solutions.blade.php b/resources/views/pages/our_solutions.blade.php new file mode 100644 index 0000000..cfd9f7f --- /dev/null +++ b/resources/views/pages/our_solutions.blade.php @@ -0,0 +1,184 @@ +@section('breadcrumbs') + {{-- Breadcrumbs disabled on home... --}} +@endsection + +@extends('layouts/app') + +@section('content') + + @php + $hero = $page->get('hero'); + $image = $page->getImageURLByCollection($hero['image']); + $title = $hero['title']; + $text = $hero['text']; + @endphp + + {{-- Hero Section --}} + + +
+ +

+ {!! nl2br($text) !!} +

+
+
+
+ + {{-- Intro block --}} + @php + $intro = $page->get('intro'); + $title = $intro['title']; + $text = $intro['text']; + @endphp + + + +
+
+ +
+
+ +

{!! $text !!}

+
+
+
+
+ + {{-- Markets block --}} + @php + $markets = $page->get('markets_title'); + $title = $markets['title']; + $text = $markets['text']; + @endphp + + + +

{!! $text !!}

+
+ + @foreach ($page->get('markets', []) as $market) +
+
+ +
+

+ {{ $market['title'] }} +

+
+
+ @endforeach +
+
+
+ + {{-- --}} + @php + $usp = $page->get('usp_title'); + $title = $usp['title']; + $text = $usp['text']; + @endphp + + + +

{!! $text !!}

+
+ + @foreach ($page->get('usp_items', []) as $item) +
+
+
+ +
+

+ {{ $item['title'] }} +

+

{{ $item['text'] }}

+
+
+ @endforeach +
+
+
+ + {{-- --}} + @php + $our_solutions_items = $page->get('our_solutions_items'); + @endphp + + + + + @foreach ($our_solutions_items as $item) +
+ +
+
+
+
+

+ {{ $item['title'] }} +

+

{{ $item['text'] }}

+ {{ __('Découvrir') }} +
+
+ @endforeach +
+
+
+ + {{-- --}} + @if(count($news) > 0) + {{-- News --}} + + + + + + + @endif + + + + + @foreach($page->get('faqs') as $faq) + @if($faq['response']) +
+
+
+ {{ $faq['question'] }} + @svg('arrow-down') +
+ {{ $faq['response'] }} +
+
+ @endif + @endforeach +
+
+ + {{-- --}} + + + + + {{-- Nested divs to allow grey backgrounds of columns to match the height of their content instead of total height --}} +
+ +
+ +
+
+ @form +
+
+ +
+ +
+
+ + {{-- --}} +@endsection diff --git a/resources/views/partials/header.blade.php b/resources/views/partials/header.blade.php index dbbc8f4..d1bba2b 100644 --- a/resources/views/partials/header.blade.php +++ b/resources/views/partials/header.blade.php @@ -31,6 +31,10 @@ +
+            @php( var_dump(CubistMenu::getNavigation()->getHrefByName('signin')) )
+        
+