class News extends SubForm
{
- protected $defaultLang = 'fr';
+ protected $defaultLang = 'fr';
public function init()
{
]);
}
- public function getDataByTable($table) {
+ public function getDataByTable($table, $column = 'id') {
$column = 'title';
$local = request()->query('locale') ?? $this->defaultLang;
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();
$this->addField(['name' => 'page',
'label' => 'Lien vers',
- 'type' => 'SelectFromModel',
- 'optionsmodel' => 'App\Models\Product',
- 'multiple' => false,
- 'attribute' => 'name',
+ 'type' => 'SelectFromArray',
+ 'options' => self::getNews(),
+ 'multiple' => false
]);
}
}
{
$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',
--- /dev/null
+<?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();
+ }
+
+}
--- /dev/null
+@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
<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">