From a3ac36bf782d6ea858f35827c6fa282414c67f0c Mon Sep 17 00:00:00 2001 From: Vincent Vanwaelscappel Date: Mon, 3 Jan 2022 19:16:56 +0100 Subject: [PATCH] wip #4914 @2 --- app/Http/Controllers/FrontController.php | 39 +++++++++++++----- resources/views/front/home.blade.php | 50 +++++++++++------------- 2 files changed, 51 insertions(+), 38 deletions(-) diff --git a/app/Http/Controllers/FrontController.php b/app/Http/Controllers/FrontController.php index 885d71c..e644bfe 100644 --- a/app/Http/Controllers/FrontController.php +++ b/app/Http/Controllers/FrontController.php @@ -2,29 +2,36 @@ namespace App\Http\Controllers; +use App\Models\Publication; use App\Models\Resource; use Cubist\Backpack\Magic\PageData; use Cubist\Util\Files\Files; -class FrontController extends Controller { - public function splash() { +class FrontController extends Controller +{ + public function splash() + { return view('front.splash', $this->_getDataFromCMS()); } - public function home() { + public function home() + { return view('front.home', $this->_getDataFromCMS()); } - public function resources() { + public function resources() + { return view('front.resources', $this->_getDataFromCMS()); } - public function medialibrary() { + public function medialibrary() + { return view('front.media-library', $this->_getDataFromCMS()); } - public function fluidbook($args = '') { + public function fluidbook($args = '') + { if (!$args) { $args = []; } else { @@ -48,12 +55,24 @@ class FrontController extends Controller { } - protected function _getDataFromCMS() { - return ['resources' => $this->_getResourcesFromCMS()]; + protected function _getDataFromCMS() + { + return ['resources' => $this->_getResourcesFromCMS(), 'home' => $this->_getHomeFromCMS(), 'medialibrary' => $this->_getMediaLibraryFromCMS()]; } - protected function _getResourcesFromCMS() { - $res= Resource::find('1')->getPageData(); + protected function _getHomeFromCMS() + { + return Publication::find('1')->getPageData(); + } + + protected function _getMediaLibraryFromCMS() + { + return []; + } + + protected function _getResourcesFromCMS() + { + $res = Resource::find('1')->getPageData(); return $res; } } diff --git a/resources/views/front/home.blade.php b/resources/views/front/home.blade.php index c1192ec..71e7f33 100644 --- a/resources/views/front/home.blade.php +++ b/resources/views/front/home.blade.php @@ -4,11 +4,7 @@ @php // TEMPORARY DATA MOCKUP - $logo = '/storage/102/groupe-84.svg'; - $subtitle = "Découvrez le coeur de l'offre sous forme de feuilleteur interactif"; - $button = "Découvrir l'offre"; - $button_link = '/front/coeur/index.html'; - $illustration = '/storage/137/home-magazine.jpg'; + $illustration = $home->getImageURLbyCollection($home->get('illustration')); $shortcuts = [ [ 'title' => 'Ressources', @@ -41,23 +37,18 @@ {{-- Left Column: logo + text + CTA --}}
- @if($logo) - Logo - @endif - @if($subtitle) -

- {{ $subtitle }} -

- @endif - @if($button) - - {{ $button }} - - @endif + Logo + +

+ {{ $home->get('subtitle') }} +

+ + {{ $home->get('button') }} +
{{-- Right Column: Illustration image --}} @@ -73,22 +64,25 @@ {{-- Link blocks --}} -
- @foreach($shortcuts as $shortcut) +
+ @foreach($home->get('raccourcis') as $shortcut) - +

{{ $shortcut['title'] }}

{{ $shortcut['content'] }}

{{-- Initial Mask --}} -
-- 2.39.5