]> _ Git - fluidbook-v3.git/commitdiff
done #1081 @2
authorvincent@cubedesigners.com <vincent@cubedesigners.com@f5622870-0f3c-0410-866d-9cb505b7a8ef>
Mon, 9 Jan 2017 17:21:47 +0000 (17:21 +0000)
committervincent@cubedesigners.com <vincent@cubedesigners.com@f5622870-0f3c-0410-866d-9cb505b7a8ef>
Mon, 9 Jan 2017 17:21:47 +0000 (17:21 +0000)
framework/application/Bootstrap.php
framework/application/forms/CMS/Contact.php
framework/application/forms/CMS/Landingcampaign.php [new file with mode: 0644]
framework/application/forms/CMS/Sub/Intro.php
framework/application/views/helpers/IntroBlock.php
framework/application/views/scripts/templates/contact.phtml
framework/application/views/scripts/templates/landingcampaign.phtml [new file with mode: 0644]
js/102-intro.js
less/002-common.less
less/102-intro.less
less/310-contact.less

index 0fe33d2ef9cc3c77cc9c64e9acd648870a3a6f8a..576cb35e45a315647d16d98ad347c908b412e5bf 100644 (file)
@@ -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());
index 2d7171f90039545c64a93732d4295758a575994e..bac8e66ecc2fab6152a12e2a9766e82d6feff28b 100644 (file)
@@ -2,18 +2,22 @@
 \r
 class Fluidbook_Form_CMS_Contact extends Fluidbook_Form_CMS_Base {\r
 \r
-    public function init() {\r
-        parent::init();\r
+       public function init() {\r
+               parent::init();\r
 \r
-        $resellers_title = new CubeIT_Form_Element_Textarea('resellers_title');\r
-        $resellers_title->setLabel('Titre pour bloc "Revendeurs internationaux"');\r
-        $resellers_title->setAttrib('rows', 3);\r
-        $this->addElement($resellers_title);\r
+               $form_first = new Zend_Form_Element_Checkbox('form_first');\r
+               $form_first->setLabel('Le formulaire de demande de devis apparaît en haut');\r
+               $this->addElement($form_first);\r
 \r
-        $resellers = new Fluidbook_Form_CMS_Sub_Resellers_Resellers();\r
-        $resellers->setLegend('Revendeurs');\r
-        $this->addSubForm($resellers, 'resellers');\r
+               $resellers_title = new CubeIT_Form_Element_Textarea('resellers_title');\r
+               $resellers_title->setLabel('Titre pour bloc "Revendeurs internationaux"');\r
+               $resellers_title->setAttrib('rows', 3);\r
+               $this->addElement($resellers_title);\r
 \r
-    }\r
+               $resellers = new Fluidbook_Form_CMS_Sub_Resellers_Resellers();\r
+               $resellers->setLegend('Revendeurs');\r
+               $this->addSubForm($resellers, 'resellers');\r
+\r
+       }\r
 \r
 }
\ 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 (file)
index 0000000..ae5d947
--- /dev/null
@@ -0,0 +1,10 @@
+<?php\r
+\r
+class Fluidbook_Form_CMS_Landingcampaign extends Fluidbook_Form_CMS_Base {\r
+\r
+       public function init() {\r
+               parent::init();\r
+\r
+       }\r
+\r
+}
\ No newline at end of file
index b5505415f42e6e7afe962e8072d6a6396758876b..7f7b81b18f9cd76a469a0e761d04b005982448da 100644 (file)
@@ -23,6 +23,14 @@ class Fluidbook_Form_CMS_Sub_Intro extends CubeIT_Form_SubForm {
                $button->setLabel('Bouton');\r
                $this->addSubForm($button, 'button');\r
 \r
+               $headerTheme = new Zend_Form_Element_Checkbox('header_theme');\r
+               $headerTheme->setLabel('Thème du header clair');\r
+               $this->addElement($headerTheme);\r
+\r
+               $textcolor = new CubeIT_Form_Element_Color('text_color');\r
+               $textcolor->setLabel('Couleur du texte (laisser vide pour utiliser les couleurs par défaut)');\r
+               $this->addElement($textcolor);\r
+\r
                $color = new CubeIT_Form_Element_Color('bg_color');\r
                $color->setLabel('Couleur de fond');\r
                $color->setValue('#ffffff');\r
index 26a34f1c26a84aff4f60b87e551f020ec82baa71..7653e29c295430c68499336fbced9cda3d636dda 100644 (file)
@@ -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 = '<div class="grid">';
                $res .= '<div class="col-2">';
-
                $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 = '<address>';
+                       $content .= '<h4>' . $address['company'] . '</h4>';
+                       $content .= $address['adresse'];
+                       $content .= '<br>';
+                       $content .= "{$address['code_postal']} {$address['ville']} - $country";
+                       $content .= '<br>';
+                       $content .= __('Tél :') . ' ' . $this->linkPhone($address['phone']);
+                       $content .= '<br>';
+                       $content .= __('email :') . ' ' . $this->linkEmail($address['email']);
+                       $content .= '</address>';
+
+                       $res = str_replace('$adresse', $content, $res);
+               }
+               return $res;
        }
 }
