]> _ Git - fluidbook-v3.git/commitdiff
frontend work on sub example page | wip #516 @5
authorvincent@cubedesigners.com <vincent@cubedesigners.com@f5622870-0f3c-0410-866d-9cb505b7a8ef>
Thu, 30 Jun 2016 15:54:02 +0000 (15:54 +0000)
committervincent@cubedesigners.com <vincent@cubedesigners.com@f5622870-0f3c-0410-866d-9cb505b7a8ef>
Thu, 30 Jun 2016 15:54:02 +0000 (15:54 +0000)
19 files changed:
framework/application/forms/CMS/Exemplessub.php
framework/application/forms/CMS/Sub/Contact/Footer.php [new file with mode: 0644]
framework/application/forms/CMS/Sub/Home/Block.php
framework/application/forms/Settings.php
framework/application/layouts/scripts/layout.phtml
framework/application/views/helpers/BackgroundBlock.php [new file with mode: 0644]
framework/application/views/helpers/ContactFooter.php [new file with mode: 0644]
framework/application/views/helpers/IntroBlock.php
framework/application/views/scripts/templates/exemples.phtml
framework/application/views/scripts/templates/exemplessub.phtml [new file with mode: 0644]
js/002-common.js
js/102-intro.js [new file with mode: 0644]
less/001-variables.less
less/002-common.less
less/003-mixins.less
less/010-admin.less
less/102-intro.less [new file with mode: 0644]
less/103-contact-footer.less [new file with mode: 0644]
less/220-exemples.less

index 93305e670a1672a630c2c40db2145fa57ab3dd04..cc70ef2ec507c84303e7aba6982d46d387e364f4 100644 (file)
@@ -1,5 +1,5 @@
 <?php\r
 \r
