]> _ Git - fluidbook-v3.git/commitdiff
done #556 @1
authorvincent@cubedesigners.com <vincent@cubedesigners.com@f5622870-0f3c-0410-866d-9cb505b7a8ef>
Mon, 18 Jul 2016 11:13:33 +0000 (11:13 +0000)
committervincent@cubedesigners.com <vincent@cubedesigners.com@f5622870-0f3c-0410-866d-9cb505b7a8ef>
Mon, 18 Jul 2016 11:13:33 +0000 (11:13 +0000)
framework/application/views/helpers/ContactFooter.php
framework/application/views/helpers/ExemplePublication.php
framework/application/views/helpers/FeaturesSection.php
framework/application/views/helpers/HeaderContactNav.php
framework/application/views/helpers/HeaderLogo.php
framework/application/views/helpers/IntroBlock.php
framework/application/views/helpers/QuoteForm.php
framework/application/views/helpers/Title.php [new file with mode: 0644]
less/002-common.less

index 0616b29eba63cf4be43fc1316c595ef5b6ac478d..ef1ae52aefa7fa2843c3442fd262383f4c901ede 100644 (file)
@@ -9,7 +9,7 @@ class Fluidbook_View_Helper_ContactFooter extends CubeIT_View_Helper_Abstract {
 \r
                $this->addScriptAndStyle('103-contact-footer');\r
 \r
-               $res = $this->htmlElement($cf['title'], 'h2', array('class' => 'title'));\r
+               $res = $this->title($cf['title'], 'h2');\r
                $res .= $this->markupDotclear($cf['content']);\r
                $buttons = $this->linkCMS($cf['button']);\r
                $buttons .= $this->linkQuote('Demander un devis');\r
index 2dece31a06fa102fc9fe85de5fad1e6e71210062..96bb24cf177aef29f7c0d5256db4a01dc205303f 100644 (file)
@@ -29,10 +29,8 @@ class Fluidbook_View_Helper_ExemplePublication extends CubeIT_View_Helper_Abstra
                $backgrounds[] = array('image' => '/images/exemples/publications/light.png', 'size' => '30% 100%', 'position' => '50% 0', 'blendmode' => 'soft-light');\r
                $backgrounds[] = array('image' => '/images/exemples/publications/dark.png', 'size' => '20% 100%', 'position' => '50% 0', 'blendmode' => 'multiply');\r
 \r
-\r
                $backgrounds = array_reverse($backgrounds);\r
 \r
-\r
                $res = '<style type="text/css">';\r
                $res .= "#" . $cssid . '{';\r
                foreach ($cssprops as $k => $cssprop) {\r
index 3025b7ec0600f8687ed133521951991ccaceae69..9024b9a771bee557448e6f7340c6cd5eaa3da6d9 100644 (file)
 
 class Fluidbook_View_Helper_FeaturesSection extends CubeIT_View_Helper_Abstract {
 
-    public function featuresSection($title, $blocks) {
-
-        $this->headScript()->addMasonry()->addJQueryTransform();
-
-        $res  = '<div class="content-wrapper grid wrap">';
-        $res .= '<h1 class="title col-6">' . nl2br($title) . '</h1>';
-        $res .= '<div class="feature-blocks">';
-
-        foreach ($blocks as $block) {
-
-            // Generate ID for CSS
-            $id = 'block-' . strtolower(CubeIT_Util_Text::str2URL($block['title']));
-
-            // Text colour is based on whether block has a gradient or not
-            $text_colour = $this->hasGradient($block) ? 'light' : 'dark';
-            
-            $res .= '<div class="feature-block text-'. $text_colour .' '. $block['layout'] .'" id="'. $id .'">';
-
-            $res .= $this->_CSS($id, $block);
-
-            $res .= '<div class="feature-inner">';
-
-            if (!empty($block['icon'])) {
-                $res .= '<div class="feature-icon fb-'. $block['icon'] .'"></div>';
-            }
-
-            $res .= '<div class="feature-text">';
-            $res .= '<h4 class="feature-title">'. $block['title'] .'</h4>';
-            $res .= $this->markupDotclear($block['content']);
-            $res .= '</div>'; // .feature-text
-            
-            $res .= '</div>'; // .feature-inner
-            $res .= '</div>'; // .feature-block
-        }
-
-        $res .= '</div>'; // .feature-blocks
-        $res .= '</div>'; // .content-wrapper
-
-        return $res;
-    }
-
-    protected function hasGradient($block) {
-        $gradient = $block['background_gradient'];
-        return !(empty($gradient['color1']) || empty($gradient['color2']));
-    }
-
-    protected function hasBGImage($block) {
-        return is_array($block['background_image']);
-    }
-
-    protected function _layoutData($layout) {
-        
-        switch($layout) {
-            case 'square-top':
-            case 'square-bottom':
-                $w = 2;
-                $h = 2;
-                break;
-            case 'rectangle-right':
-            case 'rectangle-bottom':
-                $w = 3;
-                $h = 2;
-                break;
-            case 'small-rectangle-tall':
-                $w = 1;
-                $h = 2;
-                break;
-            case 'small-rectangle-wide':
-                $w = 2;
-                $h = 1;
-        }
-        
-        if (!$w || !$h) return '';
-
-        return 'data-w="'. $w .'" data-h="'. $h .'"';
-    }
-
-    protected function _CSS($id, $block) {
-
-        // Set the width background images should disappear and be replaced by CSS gradients
-        // This should match the setting at the top of "410-features.less"
-        $breakpoint_single_column = '767px';
-
-        $res  = '<style scoped>';
-
-        $res .= "#$id {";
-        $res .= $this->_backgroundColour($block);
-
-        // Main CSS - block can have a bg image, a gradient, both or neither.
-        if ($this->hasBGImage($block)) {
-            $res .= $this->_backgroundImage($block);
-        } elseif ($this->hasGradient($block)) {
-            $res .= $this->_gradient($block);
-        }
-        
-        $res .= '}';
-
-        // 1 column version - swap background images for a gradient / solid colour
-        $res .= "@media screen and (max-width: $breakpoint_single_column) {";
-            $res .= "#$id {";
-
-            if ($this->hasGradient($block)) {
-                $res .= $this->_gradient($block);
-            } else {
-                $res .= 'background-image: none;';
-            }
-
-            $res .= '}';
-        $res .= '}';
-        $res .= '</style>';
-
-        return $res;
-    }
-
-    protected function _backgroundColour($block) {
-        if (empty($block['background_gradient']['color1'])) {
-            return '';
-        }
-
-        return 'background-color: '. $block['background_gradient']['color1'] .';';
-    }
-
-    protected function _backgroundImage($block) {
-        if (!is_array($block['background_image'])) return '';
-
-        $path = CubeIT_View_Helper_ImageCms::getPath($block['background_image']);
-        
-        return "background-image: url('$path');";
-    }
-
-    protected function _gradient($block) {
-
-        $gradient = $block['background_gradient'];
-
-        if (empty($gradient['color1']) || empty($gradient['color2'])) {
-            return '';
-        }
-        
-        $angle = '45deg';
-        $c1 = $gradient['color1'];
-        $c2 = $gradient['color2'];
-
-        return "background-image: -moz-linear-gradient($angle, $c1 0%, $c2 100%);
+       public function featuresSection($title, $blocks) {
+
+               $this->headScript()->addMasonry()->addJQueryTransform();
+
+               $res = '<div class="content-wrapper grid wrap">';
+               $res .= $this->title($title, 'h1', array('class' => 'col-6'));
+               $res .= '<div class="feature-blocks">';
+
+               foreach ($blocks as $block) {
+
+                       // Generate ID for CSS
+                       $id = 'block-' . strtolower(CubeIT_Util_Text::str2URL($block['title']));
+
+                       // Text colour is based on whether block has a gradient or not
+                       $text_colour = $this->hasGradient($block) ? 'light' : 'dark';
+
+                       $res .= '<div class="feature-block text-' . $text_colour . ' ' . $block['layout'] . '" id="' . $id . '">';
+
+                       $res .= $this->_CSS($id, $block);
+
+                       $res .= '<div class="feature-inner">';
+
+                       if (!empty($block['icon'])) {
+                               $res .= '<div class="feature-icon fb-' . $block['icon'] . '"></div>';
+                       }
+
+                       $res .= '<div class="feature-text">';
+                       $res .= '<h4 class="feature-title">' . $block['title'] . '</h4>';
+                       $res .= $this->markupDotclear($block['content']);
+                       $res .= '</div>'; // .feature-text
+
+                       $res .= '</div>'; // .feature-inner
+                       $res .= '</div>'; // .feature-block
+               }
+
+               $res .= '</div>'; // .feature-blocks
+               $res .= '</div>'; // .content-wrapper
+
+               return $res;
+       }
+
+       protected function hasGradient($block) {
+               $gradient = $block['background_gradient'];
+               return !(empty($gradient['color1']) || empty($gradient['color2']));
+       }
+
+       protected function hasBGImage($block) {
+               return is_array($block['background_image']);
+       }
+
+       protected function _layoutData($layout) {
+
+               switch ($layout) {
+                       case 'square-top':
+                       case 'square-bottom':
+                               $w = 2;
+                               $h = 2;
+                               break;
+                       case 'rectangle-right':
+                       case 'rectangle-bottom':
+                               $w = 3;
+                               $h = 2;
+                               break;
+                       case 'small-rectangle-tall':
+                               $w = 1;
+                               $h = 2;
+                               break;
+                       case 'small-rectangle-wide':
+                               $w = 2;
+                               $h = 1;
+               }
+
+               if (!$w || !$h)
+                       return '';
+
+               return 'data-w="' . $w . '" data-h="' . $h . '"';
+       }
+
+       protected function _CSS($id, $block) {
+
+               // Set the width background images should disappear and be replaced by CSS gradients
+               // This should match the setting at the top of "410-features.less"
+               $breakpoint_single_column = '767px';
+
+               $res = '<style scoped>';
+
+               $res .= "#$id {";
+               $res .= $this->_backgroundColour($block);
+
+               // Main CSS - block can have a bg image, a gradient, both or neither.
+               if ($this->hasBGImage($block)) {
+                       $res .= $this->_backgroundImage($block);
+               } elseif ($this->hasGradient($block)) {
+                       $res .= $this->_gradient($block);
+               }
+
+               $res .= '}';
+
+               // 1 column version - swap background images for a gradient / solid colour
+               $res .= "@media screen and (max-width: $breakpoint_single_column) {";
+               $res .= "#$id {";
+
+               if ($this->hasGradient($block)) {
+                       $res .= $this->_gradient($block);
+               } else {
+                       $res .= 'background-image: none;';
+               }
+
+               $res .= '}';
+               $res .= '}';
+               $res .= '</style>';
+
+               return $res;
+       }
+
+       protected function _backgroundColour($block) {
+               if (empty($block['background_gradient']['color1'])) {
+                       return '';
+               }
+
+               return 'background-color: ' . $block['background_gradient']['color1'] . ';';
+       }
+
+       protected function _backgroundImage($block) {
+               if (!is_array($block['background_image']))
+                       return '';
+
+               $path = CubeIT_View_Helper_ImageCms::getPath($block['background_image']);
+
+               return "background-image: url('$path');";
+       }
+
+       protected function _gradient($block) {
+
+               $gradient = $block['background_gradient'];
+
+               if (empty($gradient['color1']) || empty($gradient['color2'])) {
+                       return '';
+               }
+
+               $angle = '45deg';
+               $c1 = $gradient['color1'];
+               $c2 = $gradient['color2'];
+
+               return "background-image: -moz-linear-gradient($angle, $c1 0%, $c2 100%);
 background-image: -webkit-linear-gradient($angle, $c1 0%, $c2 100%);
 background-image: linear-gradient($angle, $c1 0%, $c2 100%);
 filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='$c1', endColorstr='$c2',GradientType=1);";
-    }
+       }
 
 }
\ No newline at end of file
index e625ace85a402b06987e7a2e7bdf32520f37b9f9..059705b10a882ccaac61a854111c99a89caa38dc 100644 (file)
@@ -5,9 +5,6 @@ class Fluidbook_View_Helper_HeaderContactNav extends CubeIT_View_Helper_Abstract
         * @return string\r
         */\r
        public function headerContactNav() {\r
-\r
-               \r
-\r
                $res = array();\r
 \r
                $res[] = $this->linkInternal(null, 'internal:agences',array('class'=>'agencies'));\r
index 84f5d8c9cb101957ad79107f92f1fe102c672b04..7c2ada17627dedf54fcced9f5a9d11f36bda2517 100644 (file)
@@ -5,12 +5,9 @@ class Fluidbook_View_Helper_HeaderLogo extends CubeIT_View_Helper_Abstract {
         * @return string\r
         */\r
        public function headerLogo() {\r
-\r
-\r
                $logos = $this->image('/images/logo/leave.svg', "", -1, -1, array('class' => 'leave'));\r
                $logos .= $this->htmlElement($this->image('/images/logo/text-white.svg', 'Fluidbook', -1, -1, array('class' => 'text-white')) . $this->image('/images/logo/text-dark.svg', '', -1, -1, array('class' => 'text-dark')), 'div', array('class' => 'text'));\r
 \r
-\r
                return $this->link($logos, '/', array('class' => 'logo'));\r
        }\r
 }
\ No newline at end of file
index 342fe5a4737b0ba03c31e54d7a49828b159ce0e5..8a99a6dbef813be493ba1f4d1669c3ec86b94268 100644 (file)
@@ -8,7 +8,7 @@ class Fluidbook_View_Helper_IntroBlock extends CubeIT_View_Helper_Abstract {
                $res = '<div class="grid">';
                $res .= '<div class="col-2">';
 
-               $res .= '<h1 class="title">' . nl2br($intro['title']) . '</h1>';
+               $res .= $this->title($intro['title']);
                $res .= $this->markupDotclear($intro['content']);
                if ($additionnalContent) {
                        $res .= $additionnalContent;
index 4735ec8426cd6aeaaa67579ba52462391627bf8f..ceb9820413db9623c0b837be51995a9baf2c5f5c 100644 (file)
@@ -2,28 +2,28 @@
 
 class Fluidbook_View_Helper_QuoteForm extends CubeIT_View_Helper_Abstract {
 
-    public function quoteForm($formID = null) {
+       public function quoteForm($formID = null) {
 
-        $this->headScript()->addScriptAndStyle('315-quote');
+               $this->headScript()->addScriptAndStyle('315-quote');
 
-        $form = new Fluidbook_Form_RequestQuote();
+               $form = new Fluidbook_Form_RequestQuote();
 
-        if ($formID) {
-            $form->setId($formID);
-            $form->setAction($form->getAction() .'/'. $formID);
-        }
+               if ($formID) {
+                       $form->setId($formID);
+                       $form->setAction($form->getAction() . '/' . $formID);
+               }
 
-        $res  = '<div class="request-quote content-wrapper grid">';
-        $res .= '<div class="text col-2">';
-        $res .= '<h1 class="title">'. nl2br($this->option('quote_heading')) .'</h1>';
-        $res .= $this->markupDotclear($this->option('quote_description'));
-        $res .= '</div>'; // .text
-        $res .= '<div class="form col-4">';
-        $res .= $form;
-        $res .= '<div class="validation-messages"></div>';
-        $res .= '</div>'; // .form
-        $res .= '</div>'; // .request-quote
-        
-        return $res;
-    }
+               $res = '<div class="request-quote content-wrapper grid">';
+               $res .= '<div class="text col-2">';
+               $res .= $this->title($this->option('quote_heading'));
+               $res .= $this->markupDotclear($this->option('quote_description'));
+               $res .= '</div>'; // .text
+               $res .= '<div class="form col-4">';
+               $res .= $form;
+               $res .= '<div class="validation-messages"></div>';
+               $res .= '</div>'; // .form
+               $res .= '</div>'; // .request-quote
+
+               return $res;
+       }
 }
\ No newline at end of file
diff --git a/framework/application/views/helpers/Title.php b/framework/application/views/helpers/Title.php
new file mode 100644 (file)
index 0000000..39682cb
--- /dev/null
@@ -0,0 +1,11 @@
+<?php\r
+\r
+class Fluidbook_View_Helper_Title extends CubeIT_View_Helper_HtmlElement {\r
+       /**\r
+        * @return string\r
+        */\r
+       public function title($content, $markup = 'h1', $attributes = array()) {\r
+               $attributes = $this->_mergeAttributes($attributes, array('class' => 'title'));\r
+               return $this->htmlElement(str_replace("\n", ' <br />', $content), $markup, $attributes);\r
+       }\r
+}
\ No newline at end of file
index 62096137ebc7d716cc7c3a7fc3b98866b6e27c18..09f8bed2a7a6b9c6df8ffd2e9168f67d12852fd1 100644 (file)
@@ -46,6 +46,12 @@ h1, h2 {
                        text-align: center;\r
                        font-size: 30px;\r
                }\r
+\r
+               br {\r
+                       @media @m900 {\r
+                               display: none;\r
+                       }\r
+               }\r
        }\r
 }\r
 \r