\ No newline at end of file
index b5524460772a1b9463158c7fc8e5a5669467f79c..fc74234ced1bc96f1c6339410dfe8aa4eedb5cac 100644 (file)
@@ -16,14 +16,18 @@ $content .= '<br>';
 $content .= __('email :') . ' ' . $this->linkEmail($address['email']);\r
 $content .= '</address>';\r
 \r
-$res = '';\r
-\r
 // Request Quote form\r
-$res .= $this->quoteForm(null, true);\r
+$form = $this->quoteForm(null, $this->form_first);\r
+\r
+$intro = '<div class="contact-intro">';\r
+$intro .= $this->introBlock($this->intro, $content, '', !$this->form_first);\r
+$intro .= '</div>'; // .contact-intro\r
 \r
-$res .= '<div class="contact-intro">';\r
-$res .= $this->introBlock($this->intro, $content, '', false);\r
-$res .= '</div>'; // .contact-intro\r
+if ($this->form_first) {\r
+       $res = $form . $intro;\r
+} else {\r
+       $res = $intro . $form;\r
+}\r
 \r
 \r
 // Resellers\r
diff --git a/framework/application/views/scripts/templates/landingcampaign.phtml b/framework/application/views/scripts/templates/landingcampaign.phtml
new file mode 100644 (file)
index 0000000..95a0db5
--- /dev/null
@@ -0,0 +1,14 @@
+<?php\r
+\r
+//$this->headScript()->addScriptAndStyle('310-contact');\r
+\r
+// Request Quote form\r
+$form = $this->quoteForm(null, $this->form_first);\r
+\r
+$intro = '<div class="contact-intro">';\r
+$intro .= $this->introBlock($this->intro, '', '', !$this->form_first);\r
+$intro .= '</div>'; // .contact-intro\r
+\r
+$res = $intro . $form;\r
+\r
+echo $res;
\ No newline at end of file
index 94a4cb7afe2e0f135ff8e329efb70ad75edec16a..0e855387b563e74680a956603f9a05f386c1a73b 100644 (file)
@@ -1,5 +1,7 @@
 registerLoader(load_intro);\r
 \r
 function load_intro(){\r
-    \r
+    if($("section.intro:eq(0)").data('header-theme')!==null){\r
+        $("header").addClass($("section.intro:eq(0)").data('header-theme'));\r
+    }\r
 }\r
index 39e11bf395cdf6121d10c7f452532b83b6935dd1..866afc147ca1b45f77aefda2b280d2bc564f736b 100644 (file)
@@ -10,7 +10,6 @@
        color: #fff;\r
 }\r
 \r
-\r
 html {\r
        box-sizing: border-box;\r
 }\r
@@ -52,6 +51,7 @@ body.popupOpen {
        width: 100%;\r
        overflow: hidden;\r
 }\r
+\r
 .popupWindow {\r
        -webkit-overflow-scrolling: touch;\r
        background-color: #fff; // For some reason this is needed when using -webkit-overflow-scrolling or background is missing at bottom\r
@@ -281,4 +281,12 @@ a {
                        opacity: 1;\r
                }\r
        }\r
+}\r
+\r
+address {\r
+       font-style: normal;\r
+\r
+       a {\r
+               text-decoration: none;\r
+       }\r
 }
\ No newline at end of file
index 32ab113c2219a23ecc56b38cc9d3bbeb2dfbd08d..ffd7bde212db2177ffea609bf768e7bd28e129fd 100644 (file)
                                text-align: left;\r
                        }\r
                }\r
+\r
+               hr {\r
+                       border: 0;\r
+                       height: 1px;\r
+                       font-size: 50px;\r
+                       .divider(1.4em);\r
+\r
+                       @media @m900 {\r
+                               font-size: 30px;\r
+                       }\r
+               }\r
        }\r
 \r
        blockquote {\r
index b0685f2db25f4d58887ee60a28a983dac6f09153..4facee5a3a279cb4da279daf66b94b7da3ef575f 100644 (file)
                        }
                }
        }
-
-       address {
-               font-style: normal;
-
-               a {
-                       text-decoration: none;
-               }
-       }
-
 }
 
 .resellers {