]> _ Git - fluidbook-v3.git/commitdiff
wip #1809 @1:40
authorvincent@cubedesigners.com <vincent@cubedesigners.com@f5622870-0f3c-0410-866d-9cb505b7a8ef>
Tue, 12 Dec 2017 17:46:17 +0000 (17:46 +0000)
committervincent@cubedesigners.com <vincent@cubedesigners.com@f5622870-0f3c-0410-866d-9cb505b7a8ef>
Tue, 12 Dec 2017 17:46:17 +0000 (17:46 +0000)
framework/application/Bootstrap.php
framework/application/forms/CMS/Fonctionnalitessub.php [new file with mode: 0644]
framework/application/forms/CMS/Sub/Features/FeatureDetail.php [new file with mode: 0644]
framework/application/forms/CMS/Sub/Features/FeatureDetails.php [new file with mode: 0644]
framework/application/views/helpers/FeatureDetails.php [new file with mode: 0644]
framework/application/views/helpers/Logos.php [new file with mode: 0644]
framework/application/views/scripts/templates/exemples.phtml
framework/application/views/scripts/templates/fonctionnalitessub.phtml [new file with mode: 0644]
less/106-logos.less [new file with mode: 0644]
less/420-features-details.less [new file with mode: 0644]

index d0b0125cf9d4af379dd33381ad40e4489185101f..d032ce75c7fe9f2aa7c5a61f17fde71566e50ad9 100644 (file)
@@ -15,7 +15,8 @@ class Bootstrap extends CubeIT_Bootstrap {
         */
        public function getCMSTemplates() {
                $templates['texte'] = 'Texte';
-               $templates['fonctionnalites'] = 'Fonctionnalites';
+               $templates['fonctionnalites'] = 'Fonctionnalités générales';
+               $templates['fonctionnalitessub'] = 'Détail fonctionnalité';
                $templates['exemples'] = 'Exemples';
                $templates['exemplessub'] = 'Exemples (niveau 2)';
                $templates['contact'] = 'Contact';
diff --git a/framework/application/forms/CMS/Fonctionnalitessub.php b/framework/application/forms/CMS/Fonctionnalitessub.php
new file mode 100644 (file)
index 0000000..3236ac4
--- /dev/null
@@ -0,0 +1,35 @@
+<?php\r
+\r
+class Fluidbook_Form_CMS_Fonctionnalitessub extends Fluidbook_Form_CMS_Base {\r
+\r
+\r
+       public function init() {\r
+               parent::init();\r
+\r
+               $titre = new CubeIT_Form_Element_Textarea('ex_title');\r
+               $titre->setLabel('Titre du bloc examples');\r
+               $titre->setAttrib('rows', 2);\r
+               $this->addElement($titre);\r
+\r
+               $details = new Fluidbook_Form_CMS_Sub_Features_FeatureDetails();\r
+               $details->setLabel('Détails');\r
+               $this->addSubForm($details, 'details');\r
+\r
+               $logos = new CubeIT_Form_Element_File_Image('features_logos');\r
+               $logos->setLabel('Logos');\r
+               $this->addElement($logos);\r
+\r
+               $category = new Fluidbook_Form_CMS_Sub_Exemples_CategorySelect('ex_category');\r
+               $category->setLabel('Catégorie de références');\r
+               $this->addElement($category);\r
+\r
+               $elements = new CubeIT_Form_Element_Int('ex_count');\r
+               $elements->setLabel('Nombre de références à afficher (multiple de 5)');\r
+               $elements->setValue(10);\r
+               $this->addElement($elements);\r
+\r
+               $exemples = new Fluidbook_Form_CMS_Element_Exemples('ex_exemples');\r
+               $exemples->setLabel('Gestion des exemples');\r
+               $this->addElement($exemples);\r
+       }\r
+}
\ No newline at end of file
diff --git a/framework/application/forms/CMS/Sub/Features/FeatureDetail.php b/framework/application/forms/CMS/Sub/Features/FeatureDetail.php
new file mode 100644 (file)
index 0000000..5deb9a6
--- /dev/null
@@ -0,0 +1,22 @@
+<?php\r
+\r
+\r
+class Fluidbook_Form_CMS_Sub_Features_FeatureDetail extends CubeIT_Form_SubForm {\r
+       public function init() {\r
+               parent::init();\r
+               $title = new CubeIT_Form_Element_Text('title');\r
+               $title->setLabel('Titre');\r
+               $this->addElement($title);\r
+\r
+               $text = new CubeIT_Form_Element_Markitup_Essential('text');\r
+               $text->setLabel('Texte');\r
+               $this->addElement($text);\r
+\r
+               $image = new CubeIT_Form_Element_File_Image('image');\r
+               $image->setLabel('Image');\r
+               $image->setMaxItems(1);\r
+               $this->addElement($image);\r
+\r
+\r
+       }\r
+}
\ No newline at end of file
diff --git a/framework/application/forms/CMS/Sub/Features/FeatureDetails.php b/framework/application/forms/CMS/Sub/Features/FeatureDetails.php
new file mode 100644 (file)
index 0000000..038181f
--- /dev/null
@@ -0,0 +1,11 @@
+<?php\r
+\r
+\r
+class Fluidbook_Form_CMS_Sub_Features_FeatureDetails extends CubeIT_Form_Multi_SubForm {\r
+       public function init() {\r
+               parent::init();\r
+               $this->setBaseSubForm(new Fluidbook_Form_CMS_Sub_Features_FeatureDetail());\r
+               $this->setNewLegend('Nouveau détail');\r
+               $this->setBaseLegend('Editer « $title »');\r
+       }\r
+}
\ No newline at end of file
diff --git a/framework/application/views/helpers/FeatureDetails.php b/framework/application/views/helpers/FeatureDetails.php
new file mode 100644 (file)
index 0000000..9d3041c
--- /dev/null
@@ -0,0 +1,33 @@
+<?php\r
+\r
+class Fluidbook_View_Helper_FeatureDetails extends CubeIT_View_Helper_Abstract {\r
+       /**\r
+        * @return string\r
+        */\r
+       public function featureDetails($details) {\r
+               $res = '';\r
+               $i = 0;\r
+               foreach ($details as $detail) {\r
+                       $res .= $this->_detail($detail, $i % 2 == 1);\r
+                       $i++;\r
+               }\r
+\r
+               return $this->htmlElement($res, 'section', ['id' => 'featureDetails', 'class' => 'content-wrapper grid wrap']);\r
+       }\r
+\r
+       protected function _detail($d, $imageRight) {\r
+               $c = $this->htmlElement($d['title'], 'h3');\r
+               $c .= $this->markupDotclear($d['text']);\r
+               $c = $this->htmlElement($c, 'div', ['class' => 'content']);\r
+               $image = $this->imageProcess($d['image'], $d['title'], 755, 1000, [], 'R');\r
+\r
+               if ($imageRight) {\r
+                       $res = $c . $image;\r
+               } else {\r
+                       $res = $image . $c;\r
+               }\r
+\r
+\r
+               return $this->htmlElement($res, 'article', ['class' => $imageRight ? 'iright' : 'ileft']);\r
+       }\r
+}
\ No newline at end of file
diff --git a/framework/application/views/helpers/Logos.php b/framework/application/views/helpers/Logos.php
new file mode 100644 (file)
index 0000000..fcc4a6d
--- /dev/null
@@ -0,0 +1,23 @@
+<?php\r
+\r
+class Fluidbook_View_Helper_Logos extends CubeIT_View_Helper_Abstract {\r
+       /**\r
+        * @return string\r
+        */\r
+       public function logos($logos) {\r
+               $images = CubeIT_Util_Cms::extractFiles($logos);\r
+               if (!count($images)) {\r
+                       return;\r
+               }\r
+\r
+               $this->addScriptAndStyle('106-logos');\r
+\r
+               $res = '';\r
+               foreach ($images as $image) {\r
+                       $res .= $this->imageCms($image).' '; // Space needed for the justify\r
+               }\r
+\r
+               $res = $this->htmlElement($res, 'div', ['class' => 'c']);\r
+               return $this->htmlElement($res, 'section', ['class' => 'logos content-wrapper grid wrap']);\r
+       }\r
+}
\ No newline at end of file
index 4011fe46f7baa949e35a6fee74527249c5ec994d..f04801261795aff082d13a80136976262ea9b528 100644 (file)
@@ -1,4 +1,4 @@
 <?php\r
 echo $this->introBlock($this->intro, '');\r
-echo $this->exemples($this->category, $this->title,$this->count);\r
+echo $this->exemples($this->category, $this->title, $this->count);\r
 echo $this->contactFooter();
\ No newline at end of file
diff --git a/framework/application/views/scripts/templates/fonctionnalitessub.phtml b/framework/application/views/scripts/templates/fonctionnalitessub.phtml
new file mode 100644 (file)
index 0000000..5c870e3
--- /dev/null
@@ -0,0 +1,10 @@
+<?php\r
+$this->headScript()->addScriptAndStyle('420-features-details');\r
+\r
+$res = $this->introBlock($this->intro);\r
+$res .= $this->featureDetails($this->details);\r
+$res .= $this->logos($this->features_logos);\r
+$res .= $this->exemples($this->ex_category, $this->ex_title, $this->ex_count);\r
+$res .= $this->contactFooter();\r
+\r
+echo $res;
\ No newline at end of file
diff --git a/less/106-logos.less b/less/106-logos.less
new file mode 100644 (file)
index 0000000..d3fc506
--- /dev/null
@@ -0,0 +1,28 @@
+@import "000-imports";\r
+\r
+.logos {\r
+       &.content-wrapper {\r
+               padding-top: 56px;\r
+               padding-bottom: 50px;\r
+       }\r
+       background-color: @color-light-grey;\r
+       .c {\r
+               display: inline-block;\r
+               width: 100%;\r
+               text-align: justify;\r
+               padding-left: 70px;\r
+               padding-right: 70px;\r
+               margin: 0 auto;\r
+               line-height: 0;\r
+\r
+               &:after {\r
+                       content: "";\r
+                       display: inline-block;\r
+                       width: 100%;\r
+                       height: 0;\r
+               }\r
+               img {\r
+                       vertical-align: middle;\r
+               }\r
+       }\r
+}
\ No newline at end of file
diff --git a/less/420-features-details.less b/less/420-features-details.less
new file mode 100644 (file)
index 0000000..3e1f2c7
--- /dev/null
@@ -0,0 +1,32 @@
+@import "000-imports";\r
+\r
+#featureDetails {\r
+       padding-top: 0;\r
+       color: @color-text;\r
+       article {\r
+               margin-top: 110px;\r
+               &:first-child {\r
+                       margin-top: 0;\r
+               }\r
+\r
+               .content {\r
+                       width: 755px;\r
+                       padding: 60px 130px 0;\r
+                       display: inline-block;\r
+                       vertical-align: top;\r
+                       font-size: 14px;\r
+\r
+                       h3 {\r
+                               font-family: @montserrat;\r
+                               text-transform: uppercase;\r
+                               font-weight: 500;\r
+                               margin-bottom: 15px;\r
+                       }\r
+               }\r
+               img {\r
+                       display: inline-block;\r
+                       width: 755px;\r
+                       vertical-align: top;\r
+               }\r
+       }\r
+}
\ No newline at end of file