]> _ Git - cubedesigners-v7.git/commitdiff
WIP #2033 @3.5
authorstephen@cubedesigners.com <stephen@cubedesigners.com@f5622870-0f3c-0410-866d-9cb505b7a8ef>
Tue, 22 Jan 2019 17:51:36 +0000 (17:51 +0000)
committerstephen@cubedesigners.com <stephen@cubedesigners.com@f5622870-0f3c-0410-866d-9cb505b7a8ef>
Tue, 22 Jan 2019 17:51:36 +0000 (17:51 +0000)
framework/application/forms/CMS/Sub/Casestudies/Studies.php
framework/application/models/Casestudy.php
framework/application/views/helpers/CasestudiesDetail.php
framework/application/views/scripts/common/body.phtml [new file with mode: 0644]
framework/application/views/scripts/studies/index.phtml
framework/application/views/scripts/templates/home.phtml
js/header.js
less/casestudies_detail.less

index 676a59a76b47041e727ad565a9a4fd2186140b27..6b98f3be4031c9b95b2259138d61cf40c9662318 100644 (file)
@@ -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
+}
index c0174b359f2c9fb53d364d07b4c89eab99e9987c..40ab8697c917ec6db4b440eb3062143508739901 100644 (file)
@@ -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');
index 8d6184e0a4311e0298bfcc3d65a6c4a1893a72ae..c6526d327da914e323d2ccc0ad5cbfdbc2d16cb9 100644 (file)
@@ -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 = '<div class="case">';
-               $res.='<div class="content">';
-               $res.='<h1>' . $studie->titre . '</h1>';
-               $res.='<h2>' . $studie->description . '</h2>';
+               $res.='<div class="casestudies-detail-header" style="background-image:url('. $header_image .')">';
+               $res.='<h1 class="casestudies-detail-title">' . $studie->titre . '</h1>';
+               $res.='<h2>' . $studie->legende . '</h2>';
                $res.='</div>';
 
-               $res .= '<div class="casestudies-detail-visuel">';
-               $res .= '<div class="visuel-holder content">';
-               $res .= '<div class="visuel">' . $visuel_detail . '</div>';
-
-               $res .= '<div class="legende">' . $studie->legende . '</div>';
-
-               if ($studie->url != '') {
-                       $res .= '<a class="but" href="' . $studie->url . '">' . __("Voir le site") . '</a>';
-               }
-
-               $res .= '</div>';
-               $res .= '</div>';
+//             $res .= '<div class="casestudies-detail-visuel">';
+//             $res .= '<div class="visuel-holder content">';
+//             $res .= '<div class="visuel">' . $visuel_detail . '</div>';
+//
+//             $res .= '<div class="legende">' . $studie->legende . '</div>';
+//
+//             if ($studie->url != '') {
+//                     $res .= '<a class="but" href="' . $studie->url . '">' . __("Voir le site") . '</a>';
+//             }
+//
+//             $res .= '</div>';
+//             $res .= '</div>';
 
                $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 (file)
index 0000000..60fcfd9
--- /dev/null
@@ -0,0 +1,9 @@
+<?php
+
+echo '<body class="'. $this->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" . '</body>' . "\n";
index 9d00408b33903de6b9be6cdfc79a6c1617a52c6e..decd9d0a9ea362b4d7edc2ddee30c607baca3daf 100644 (file)
@@ -12,4 +12,4 @@ echo $this->CasestudiesDetail($this->studie);
     </div>
 
     <?php echo $this->CasestudiesList($this->datas, $this->studie); ?>
-</div>
\ No newline at end of file
+</div>
index baa8b24dec124af72a21ac034c8238fc7a8fa971..fd1306ebfd30625871ba8649c9cc74fe7da645d2 100644 (file)
@@ -1,6 +1,7 @@
 <?php
 
 $this->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'));
 
index ae7e07429dcc28c99cc1b12249c585261f701723..c1073e675f241de650dbc2bafda9e3c34ebb4236 100644 (file)
@@ -8,9 +8,7 @@ var headerPos = 0;
 \r
 function load_header() {\r
 \r
-    // 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...\r
-    var headerColor = ($("#home-slideshow").length == 1) ? '#fff' : '#000'; // ## TEMPORARY\r
-\r
+    var headerColor = ($('body').hasClass('header-light')) ? '#fff' : '#000';\r
 \r
     var h = $('header');\r
     // Background-color & height - starts transparent and then fades in\r
index 73155232c8f2ce1b566d22c8e098c8c594cf9ab7..64576d11f7e4ba1f0eb2ef4fee023e49c8cdc46e 100644 (file)
@@ -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;
 
 .casestudies-list {
        padding-top: 60px;
-}
\ No newline at end of file
+}