From eeeece33111806c66daaf5f0ca2003c8f1a8b7c2 Mon Sep 17 00:00:00 2001 From: "vincent@cubedesigners.com" Date: Mon, 9 Jan 2017 17:21:47 +0000 Subject: [PATCH] done #1081 @2 --- framework/application/Bootstrap.php | 3 +- framework/application/forms/CMS/Contact.php | 24 ++++++----- .../application/forms/CMS/Landingcampaign.php | 10 +++++ framework/application/forms/CMS/Sub/Intro.php | 8 ++++ .../application/views/helpers/IntroBlock.php | 43 +++++++++++++++++-- .../views/scripts/templates/contact.phtml | 16 ++++--- .../scripts/templates/landingcampaign.phtml | 14 ++++++ js/102-intro.js | 4 +- less/002-common.less | 10 ++++- less/102-intro.less | 11 +++++ less/310-contact.less | 9 ---- 11 files changed, 120 insertions(+), 32 deletions(-) create mode 100644 framework/application/forms/CMS/Landingcampaign.php create mode 100644 framework/application/views/scripts/templates/landingcampaign.phtml diff --git a/framework/application/Bootstrap.php b/framework/application/Bootstrap.php index 0fe33d2..576cb35 100644 --- a/framework/application/Bootstrap.php +++ b/framework/application/Bootstrap.php @@ -14,13 +14,12 @@ class Bootstrap extends CubeIT_Bootstrap { * @return array */ public function getCMSTemplates() { - - $templates['texte'] = 'Texte'; $templates['fonctionnalites'] = 'Fonctionnalites'; $templates['exemples'] = 'Exemples'; $templates['exemplessub'] = 'Exemples (niveau 2)'; $templates['contact'] = 'Contact'; + $templates['landingcampaign'] = 'Landing Campagne (Intro + formulaire)'; $templates['agences'] = 'Agences'; $templates['faq'] = 'FAQ'; $templates = array_merge($templates, parent::getCMSTemplates()); diff --git a/framework/application/forms/CMS/Contact.php b/framework/application/forms/CMS/Contact.php index 2d7171f..bac8e66 100644 --- a/framework/application/forms/CMS/Contact.php +++ b/framework/application/forms/CMS/Contact.php @@ -2,18 +2,22 @@ class Fluidbook_Form_CMS_Contact extends Fluidbook_Form_CMS_Base { - public function init() { - parent::init(); + public function init() { + parent::init(); - $resellers_title = new CubeIT_Form_Element_Textarea('resellers_title'); - $resellers_title->setLabel('Titre pour bloc "Revendeurs internationaux"'); - $resellers_title->setAttrib('rows', 3); - $this->addElement($resellers_title); + $form_first = new Zend_Form_Element_Checkbox('form_first'); + $form_first->setLabel('Le formulaire de demande de devis apparaît en haut'); + $this->addElement($form_first); - $resellers = new Fluidbook_Form_CMS_Sub_Resellers_Resellers(); - $resellers->setLegend('Revendeurs'); - $this->addSubForm($resellers, 'resellers'); + $resellers_title = new CubeIT_Form_Element_Textarea('resellers_title'); + $resellers_title->setLabel('Titre pour bloc "Revendeurs internationaux"'); + $resellers_title->setAttrib('rows', 3); + $this->addElement($resellers_title); - } + $resellers = new Fluidbook_Form_CMS_Sub_Resellers_Resellers(); + $resellers->setLegend('Revendeurs'); + $this->addSubForm($resellers, 'resellers'); + + } } \ No newline at end of file diff --git a/framework/application/forms/CMS/Landingcampaign.php b/framework/application/forms/CMS/Landingcampaign.php new file mode 100644 index 0000000..ae5d947 --- /dev/null +++ b/framework/application/forms/CMS/Landingcampaign.php @@ -0,0 +1,10 @@ +setLabel('Bouton'); $this->addSubForm($button, 'button'); + $headerTheme = new Zend_Form_Element_Checkbox('header_theme'); + $headerTheme->setLabel('Thème du header clair'); + $this->addElement($headerTheme); + + $textcolor = new CubeIT_Form_Element_Color('text_color'); + $textcolor->setLabel('Couleur du texte (laisser vide pour utiliser les couleurs par défaut)'); + $this->addElement($textcolor); + $color = new CubeIT_Form_Element_Color('bg_color'); $color->setLabel('Couleur de fond'); $color->setValue('#ffffff'); diff --git a/framework/application/views/helpers/IntroBlock.php b/framework/application/views/helpers/IntroBlock.php index 26a34f1..7653e29 100644 --- a/framework/application/views/helpers/IntroBlock.php +++ b/framework/application/views/helpers/IntroBlock.php @@ -5,11 +5,11 @@ class Fluidbook_View_Helper_IntroBlock extends CubeIT_View_Helper_Abstract { public function introBlock($intro, $additionnalContent = '', $outsideContent = '', $paddingTop = true) { $this->addScriptAndStyle('102-intro'); + $res = '
'; $res .= '
'; - $res .= $this->title($intro['title']); - $res .= $this->markupDotclear($intro['content']); + $res .= $this->_content($intro['content']); if ($additionnalContent) { $res .= $additionnalContent; } @@ -32,6 +32,43 @@ class Fluidbook_View_Helper_IntroBlock extends CubeIT_View_Helper_Abstract { $attrs['class'][] = 'nopad'; } - return $this->htmlElement($res, 'section', $attrs); + if ($intro['header_theme']) { + $attrs['data-header-theme'] = 'light'; + } + + $style = ''; + if ($intro['text_color']) { + $s = '@color:' . $intro['text_color'] . ' ;'; + $s .= '.intro{' . "\n"; + $s .= 'h1,h2,h3,h4,h5,h6,b,strong,i,em,p,a,address{color:@color !important;}' . "\n"; + $s .= 'h1.title,h2.title,hr{&:after{background-color:@color !important;}}' . "\n"; + $s .= '}'; + $style = $this->styleLess($s); + } + + return $style . $this->htmlElement($res, 'section', $attrs); + } + + protected function _content($c) { + + $res = $this->markupDotclear($c); + if (stristr($res, '$adresse')) { + $address = $this->option('address'); + $locale = new Zend_Locale(); + $country = strtoupper($locale->getTranslation($address['pays'], 'Territory')); + $content = '
'; + $content .= '