-class Fluidbook_Form_CMS_Exemplessub extends Fluidbook_Form_CMS_Base{\r
+class Fluidbook_Form_CMS_Exemplessub extends Fluidbook_Form_CMS_Exemples {\r
 \r
 }
\ No newline at end of file
diff --git a/framework/application/forms/CMS/Sub/Contact/Footer.php b/framework/application/forms/CMS/Sub/Contact/Footer.php
new file mode 100644 (file)
index 0000000..cfc98f7
--- /dev/null
@@ -0,0 +1,31 @@
+<?php\r
+\r
+class Fluidbook_Form_CMS_Sub_Contact_Footer extends CubeIT_Form_SubForm {\r
+       public function init() {\r
+               parent::init();\r
+\r
+\r
+               $intro_title = new Zend_Form_Element_Textarea('title');\r
+               $intro_title->setLabel('Titre');\r
+               $intro_title->setAttrib('rows', 3);\r
+               $this->addElement($intro_title);\r
+\r
+               $intro_content = new CubeIT_Form_Element_Markitup('content');\r
+               $intro_content->setLabel('Contenu');\r
+               $this->addElement($intro_content);\r
+\r
+               $color = new CubeIT_Form_Element_Color('bg_color');\r
+               $color->setLabel('Couleur de fond');\r
+               $color->setValue('#ffffff');\r
+               $this->addElement($color);\r
+\r
+               $intro_bg = new CubeIT_Form_Element_File_Image('bg_image');\r
+               $intro_bg->setLabel('Image de fond');\r
+               $intro_bg->setMaxItems(1);\r
+               $this->addElement($intro_bg);\r
+\r
+               $button = new CubeIT_Form_Element_Link();\r
+               $button->setLabel('Bouton');\r
+               $this->addSubForm($button, 'button');\r
+       }\r
+}
\ No newline at end of file
index 5c4bcad28a4fd4d4eeb035b870f43447fe8a6fe8..bee7d1afe37cd0b57bc361a816f83d91b62862ab 100644 (file)
@@ -3,14 +3,12 @@
 class Fluidbook_Form_CMS_Sub_Home_Block extends CubeIT_Form_SubForm {
        public function init() {
                parent::init();
-
-
+               
                $title = new Zend_Form_Element_Text('title');
                $title->setLabel('Titre');
                $title->setOrder(10);
                $this->addElement($title);
 
-
                $text = new CubeIT_Form_Element_Markitup("text");
                $text->setLabel('Texte');
                $text->setAttrib('rows', 8);
index 7a8328b24e6e1aa97364655be9b999a163b218ae..2bf989c4cd7289d25d2e5e4002ff48de533ee4f5 100644 (file)
@@ -46,6 +46,10 @@ class Fluidbook_Form_Settings extends CubeIT_Form_Settings {
                $footer_menu_contact->setAttrib('placeholder', 'Tapez un titre de la page');
                $this->addElement($footer_menu_contact);
 
+               $contact_footer = new Fluidbook_Form_CMS_Sub_Contact_Footer();
+               $contact_footer->setLabel('Bloc contact');
+               $this->addSubFormLocalized($contact_footer, 'contact_footer');
+
                $footer = new CubeIT_Form_Element_Markitup('footer');
                $footer->setLabel('Footer');
                $footer->setAttrib('rows', 6);
index 5dc0c51087018dce07b4b1fb1c14fe8de14a2ace..7a49ead697a3874f144a717391c4281fc00b3781 100644 (file)
@@ -5,6 +5,8 @@ if ($this->acl()->isAllowed('edition')) {
 }
 $this->headScript()->addIEConditionnals();
 $this->headScript()->appendFile('/js/002-common.js');
+//<link href="https://file.myfontastic.com/2VZntjQVKuJUUqArhhJzkD/icons.css" rel="stylesheet">
+$this->headLink()->appendStylesheet('https://file.myfontastic.com/2VZntjQVKuJUUqArhhJzkD/icons.css');
 $this->headLink()->appendStylesheet('/less/002-common.less', 'all');
 
 $this->headScript()->addTagHandler(true); // Used by related articles selector in admin
@@ -21,8 +23,8 @@ $this->headScript()->addTagHandler(true); // Used by related articles selector i
  */
 
 // Fonts
-$fonts = array('google' => array('families' => array('Open+Sans|Playfair+Display|Montserrat')),
-                          'custom' => array('families' => array('Montserrat'), 'urls' => array('/css/fonts/Montserrat/Montserrat.css')));
+$fonts = array('google' => array('families' => array('Open+Sans:400,300|Playfair+Display|Montserrat')),
+               'custom' => array('families' => array('Montserrat'), 'urls' => array('/css/fonts/Montserrat/Montserrat.css')));
 
 $this->headScript()->addWebFont($fonts);
 
diff --git a/framework/application/views/helpers/BackgroundBlock.php b/framework/application/views/helpers/BackgroundBlock.php
new file mode 100644 (file)
index 0000000..fa28421
--- /dev/null
@@ -0,0 +1,31 @@
+<?php\r
+\r
+class Fluidbook_View_Helper_BackgroundBlock extends CubeIT_View_Helper_Abstract {\r
+       /**\r
+        * @return string\r
+        */\r
+       public function backgroundBlock($content, $data) {\r
+               $style = '';\r
+               $attributes = array('class' => array('content-wrapper', 'no-shrink'));\r
+\r
+               $bgimage = CubeIT_Util_Cms::extractFile($data['bg_image']);\r
+               $extra_attributes = array();\r
+               if ($bgimage) {\r
+                       $image_path = CubeIT_View_Helper_ImageCms::getPath($bgimage);\r
+\r
+                       // Work out the ratio of the background image\r
+                       CubeIT_Image::getDimensions($image_path, $image_width, $image_height);\r
+                       $image_ratio = $image_height / $image_width;\r
+\r
+                       $style = "background-image: url($image_path);";\r
+                       $attributes['data-bg-ratio'] = $image_ratio;\r
+               }\r
+\r
+               if ($data['bg_color']) {\r
+                       $style .= "background-color:" . $data['bg_color'] . ";";\r
+               }\r
+               $attributes['style'] = $style;\r
+\r
+               return $this->htmlElement($content, 'div', $attributes);\r
+       }\r
+}
\ No newline at end of file
diff --git a/framework/application/views/helpers/ContactFooter.php b/framework/application/views/helpers/ContactFooter.php
new file mode 100644 (file)
index 0000000..0d1635a
--- /dev/null
@@ -0,0 +1,24 @@
+<?php\r
+\r
+class Fluidbook_View_Helper_ContactFooter extends CubeIT_View_Helper_Abstract {\r
+       /**\r
+        * @return string\r
+        */\r
+       public function contactFooter() {\r
+               $cf = CubeIT_Util_Cms::unserialize($this->option('contact_footer'));\r
+\r
+               $this->addScriptAndStyle('103-contact-footer');\r
+\r
+               $res = $this->htmlElement($cf['title'], 'h2', array('class' => 'title'));\r
+               $res .= $this->markupDotclear($cf['content']);\r
+               $buttons = $this->linkCMS($cf['button']);\r
+               $buttons .= $this->linkQuote('Demander un devis');\r
+               $res .= $this->htmlElement($buttons, 'div', array('class' => 'buttons'));\r
+\r
+               $res = $this->htmlElement($res, 'div', array('class' => 'col-2'));\r
+               $res = $this->htmlElement($res, 'div', array('class' => 'grid'));\r
+               $res = $this->backgroundBlock($res, $cf);\r
+\r
+               return $this->htmlElement($res, 'section', array('class' => 'contactFooter'));\r
+       }\r
+}
\ No newline at end of file
index 628c66cebbabb18e3a7cb54fa1dd2f8a4d55efaa..ea4b5fafa6ead7b78c7ae5282dd6146d32e2e3a5 100644 (file)
@@ -3,31 +3,9 @@
 class Fluidbook_View_Helper_IntroBlock extends CubeIT_View_Helper_Abstract {
 
        public function introBlock($intro, $additionnalContent = '') {
+               $this->addScriptAndStyle('102-intro');
 
-               $style = '';
-               $extra_attributes = '';
-
-               $bgimage=CubeIT_Util_Cms::extractFile($intro['bg_image']);
-
-               if ($bgimage) {
-                       $image_path = CubeIT_View_Helper_ImageCms::getPath($bgimage);
-
-                       // Work out the ratio of the background image
-                       CubeIT_Image::getDimensions($image_path, $image_width, $image_height);
-                       $image_ratio = $image_height / $image_width;
-
-                       $style = "background-image: url($image_path);";
-                       $extra_attributes = 'data-bg-ratio="' . $image_ratio . '"';
-               }
-
-               if ($intro['bg_color']) {
-                       $style .= "background-color:" . $intro['bg_color'] . ";";
-               }
-
-
-               $res = '<div class="intro content-wrapper no-shrink" style="' . $style . '"' . $extra_attributes . '>';
-
-               $res .= '<div class="grid">';
+               $res = '<div class="grid">';
                $res .= '<div class="col-2">';
 
                $res .= '<h1 class="title">' . nl2br($intro['title']) . '</h1>';
@@ -38,8 +16,14 @@ class Fluidbook_View_Helper_IntroBlock extends CubeIT_View_Helper_Abstract {
 
                $res .= '</div>'; // .col-2
                $res .= '</div>'; // .grid
-               $res .= '</div>'; // .content-wrapper
+               $res .= '</div>';
+
+               $res = $this->backgroundBlock($res, $intro);
 
-               return $res;
+               if ($intro['chapo']) {
+                       $res .= $this->htmlElement(nl2br($intro['chapo']), 'blockquote');
+               }
+               
+               return $this->htmlElement($res, 'section', array('class' => 'intro'));
        }
 }
\ No newline at end of file
index 8341ac009326f515c7382df563e9c65fa8ba116a..1968de5a1f3546491b0068b09fb14a100359b482 100644 (file)
@@ -1,3 +1,3 @@
 <?php\r
 echo $this->introBlock($this->intro, '');\r
-echo $this->exemples(1, $this->title);
\ No newline at end of file
+echo $this->exemples($this->category, $this->title);
\ No newline at end of file
diff --git a/framework/application/views/scripts/templates/exemplessub.phtml b/framework/application/views/scripts/templates/exemplessub.phtml
new file mode 100644 (file)
index 0000000..f88dbb9
--- /dev/null
@@ -0,0 +1,4 @@
+<?php\r
+echo $this->introBlock($this->intro, '');\r
+echo $this->exemples($this->category, $this->title);\r
+echo $this->contactFooter();
\ No newline at end of file
index 9e87edd0ff03956e49bbc0de7f453e35d889246d..d5b02ce2efaaf7a37f9898754dbdbcc3627a5a77 100644 (file)
@@ -16,7 +16,6 @@ function resize() {
 \r
     $('main').css('min-height', mainHeight);\r
 \r
-\r
     // Handle divs with background images that must have a proportional min-height\r
     $('[data-bg-ratio]').each(function() {\r
         $(this).css('min-height', Math.round($(this).outerWidth() * $(this).data('bg-ratio')));\r
diff --git a/js/102-intro.js b/js/102-intro.js
new file mode 100644 (file)
index 0000000..94a4cb7
--- /dev/null
@@ -0,0 +1,5 @@
+registerLoader(load_intro);\r
+\r
+function load_intro(){\r
+    \r
+}\r
index 3800b5b848eebee1a3d1e5ecb916070566055b38..b84d9b4bd13c509f5baeded1f1bb240da7e9d783 100644 (file)
@@ -2,6 +2,7 @@
 @opensans: 'Open Sans', sans-serif;
 @playfair: 'Playfair Display', serif;
 @montserrat: 'Montserrat', sans-serif;
+@icons: 'fluidbook';
 
 //-- General Fonts
 @heading-font: @playfair;
index 753d6ba96aea25e7f0b85bddfbec66328d0d633b..6a88247abe2cc5f93f60791d8ac2c3cfb76f3d86 100644 (file)
@@ -40,12 +40,9 @@ a {
 \r
 .content-wrapper {\r
        width: 100%;\r
-       padding-top: 5%;\r
+       padding-top: 4%;\r
        padding-bottom: 5%;\r
 \r
-       &:first-of-type {\r
-               padding-top: 152px; // Minimum clearance and top for fixed menu\r
-       }\r
 }\r
 \r
 .no-shrink {\r
@@ -96,6 +93,8 @@ a {
        flex-basis: percentage(6/6);\r
 }\r
 \r
-.intro {\r
-       background-size: 1680px auto;\r
+.dotclear {\r
+       ul {\r
+               .list();\r
+       }\r
 }
\ No newline at end of file
index f7f76d2467ba00363b9f9465000d9ff4959090a8..b466aff993a76e4155919185e789d9ffd001bcd2 100644 (file)
@@ -20,6 +20,8 @@
        font-family: @montserrat;
        font-weight: 300;
        text-transform: uppercase;
+       text-decoration: none;
+       text-align: center;
        cursor: pointer;
 }
 
 }
 
 .border-button-fill(@border-color,@color-text) {
+       .button();
        transition: all 200ms;
 
-       border-color: @border-color;
+       border: 1px solid @border-color;
        color: @border-color;
 
        &:hover {
-               background-color:@border-color;
+               background-color: @border-color;
                color: @color-text;
        }
 }
 
+       &:active {
+               background-color: darken(@border-color, 2%);
+               border-color: darken(@border-color, 2%);
+       }
+}
 
 .background-button(@base-color) {
        transition: all 200ms;
                height: 1px;
                background-color: #343c44;
        }
+}
+
+.list() {
+       list-style: none;
+       li {
+               &:before {
+                       content: '>';
+                       font-family: @icons;
+                       margin-right: 0.8em;
+                       font-size: 0.7em;
+               }
+       }
 }
\ No newline at end of file
index e288793b31674c8eb85b890a91e59cf655f5a467..fb82d6283ecca7534acb5bb911ff2ed4539555ba 100644 (file)
@@ -1,6 +1,7 @@
 @import "000-imports";\r
 #adminBar{\r
        position: fixed;\r
+       z-index: 11;\r
        top:0px;\r
        left:0px;\r
        background-color:@color-footer-bg-secondary;\r
@@ -14,7 +15,3 @@
                }\r
        }\r
 }\r
-\r
-header {\r
-       top:25px !important;\r
-}
\ No newline at end of file
diff --git a/less/102-intro.less b/less/102-intro.less
new file mode 100644 (file)
index 0000000..d6b31d8
--- /dev/null
@@ -0,0 +1,19 @@
+@import "000-imports";\r
+\r
+.intro {\r
+       .content-wrapper {\r
+               background-size: 1680px auto;\r
+               padding-top: 152px; // Minimum clearance and top for fixed menu\r
+       }\r
+\r
+       blockquote {\r
+               background-color: #f3f3f3;\r
+               padding: 60px 20%;\r
+               color: #343c44;\r
+               font-family: @opensans;\r
+               font-weight: 300;\r
+               font-size: 22px;\r
+               text-align: center;\r
+               line-height: 35px;\r
+       }\r
+}
\ No newline at end of file
diff --git a/less/103-contact-footer.less b/less/103-contact-footer.less
new file mode 100644 (file)
index 0000000..b2c38b5
--- /dev/null
@@ -0,0 +1,22 @@
+@import "000-imports";\r
+\r
+.contactFooter {\r
+       .content-wrapper {\r
+               background-size: 1680px auto;\r
+       }\r
+\r
+       .buttons {\r
+               margin-top: 50px;\r
+               a {\r
+                       .border-button-fill(#343c44, #f3f3f3);\r
+                       width: 220px;\r
+                       margin-right: 20px;\r
+\r
+                       &.quoteLink {\r
+                               color: #fff;\r
+                               .background-button(#8aab41);\r
+                       }\r
+               }\r
+\r
+       }\r
+}
\ No newline at end of file
index 9faff23b364eb43f69a3de74a014e8e871d59573..939d7bdaedc0d57bd467bff096926cb61ac02fd6 100644 (file)
@@ -79,7 +79,7 @@
                                button{\r
                                        color:#fff;\r
                                        border:1px solid #fff;\r
-                                       padding:16px 20px;\r
+                                       padding:0 20px;\r
                                        margin-left:20px;\r
                                        margin-top: 5px;\r
 \r