From: stephen@cubedesigners.com Date: Tue, 22 Jan 2019 17:51:36 +0000 (+0000) Subject: WIP #2033 @3.5 X-Git-Url: http://git.cubedesigners.com/?a=commitdiff_plain;h=a031ace64547e030ac5c98b04b1475fc1bd9a3f4;p=cubedesigners-v7.git WIP #2033 @3.5 --- diff --git a/framework/application/forms/CMS/Sub/Casestudies/Studies.php b/framework/application/forms/CMS/Sub/Casestudies/Studies.php index 676a59a..6b98f3b 100644 --- a/framework/application/forms/CMS/Sub/Casestudies/Studies.php +++ b/framework/application/forms/CMS/Sub/Casestudies/Studies.php @@ -45,6 +45,11 @@ class Cubedesigners_Form_CMS_Sub_Casestudies_Studies extends CubeIT_Form_List_Mo $legende->setLabel('Legende du visuel'); $this->addElementLocalized($legende, $isCompactTrad); + $header_style = new Zend_Form_Element_Select('header_style'); + $header_style->setLabel(__('Header style (detail page)')); + $header_style->setMultiOptions(['dark' => 'Dark text / light background', 'light' => 'Light text / dark background']); + $this->addElement($header_style); + $color = new CubeIT_Form_Element_Color('couleur'); $color->setLabel('Code couleur de la zone de contenu'); $this->addElement($color); @@ -83,4 +88,4 @@ class Cubedesigners_Form_CMS_Sub_Casestudies_Studies extends CubeIT_Form_List_Mo $this->setTitleColumn('titre'); } -} \ No newline at end of file +} diff --git a/framework/application/models/Casestudy.php b/framework/application/models/Casestudy.php index c0174b3..40ab869 100644 --- a/framework/application/models/Casestudy.php +++ b/framework/application/models/Casestudy.php @@ -9,6 +9,7 @@ class Cubedesigners_Model_Casestudy extends CubeIT_Model_Data_Table { protected $visuel; protected $visuel_detail; protected $legende; + protected $header_style; protected $couleur; protected $blocs; protected $categories; @@ -28,6 +29,7 @@ class Cubedesigners_Model_Casestudy extends CubeIT_Model_Data_Table { $casestudies->addColumn('visuel', 'string', array('length' => 128)); $casestudies->addColumn('visuel_detail', 'string', array('length' => 128)); $casestudies->addColumn('legende', 'text'); + $casestudies->addColumn('header_style', 'text'); $casestudies->addColumn('couleur', 'text'); $casestudies->addColumn('blocs', 'text'); $casestudies->addColumn('categories', 'text'); diff --git a/framework/application/views/helpers/CasestudiesDetail.php b/framework/application/views/helpers/CasestudiesDetail.php index 8d6184e..c6526d3 100644 --- a/framework/application/views/helpers/CasestudiesDetail.php +++ b/framework/application/views/helpers/CasestudiesDetail.php @@ -4,26 +4,30 @@ class Cubedesigners_View_Helper_CasestudiesDetail extends CubeIT_View_Helper_Abs public function CasestudiesDetail($studie) { - $visuel_detail = $this->view->imageProcess($studie->visuel_detail, $studie->titre, 980, 400, array('class' => 'responsive')); + if ($studie->header_style == 'light') { + $this->bodyClass .= 'header-light'; + } + + $header_image = CubeIT_View_Helper_ImageCms::getPath($studie->visuel_detail); $res = '
'; - $res.='
'; - $res.='

' . $studie->titre . '

'; - $res.='

' . $studie->description . '

'; + $res.='
'; + $res.='

' . $studie->titre . '

'; + $res.='

' . $studie->legende . '

