]> _ Git - pmi.git/commitdiff
wip #7706 @2:30
authorsoufiane <soufiane@cubedesigners.com>
Tue, 9 Sep 2025 12:18:59 +0000 (14:18 +0200)
committersoufiane <soufiane@cubedesigners.com>
Tue, 9 Sep 2025 12:18:59 +0000 (14:18 +0200)
app/SubForms/News.php
app/SubForms/OurSolutionsUSP.php
app/Templates/Base.php
app/Templates/NotesTechniques.php [new file with mode: 0644]
resources/views/pages/notes_techniques.blade.php [new file with mode: 0644]
resources/views/pages/our_solutions.blade.php

index bda9d511fb5f2f1cb8c8203fef93c120342ce8ad..e0f4a6482c421b897f20cecb37179bdf325e2593 100644 (file)
@@ -17,7 +17,7 @@ use Illuminate\Support\Facades\DB;
 
 class News extends SubForm
 {
-    protected $defaultLang = 'fr';
+        protected $defaultLang = 'fr';
 
     public function init()
     {
@@ -66,7 +66,7 @@ class News extends SubForm
         ]);
     }
 
-    public function getDataByTable($table) {
+    public function getDataByTable($table, $column = 'id') {
         $column = 'title';
         $local = request()->query('locale') ?? $this->defaultLang;
 
index 5f93ffc3cd5ade0cea4b182b8f2603c2e89ac026..d7179096c7e34d3e6caf43cee13071bc05b7d67b 100644 (file)
@@ -3,12 +3,16 @@
 namespace App\SubForms;
 
 
-use App\Models\Product;
 use Cubist\Backpack\app\Magic\SubForm;
-use App\Models\Application;
+use App\SubForms\News;
 
 class OurSolutionsUSP extends SubForm
 {
+    public function getNews() {
+        $instance = new News();
+        return $instance->getDataByTable('cubist_cms_pages');
+    }
+
     public function init()
     {
         parent::init();
@@ -30,10 +34,9 @@ class OurSolutionsUSP extends SubForm
 
         $this->addField(['name' => 'page',
             'label' => 'Lien vers',
-            'type' => 'SelectFromModel',
-            'optionsmodel' => 'App\Models\Product',
-            'multiple' => false,
-            'attribute' => 'name',
+            'type' => 'SelectFromArray',
+            'options' => self::getNews(),
+            'multiple' => false
         ]);
     }
 }
index a93e98a27cb03233fd63e01d02c1bcc4a4478906..e7ebbff31b1ef6c85a6da546701d8607d28304b6 100644 (file)
@@ -29,6 +29,11 @@ class Base extends TemplatePage
     {
         $tab = 'Formulaire';
 
+        $this->addField(['name' => 'form_title',
+            'type' => 'Text',
+            'label' => 'Titre du formulaire',
+            'tab' => $tab]);
+
         $this->addField(['name' => 'form_intro',
             'type' => 'Markdown',
             'label' => 'Texte d\'introduction du formulaire',
diff --git a/app/Templates/NotesTechniques.php b/app/Templates/NotesTechniques.php
new file mode 100644 (file)
index 0000000..e3565be
--- /dev/null
@@ -0,0 +1,37 @@
+<?php
+
+namespace App\Templates;
+
+class NotesTechniques extends Base
+{
+
+    public function showInDropDown()
+    {
+        return true;
+    }
+
+    public function getName()
+    {
+        return 'Notes techniques';
+    }
+
+    public function init()
+    {
+        parent::init();
+
+        $this->addField(['name' => 'content',
+            'type' => 'Markdown',
+            'label' => 'Contenus',
+            'tab'=>'Contenus']);
+
+        $this->addField(['name' => 'faqs',
+            'label' => 'FAQs',
+            'type' => 'BunchOfFieldsMultiple',
+            'edit_label'=>"%question",
+            'bunch' => 'App\SubForms\Faq',
+            'tab' => 'FAQs']);
+
+        $this->addForm();
+    }
+
+}
diff --git a/resources/views/pages/notes_techniques.blade.php b/resources/views/pages/notes_techniques.blade.php
new file mode 100644 (file)
index 0000000..67ddc63
--- /dev/null
@@ -0,0 +1,54 @@
+@extends('layouts/app')
+
+@section('content')
+
+    <full-width padding="pb-4v">
+        <content>
+            @markdown($page->get('content'))
+        </content>
+    </full-width>
+
+    <full-width class="bg-grey-100 antialiased">
+        <content>
+            <text-block title="FAQs" />
+            @if($page->get('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
+            @endif
+        </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="$page->get('form_title')" />
+                </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 a9a73b06ffd98ed909a1dd0458f8351b073e6296..ae0197e305f3ba38c0a3a07d913258fe8b53d32d 100644 (file)
@@ -66,6 +66,9 @@
                             <h4 class="text-2xl sm:text-xl">
                                 {{ $market['title'] }}
                             </h4>
+                            @if($market['text'])
+                                <p>{{ $market['text'] }}</p>
+                            @endif
                         </div>
                     </div>
                 @endforeach
                             @php($prefix = 'news')
                         @endif
                         <article>
+                            <pre style="display: none;">
+                                <?php dump("prefix",$prefix.'/'.$item['page_'.$prefix]) ?>
+                            </pre>
 
-                            <a href="{{ $nav->getHrefById($prefix.'/'.$item['page_news']) }}" class="news-index-article-image block bg-grey-100">
+                            <a href="{{ $nav->getHrefById($prefix.'/'.$item['page_'.$prefix]) }}" class="news-index-article-image block bg-grey-100">
                                 <img src="{{ $page->getImageURLbyCollection($item['image']) }}" />
                             </a>
 
                                     {{ $item['date'] }}
                                 </time>
                                 <h4 class="text-2xl sm:text-xl">
-                                    <a class="text-navy" href="{{ $nav->getHrefById($prefix.'/'.$item['page_news']) }}">
+                                    <a class="text-navy" href="{{ $nav->getHrefById($prefix.'/'.$item['page_'.$prefix]) }}">
                                         {{ $item['title'] }}
                                     </a>
                                 </h4>
                                 <p>{{ $item['text'] }}</p>
 
-                                <p><a href="{{ $nav->getHrefById($prefix.'/'.$item['page_news']) }}">{{ __("En savoir plus") }}</a></p>
+                                <p><a href="{{ $nav->getHrefById($prefix.'/'.$item['page_product']) }}">{{ __("En savoir plus") }}</a></p>
                             </div>
 
                         </article>
 
                 {{-- 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" />
+                    <text-block :title="$page->get('form_title')" />
                 </div>
 
                 <div class="bg-grey-100 flex items-center justify-center">