]> _ Git - pmi.git/commitdiff
wip #7098 @14:00
authorsoufiane <soufiane@cubedesigners.com>
Mon, 30 Sep 2024 16:15:12 +0000 (18:15 +0200)
committersoufiane <soufiane@cubedesigners.com>
Mon, 30 Sep 2024 16:15:12 +0000 (18:15 +0200)
13 files changed:
.env.dev
app/SubForms/Faq.php [new file with mode: 0644]
app/SubForms/OurSolutionsUSP.php [new file with mode: 0644]
app/SubForms/TitleTextImage.php [new file with mode: 0644]
app/Templates/Base.php
app/Templates/OurSolutions.php [new file with mode: 0644]
resources/js/app.js
resources/styles/components/faq.styl [new file with mode: 0644]
resources/styles/components/our-solutions.styl [new file with mode: 0644]
resources/views/components/text-block.blade.php
resources/views/pages/our_solutions.blade.php [new file with mode: 0644]
resources/views/partials/header.blade.php
resources/views/partials/intro.blade.php

index cc07b24076d22b4e2bbeb0de3316ffacfb58be8a..0305ea1305081fd263d12f34fb16134c8d65085d 100644 (file)
--- 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 (file)
index 0000000..e8769fd
--- /dev/null
@@ -0,0 +1,31 @@
+<?php
+
+namespace App\SubForms;
+
+use Cubist\Backpack\app\Magic\SubForm;
+
+class Faq extends SubForm
+{
+
+
+    public function init()
+    {
+        parent::init();
+
+        $this->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 (file)
index 0000000..9703950
--- /dev/null
@@ -0,0 +1,33 @@
+<?php
+
+namespace App\SubForms;
+
+
+use Cubist\Backpack\app\Magic\SubForm;
+
+class OurSolutionsUSP extends SubForm
+{
+    public function init()
+    {
+        parent::init();
+
+        $this->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 (file)
index 0000000..aa2d962
--- /dev/null
@@ -0,0 +1,29 @@
+<?php
+
+namespace App\SubForms;
+
+
+use Cubist\Backpack\app\Magic\SubForm;
+
+class TitleTextImage extends SubForm
+{
+    public function init()
+    {
+        parent::init();
+
+        $this->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']);
+    }
+}
index 7ba53a96930d935249c2080a01134715fe831122..a93e98a27cb03233fd63e01d02c1bcc4a4478906 100644 (file)
@@ -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 (file)
index 0000000..e5d9b38
--- /dev/null
@@ -0,0 +1,93 @@
+<?php
+
+namespace App\Templates;
+
+use App\Models\Application;
+use App\Models\News;
+use Cubist\Backpack\app\Magic\PageData;
+
+class OurSolutions extends Base
+{
+
+    public function showInDropDown()
+    {
+        return true;
+    }
+
+    public function getName()
+    {
+        return 'Nos solutions';
+    }
+
+    public function init()
+    {
+        $this->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);
+    }
+
+}
index b40e350588dff03219e809c8ff768eac768cb962..a01fa7db4dd6a8901cec221e3d3a662663332474 100644 (file)
@@ -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 (file)
index 0000000..91371f8
--- /dev/null
@@ -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 (file)
index 0000000..5029d17
--- /dev/null
@@ -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
index 3c1c6d28dfd9c5b678002ebe94957dbb9229b1d4..aadeedafd5fcb070b904d88bc13f69fa03c7d59f 100644 (file)
@@ -12,7 +12,7 @@
     {{ $preTitle ?? '' }}
 
     @isset($title)
-        <{{ $titleTag }} class="{{ $titleClass }}">{{ $title }}</{{ $titleTag }}>
+        <{{ $titleTag }} class="{{ $titleClass }}">{!! nl2br($title) !!}</{{ $titleTag }}>
     @endisset
 
     <div class="text-block-body">
diff --git a/resources/views/pages/our_solutions.blade.php b/resources/views/pages/our_solutions.blade.php
new file mode 100644 (file)
index 0000000..cfd9f7f
--- /dev/null
@@ -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 --}}
+    <full-width padding="pt-2v pb-4v" class="bg-grey-100 text-white antialiased relative hero">
+        <content>
+            <div class="hero-bg" style="background-image: url({{$image}})"></div>
+            <text-block :title="$title" title-tag="h1" title-class="h1 text-inherit mb-0.75v">
+                <h2 class="text-3xl md:text-2xl font-semibold text-white">
+                    {!! nl2br($text) !!}
+                </h2>
+            </text-block>
+        </content>
+    </full-width>
+
+    {{-- Intro block --}}
+    @php
+        $intro = $page->get('intro');
+        $title = $intro['title'];
+        $text = $intro['text'];
+    @endphp
+    <full-width class="">
+        <content>
+            <grid cols="2" class="md:grid-cols-1">
+                <div>
+                    <div class="">
+                        <img src="{{ $page->getImageURLByCollection($intro['image']) }}" />
+                    </div>
+                </div>
+                <text-block class="p-0" title-class="h2 text-block-body" :title="$title" title-tag="h2">
+                    <p>{!! $text !!}</p>
+                </text-block>
+            </grid>
+        </content>
+    </full-width>
+
+    {{-- Markets block --}}
+    @php
+        $markets = $page->get('markets_title');
+        $title = $markets['title'];
+        $text = $markets['text'];
+    @endphp
+    <full-width padding="py-3v" class="bg-grey-100 antialiased">
+        <content>
+            <text-block class="pb-16" title-class="h2" :title="$title">
+                <p class="text-block-body">{!! $text !!}</p>
+            </text-block>
+            <grid cols="4" class="sm:grid-cols-2 xs:grid-cols-1">
+                @foreach ($page->get('markets', []) as $market)
+                    <div class="">
+                        <div class="bg-cover mb-8" style="padding-bottom: 75.25%; background-image: url({{$page->getImageURLbyCollection($market['image'])}}) "></div>
+
+                        <div class="">
+                            <h4 class="text-2xl sm:text-xl">
+                                {{ $market['title'] }}
+                            </h4>
+                        </div>
+                    </div>
+                @endforeach
+            </grid>
+        </content>
+    </full-width>
+
+    {{--  --}}
+    @php
+        $usp = $page->get('usp_title');
+        $title = $usp['title'];
+        $text = $usp['text'];
+    @endphp
+    <full-width padding="py-3v" class="antialiased">
+        <content>
+            <text-block class="pb-16" title-class="h2" :title="$title">
+                <p class="text-block-body">{!! $text !!}</p>
+            </text-block>
+            <grid cols="3" class="sm:grid-cols-2 xs:grid-cols-1">
+                @foreach ($page->get('usp_items', []) as $item)
+                    <div class="">
+                        <div class="bg-cover mb-8" style="padding-bottom: 56.25%; background-image: url({{ $page->getImageURLbyCollection($item['image']) }})">
+                        </div>
+
+                        <div class="">
+                            <h3 class="text-2xl sm:text-xl mb-4">
+                                {{ $item['title'] }}
+                            </h3>
+                            <p>{{ $item['text'] }}</p>
+                        </div>
+                    </div>
+                @endforeach
+            </grid>
+        </content>
+    </full-width>
+
+    {{--  --}}
+    @php
+        $our_solutions_items = $page->get('our_solutions_items');
+    @endphp
+    <full-width padding="py-3v bg-navy text-white">
+        <content>
+            <text-block :title="__('Nos solutions')" title-class="h1 text-inherit" />
+            <grid cols="3" class="sm:grid-cols-2 xs:grid-cols-1">
+                @foreach ($our_solutions_items as $item)
+                    <div class="">
+                        <a href="{{ $nav->getHrefById($item['page']) }}">
+                            <div class="bg-cover mb-8" style="padding-bottom: 56.25%; background-image: url({{ $page->getImageURLbyCollection($item['image']) }})">
+                            </div>
+                        </a>
+                        <div class="">
+                            <h3 class="text-2xl sm:text-xl text-white">
+                                {{ $item['title'] }}
+                            </h3>
+                            <p>{{ $item['text'] }}</p>
+                            <a href="{{ $nav->getHrefById($item['page']) }}">{{ __('Découvrir') }}</a>
+                        </div>
+                    </div>
+                @endforeach
+            </grid>
+        </content>
+    </full-width>
+
+    {{--  --}}
+    @if(count($news) > 0)
+        {{-- News --}}
+        <full-width>
+            <content>
+                <text-block :title="__('Actus Monitoring/IOT')"/>
+                <news-grid :items="$news" />
+            </content>
+        </full-width>
+    @endif
+
+    <full-width class="bg-grey-100 antialiased">
+        <content>
+            <text-block title="FAQs" />
+            @foreach($page->get('faqs') as $faq)
+                @if($faq['response'])
+                <div class="faq-container-item pl-2v">
+                    <div class="faq-item py-8 pr-4">
+                        <div class="question text-2xl text-navy font-semibold pb-2 flex justify-between align-center">
+                            {{ $faq['question'] }}
+                            @svg('arrow-down')
+                        </div>
+                        <span class="faq-response">{{ $faq['response'] }}</span>
+                    </div>
+                </div>
+                @endif
+            @endforeach
+        </content>
+    </full-width>
+
+    {{--  --}}
+    <full-width padding="pt-2v pb-4v" class="antialiased">
+        <content>
+            <grid cols="auto" class="sm:grid-cols-1">
+
+                {{-- Nested divs to allow grey backgrounds of columns to match the height of their content instead of total height --}}
+                <div>
+                    <text-block title="Besoin de surveiller votre infrastructure ? Contactez-nous" />
+                </div>
+
+                <div class="bg-grey-100 flex items-center justify-center">
+                    <div class="bg-grey-100 p-1v">
+                        @form
+                    </div>
+                </div>
+
+            </grid>
+
+        </content>
+    </full-width>
+
+    {{--  --}}
+@endsection
index dbbc8f45d14077f31b53fcdbf665c2f7c00bbb3b..d1bba2b87d18b65308ba25b731db2f5edbbbf3c4 100644 (file)
 
         </nav>
 
+        <pre style="display:none;">
+            @php( var_dump(CubistMenu::getNavigation()->getHrefByName('signin')) )
+        </pre>
+
         <ul class="account-header relative">
             <li class="{{ Route::currentRouteName() === "client" ? "active" : '' }}">
                 <a href="{{ Auth::guard('web-clients')->check() ? '#' : CubistMenu::getNavigation()->getHrefByName('signin') }}"
index edaf3d8178f0aee2c97e7fb41d7d5e9932c1d1f9..33e73d5f55fe3bb75b0c6d9b0c8b48a8428e8ec0 100644 (file)
@@ -6,8 +6,10 @@
 
     $title = \Illuminate\Support\Str::ucfirst($page->get("$name.title", $page->get("name")));
     $title_tag = $title_tag ?? 'h1';
+    $title_class = isset($title_tag_class) ? $title_tag_class : 'h1';
     $image = $page->getImageURL("$name.image",'',asset('storage/uploads/images/products-intro.jpg'));
     $alt = $page->getImageAlt("$name.image",$title);
+    $title_class .= isset($overlap) ? " overlap-left" : "";
     $class = $class ?? '';
     $padding = $padding ?? null; // Pass null so it doesn't override default padding
     $button = $page->get("$name.button");
@@ -26,7 +28,7 @@
             </column>
 
             <column>
-                <text-block class="pt-2v" title-class="h1 overlap-left" :title="$title" :title-tag="$title_tag">
+                <text-block class="pt-2v" :title-class="$title_class" :title="$title" :title-tag="$title_tag">
                     <p>@markdown($page->get("$name.text"))</p>
 
                     @if ($button)