From: vincent@cubedesigners.com Date: Mon, 18 Jul 2016 11:13:33 +0000 (+0000) Subject: done #556 @1 X-Git-Url: http://git.cubedesigners.com/?a=commitdiff_plain;h=1e9aca0b0f1360dea818478f0ee1699e34251bdf;p=fluidbook-v3.git done #556 @1 --- diff --git a/framework/application/views/helpers/ContactFooter.php b/framework/application/views/helpers/ContactFooter.php index 0616b29..ef1ae52 100644 --- a/framework/application/views/helpers/ContactFooter.php +++ b/framework/application/views/helpers/ContactFooter.php @@ -9,7 +9,7 @@ class Fluidbook_View_Helper_ContactFooter extends CubeIT_View_Helper_Abstract { $this->addScriptAndStyle('103-contact-footer'); - $res = $this->htmlElement($cf['title'], 'h2', array('class' => 'title')); + $res = $this->title($cf['title'], 'h2'); $res .= $this->markupDotclear($cf['content']); $buttons = $this->linkCMS($cf['button']); $buttons .= $this->linkQuote('Demander un devis'); diff --git a/framework/application/views/helpers/ExemplePublication.php b/framework/application/views/helpers/ExemplePublication.php index 2dece31..96bb24c 100644 --- a/framework/application/views/helpers/ExemplePublication.php +++ b/framework/application/views/helpers/ExemplePublication.php @@ -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'); $backgrounds[] = array('image' => '/images/exemples/publications/dark.png', 'size' => '20% 100%', 'position' => '50% 0', 'blendmode' => 'multiply'); - $backgrounds = array_reverse($backgrounds); - $res = ''; - - 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 = '
'; + $res .= $this->title($title, 'h1', array('class' => 'col-6')); + $res .= '
'; + + 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 .= '
'; + + $res .= $this->_CSS($id, $block); + + $res .= '
'; + + if (!empty($block['icon'])) { + $res .= '
'; + } + + $res .= '
'; + $res .= '

' . $block['title'] . '

'; + $res .= $this->markupDotclear($block['content']); + $res .= '
'; // .feature-text + + $res .= '
'; // .feature-inner + $res .= '
'; // .feature-block + } + + $res .= '
'; // .feature-blocks + $res .= '
'; // .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 = ''; + + 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 diff --git a/framework/application/views/helpers/HeaderContactNav.php b/framework/application/views/helpers/HeaderContactNav.php index e625ace..059705b 100644 --- a/framework/application/views/helpers/HeaderContactNav.php +++ b/framework/application/views/helpers/HeaderContactNav.php @@ -5,9 +5,6 @@ class Fluidbook_View_Helper_HeaderContactNav extends CubeIT_View_Helper_Abstract * @return string */ public function headerContactNav() { - - - $res = array(); $res[] = $this->linkInternal(null, 'internal:agences',array('class'=>'agencies')); diff --git a/framework/application/views/helpers/HeaderLogo.php b/framework/application/views/helpers/HeaderLogo.php index 84f5d8c..7c2ada1 100644 --- a/framework/application/views/helpers/HeaderLogo.php +++ b/framework/application/views/helpers/HeaderLogo.php @@ -5,12 +5,9 @@ class Fluidbook_View_Helper_HeaderLogo extends CubeIT_View_Helper_Abstract { * @return string */ public function headerLogo() { - - $logos = $this->image('/images/logo/leave.svg', "", -1, -1, array('class' => 'leave')); $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')); - return $this->link($logos, '/', array('class' => 'logo')); } } \ No newline at end of file diff --git a/framework/application/views/helpers/IntroBlock.php b/framework/application/views/helpers/IntroBlock.php index 342fe5a..8a99a6d 100644 --- a/framework/application/views/helpers/IntroBlock.php +++ b/framework/application/views/helpers/IntroBlock.php @@ -8,7 +8,7 @@ class Fluidbook_View_Helper_IntroBlock extends CubeIT_View_Helper_Abstract { $res = '
'; $res .= '
'; - $res .= '

' . nl2br($intro['title']) . '

'; + $res .= $this->title($intro['title']); $res .= $this->markupDotclear($intro['content']); if ($additionnalContent) { $res .= $additionnalContent; diff --git a/framework/application/views/helpers/QuoteForm.php b/framework/application/views/helpers/QuoteForm.php index 4735ec8..ceb9820 100644 --- a/framework/application/views/helpers/QuoteForm.php +++ b/framework/application/views/helpers/QuoteForm.php @@ -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 = '
'; - $res .= '
'; - $res .= '

'. nl2br($this->option('quote_heading')) .'

'; - $res .= $this->markupDotclear($this->option('quote_description')); - $res .= '
'; // .text - $res .= '
'; - $res .= $form; - $res .= '
'; - $res .= '
'; // .form - $res .= '
'; // .request-quote - - return $res; - } + $res = '
'; + $res .= '
'; + $res .= $this->title($this->option('quote_heading')); + $res .= $this->markupDotclear($this->option('quote_description')); + $res .= '
'; // .text + $res .= '
'; + $res .= $form; + $res .= '
'; + $res .= '
'; // .form + $res .= '
'; // .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 index 0000000..39682cb --- /dev/null +++ b/framework/application/views/helpers/Title.php @@ -0,0 +1,11 @@ +_mergeAttributes($attributes, array('class' => 'title')); + return $this->htmlElement(str_replace("\n", '
', $content), $markup, $attributes); + } +} \ No newline at end of file diff --git a/less/002-common.less b/less/002-common.less index 6209613..09f8bed 100644 --- a/less/002-common.less +++ b/less/002-common.less @@ -46,6 +46,12 @@ h1, h2 { text-align: center; font-size: 30px; } + + br { + @media @m900 { + display: none; + } + } } }