' . $address['company'] . '

'; + $content .= $address['adresse']; + $content .= '
'; + $content .= "{$address['code_postal']} {$address['ville']} - $country"; + $content .= '
'; + $content .= __('Tél :') . ' ' . $this->linkPhone($address['phone']); + $content .= '
'; + $content .= __('email :') . ' ' . $this->linkEmail($address['email']); + $content .= '
'; + + $res = str_replace('$adresse', $content, $res); + } + return $res; } } \ No newline at end of file diff --git a/framework/application/views/scripts/templates/contact.phtml b/framework/application/views/scripts/templates/contact.phtml index b552446..fc74234 100644 --- a/framework/application/views/scripts/templates/contact.phtml +++ b/framework/application/views/scripts/templates/contact.phtml @@ -16,14 +16,18 @@ $content .= '
'; $content .= __('email :') . ' ' . $this->linkEmail($address['email']); $content .= ''; -$res = ''; - // Request Quote form -$res .= $this->quoteForm(null, true); +$form = $this->quoteForm(null, $this->form_first); + +$intro = '
'; +$intro .= $this->introBlock($this->intro, $content, '', !$this->form_first); +$intro .= '
'; // .contact-intro -$res .= '
'; -$res .= $this->introBlock($this->intro, $content, '', false); -$res .= '
'; // .contact-intro +if ($this->form_first) { + $res = $form . $intro; +} else { + $res = $intro . $form; +} // Resellers diff --git a/framework/application/views/scripts/templates/landingcampaign.phtml b/framework/application/views/scripts/templates/landingcampaign.phtml new file mode 100644 index 0000000..95a0db5 --- /dev/null +++ b/framework/application/views/scripts/templates/landingcampaign.phtml @@ -0,0 +1,14 @@ +headScript()->addScriptAndStyle('310-contact'); + +// Request Quote form +$form = $this->quoteForm(null, $this->form_first); + +$intro = '
'; +$intro .= $this->introBlock($this->intro, '', '', !$this->form_first); +$intro .= '
'; // .contact-intro + +$res = $intro . $form; + +echo $res; \ No newline at end of file diff --git a/js/102-intro.js b/js/102-intro.js index 94a4cb7..0e85538 100644 --- a/js/102-intro.js +++ b/js/102-intro.js @@ -1,5 +1,7 @@ registerLoader(load_intro); function load_intro(){ - + if($("section.intro:eq(0)").data('header-theme')!==null){ + $("header").addClass($("section.intro:eq(0)").data('header-theme')); + } } diff --git a/less/002-common.less b/less/002-common.less index 39e11bf..866afc1 100644 --- a/less/002-common.less +++ b/less/002-common.less @@ -10,7 +10,6 @@ color: #fff; } - html { box-sizing: border-box; } @@ -52,6 +51,7 @@ body.popupOpen { width: 100%; overflow: hidden; } + .popupWindow { -webkit-overflow-scrolling: touch; background-color: #fff; // For some reason this is needed when using -webkit-overflow-scrolling or background is missing at bottom @@ -281,4 +281,12 @@ a { opacity: 1; } } +} + +address { + font-style: normal; + + a { + text-decoration: none; + } } \ No newline at end of file diff --git a/less/102-intro.less b/less/102-intro.less index 32ab113..ffd7bde 100644 --- a/less/102-intro.less +++ b/less/102-intro.less @@ -27,6 +27,17 @@ text-align: left; } } + + hr { + border: 0; + height: 1px; + font-size: 50px; + .divider(1.4em); + + @media @m900 { + font-size: 30px; + } + } } blockquote { diff --git a/less/310-contact.less b/less/310-contact.less index b0685f2..4facee5 100644 --- a/less/310-contact.less +++ b/less/310-contact.less @@ -32,15 +32,6 @@ } } } - - address { - font-style: normal; - - a { - text-decoration: none; - } - } - } .resellers { -- 2.39.5