'; $res.='
'; - $res .= '
'; - $res .= '
'; - $res .= '
' . $visuel_detail . '
'; - - $res .= '
' . $studie->legende . '
'; - - if ($studie->url != '') { - $res .= '' . __("Voir le site") . ''; - } - - $res .= '
'; - $res .= '
'; +// $res .= '
'; +// $res .= '
'; +// $res .= '
' . $visuel_detail . '
'; +// +// $res .= '
' . $studie->legende . '
'; +// +// if ($studie->url != '') { +// $res .= '' . __("Voir le site") . ''; +// } +// +// $res .= '
'; +// $res .= '
'; $style = ''; if ($studie->couleur != '') { @@ -107,4 +111,4 @@ class Cubedesigners_View_Helper_CasestudiesDetail extends CubeIT_View_Helper_Abs return $res; } -} \ No newline at end of file +} diff --git a/framework/application/views/scripts/common/body.phtml b/framework/application/views/scripts/common/body.phtml new file mode 100644 index 0000000..60fcfd9 --- /dev/null +++ b/framework/application/views/scripts/common/body.phtml @@ -0,0 +1,9 @@ +bodyClass .'">' . "\n"; +echo $this->bannerCookies(); +echo $this->render('admin/mockup.phtml'); +echo $this->render('admin/nav.phtml'); +echo $this->render('common/content.phtml'); +echo $this->render('ajax/loader.phtml'); +echo "\n" . '' . "\n"; diff --git a/framework/application/views/scripts/studies/index.phtml b/framework/application/views/scripts/studies/index.phtml index 9d00408..decd9d0 100644 --- a/framework/application/views/scripts/studies/index.phtml +++ b/framework/application/views/scripts/studies/index.phtml @@ -12,4 +12,4 @@ echo $this->CasestudiesDetail($this->studie);
CasestudiesList($this->datas, $this->studie); ?> -
\ No newline at end of file + diff --git a/framework/application/views/scripts/templates/home.phtml b/framework/application/views/scripts/templates/home.phtml index baa8b24..fd1306e 100644 --- a/framework/application/views/scripts/templates/home.phtml +++ b/framework/application/views/scripts/templates/home.phtml @@ -1,6 +1,7 @@ headScript()->addScriptAndStyle('home'); +$this->bodyClass .= ' header-light'; // Switch header to light mode (or should this be in the slideshow block?) $this->beforeMain = $this->homeSlideshow($this->slideshow); echo $this->liste($this->agence, false, array('id' => 'agency', 'class' => 'white')); diff --git a/js/header.js b/js/header.js index ae7e074..c1073e6 100644 --- a/js/header.js +++ b/js/header.js @@ -8,9 +8,7 @@ var headerPos = 0; function load_header() { - // Todo: Implement way of setting if header is light or dark (maybe from body class or class on header element?) and use that to set header text color (white/black) in order to color logo and links for starting point. Home page will be light along with selected case study pages and possibly others... - var headerColor = ($("#home-slideshow").length == 1) ? '#fff' : '#000'; // ## TEMPORARY - + var headerColor = ($('body').hasClass('header-light')) ? '#fff' : '#000'; var h = $('header'); // Background-color & height - starts transparent and then fades in diff --git a/less/casestudies_detail.less b/less/casestudies_detail.less index 7315523..64576d1 100644 --- a/less/casestudies_detail.less +++ b/less/casestudies_detail.less @@ -1,7 +1,10 @@ @import "00-constants"; +#headerPlaceholder { + display: none; // No placeholder so that header sits over the top of content +} + .case { - margin: 50px 0 0 0; h1 { font-size: 32px; } @@ -9,6 +12,29 @@ margin: 0 0 15px 0; } + .casestudies-detail-header { + height: 100vh; + display: flex; + flex-direction: column; + align-items: center; + justify-content: center; + background-size: cover; + background-position: center; + + .header-light & { + color: #fff; // When there's a light header, text should also be white + } + + h1 { + font-size: 92px; + margin-bottom: 0.1em; + } + + h2 { + font-size: 18px; + } + } + /* Case studies detail visuel */ .casestudies-detail-visuel { padding-bottom: 50px; @@ -139,4 +165,4 @@ .casestudies-list { padding-top: 60px; -} \ No newline at end of file +}