From: Stephen Cameron Date: Tue, 16 Jul 2019 16:54:58 +0000 (+0200) Subject: WIP #2738 @6 X-Git-Url: http://git.cubedesigners.com/?a=commitdiff_plain;h=483157e044014e7bccc93fe6109f94a770c52c29;p=pmi.git WIP #2738 @6 --- diff --git a/app/Models/News.php b/app/Models/News.php index 1624bb0..ceabc08 100644 --- a/app/Models/News.php +++ b/app/Models/News.php @@ -2,7 +2,12 @@ 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); + } } diff --git a/app/Models/Settings.php b/app/Models/Settings.php index dd61791..465177c 100644 --- a/app/Models/Settings.php +++ b/app/Models/Settings.php @@ -36,12 +36,46 @@ class Settings extends \Cubist\Backpack\app\Magic\Models\Settings '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', + ]); } } diff --git a/app/SubForms/Strength.php b/app/SubForms/Strength.php new file mode 100644 index 0000000..4033f9b --- /dev/null +++ b/app/SubForms/Strength.php @@ -0,0 +1,32 @@ +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, + ]); + } +} diff --git a/resources/views/pages/home.blade.php b/resources/views/pages/home.blade.php index ace4d7e..dd7b5cd 100644 --- a/resources/views/pages/home.blade.php +++ b/resources/views/pages/home.blade.php @@ -124,7 +124,7 @@
{{--Todo: handle missing images + get correct image size--}} - {{ $newsItem->title }} + {{ $newsItem->title }}

{{ $newsItem->title }}

{{ $newsItem['chapo'] }}

diff --git a/resources/views/partials/footer.blade.php b/resources/views/partials/footer.blade.php index 5bd1475..06eb414 100644 --- a/resources/views/partials/footer.blade.php +++ b/resources/views/partials/footer.blade.php @@ -6,9 +6,7 @@ @include('partials.logo')