namespace App\Models;
+use Spatie\MediaLibrary\Models\Media;
+
class News extends \Cubist\Backpack\app\Magic\Models\News
{
-
+ public function registerMediaConversions(Media $media = null) {
+ $this->addMediaConversion('thumb')
+ ->crop('crop-center', 348, 232);
+ }
}
'tab' => __('Réseaux Sociaux'),
]);
- // === Forms
+ //=== Forms
$this->addField([
'name' => 'form_privacy',
'type' => 'Markdown',
'label' => 'Mention légale vie privée affichée sous les formulaires',
'tab' => 'Formulaires',
]);
+
+ //=== Footer
+ $this->addField([
+ 'name' => 'footer_text',
+ 'type' => 'Textarea',
+ 'label' => __('Texte de footer'),
+ 'attributes' => [
+ 'rows' => 4,
+ ],
+ 'tab' => 'Footer',
+ ]);
+
+ $this->addField([
+ 'name' => 'footer_heading_contact',
+ 'type' => 'Text',
+ 'label' => __('Titre de colonne « Nous contacter »'),
+ 'tab' => 'Footer',
+ ]);
+
+ $this->addField([
+ 'name' => 'footer_heading_strengths',
+ 'type' => 'Text',
+ 'label' => __('Titre de colonne « PMI à votre service »'),
+ 'tab' => 'Footer'
+ ]);
+
+ //=== Strengths / Points Forts
+ $this->addField([
+ 'name' => 'strengths',
+ 'type' => 'BunchOfFieldsMultiple',
+ 'bunch' => 'App\SubForms\Strength',
+ 'label' => __('Points Forts'),
+ 'tab' => 'Footer',
+ ]);
}
}
--- /dev/null
+<?php
+
+
+namespace App\SubForms;
+
+use Cubist\Backpack\app\Magic\SubForm;
+
+class Strength extends SubForm
+{
+ public function init()
+ {
+ parent::init();
+ $this->addField([
+ 'name' => 'title',
+ 'label' => __('Titre'),
+ 'type' => 'Text',
+ ]);
+
+ $this->addField([
+ 'name' => 'description',
+ 'label' => __('Description'),
+ 'type' => 'Text',
+ ]);
+
+ $this->addField([
+ 'name' => 'icon',
+ 'label' => __('Picto'),
+ 'type' => 'Images',
+ 'translatable' => false,
+ ]);
+ }
+}
<div>
{{--Todo: handle missing images + get correct image size--}}
- <img class="mb-4" src="{{ $newsItem->getFirstMediaUrl($newsItem->image) }}" alt="{{ $newsItem->title }}">
+ <img class="mb-4" src="{{ $newsItem->getFirstMediaUrl($newsItem->image, 'thumb') }}" alt="{{ $newsItem->title }}">
<h4 class="font-display">{{ $newsItem->title }}</h4>
<p>{{ $newsItem['chapo'] }}</p>
@include('partials.logo')
</div>
<div class="footer-company-info leading-relaxed mb-6">
- <p>PM instrumentation distribue depuis 1986 des Capteurs et Systèmes de haute technicité.</p>
- <p>Issue de la société Schaevitz, PM Instrumentation a su développer une gamme de capteurs et systèmes
- d’excellente qualité provenant principalement des Etats-Unis.</p>
+ {!! nl2br($global->get('footer_text')) !!}
</div>
<div class="footer-social flex">
<a class="text-white hover:text-blue mr-6" href="{{ $global->get('social.twitter') }}" target="_blank"
</div>
<div class="footer-col">
- <h3 class="footer-col-heading">Nous contacter</h3>
+ <h3 class="footer-col-heading">{{ $global->get('footer_heading_contact', 'Nous contacter') }}</h3>
@include('partials.contact-details')
</div>
<div class="footer-col">
- <h3 class="footer-col-heading">PMI à votre service</h3>
+ <h3 class="footer-col-heading">{{ $global->get('footer_heading_strengths', 'PMI à votre service') }}</h3>
<ul>
- @for ($i = 1; $i <= 3; $i++)
+ @foreach ($global->get('strengths', []) as $strength)
<li class="flex items-center mb-6">
- <div class="border-2 w-12 h-12 mr-6 rounded-full"></div>
+ <img src="{{ $global->getImageURLByCollection($strength['icon']) }}" alt="" class="flex-shrink-0">
<div>
- Support Individuel<br>
- 30 ans d'expérience
+ <span class="font-display font-semibold">{{ $strength['title'] }}</span>
+ <br/>
+ <span class="text-grey-200">{{ $strength['description'] }}</span>
</div>
</li>
- @endfor
+ @endforeach
</ul>
</div>