From de8648ba760b88dab1eef6cf0b90e7071a948bcf Mon Sep 17 00:00:00 2001 From: "vincent@cubedesigners.com" Date: Tue, 12 Dec 2017 17:46:17 +0000 Subject: [PATCH] wip #1809 @1:40 --- framework/application/Bootstrap.php | 3 +- .../forms/CMS/Fonctionnalitessub.php | 35 +++++++++++++++++++ .../forms/CMS/Sub/Features/FeatureDetail.php | 22 ++++++++++++ .../forms/CMS/Sub/Features/FeatureDetails.php | 11 ++++++ .../views/helpers/FeatureDetails.php | 33 +++++++++++++++++ framework/application/views/helpers/Logos.php | 23 ++++++++++++ .../views/scripts/templates/exemples.phtml | 2 +- .../templates/fonctionnalitessub.phtml | 10 ++++++ less/106-logos.less | 28 +++++++++++++++ less/420-features-details.less | 32 +++++++++++++++++ 10 files changed, 197 insertions(+), 2 deletions(-) create mode 100644 framework/application/forms/CMS/Fonctionnalitessub.php create mode 100644 framework/application/forms/CMS/Sub/Features/FeatureDetail.php create mode 100644 framework/application/forms/CMS/Sub/Features/FeatureDetails.php create mode 100644 framework/application/views/helpers/FeatureDetails.php create mode 100644 framework/application/views/helpers/Logos.php create mode 100644 framework/application/views/scripts/templates/fonctionnalitessub.phtml create mode 100644 less/106-logos.less create mode 100644 less/420-features-details.less diff --git a/framework/application/Bootstrap.php b/framework/application/Bootstrap.php index d0b0125..d032ce7 100644 --- a/framework/application/Bootstrap.php +++ b/framework/application/Bootstrap.php @@ -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 index 0000000..3236ac4 --- /dev/null +++ b/framework/application/forms/CMS/Fonctionnalitessub.php @@ -0,0 +1,35 @@ +setLabel('Titre du bloc examples'); + $titre->setAttrib('rows', 2); + $this->addElement($titre); + + $details = new Fluidbook_Form_CMS_Sub_Features_FeatureDetails(); + $details->setLabel('Détails'); + $this->addSubForm($details, 'details'); + + $logos = new CubeIT_Form_Element_File_Image('features_logos'); + $logos->setLabel('Logos'); + $this->addElement($logos); + + $category = new Fluidbook_Form_CMS_Sub_Exemples_CategorySelect('ex_category'); + $category->setLabel('Catégorie de références'); + $this->addElement($category); + + $elements = new CubeIT_Form_Element_Int('ex_count'); + $elements->setLabel('Nombre de références à afficher (multiple de 5)'); + $elements->setValue(10); + $this->addElement($elements); + + $exemples = new Fluidbook_Form_CMS_Element_Exemples('ex_exemples'); + $exemples->setLabel('Gestion des exemples'); + $this->addElement($exemples); + } +} \ 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 index 0000000..5deb9a6 --- /dev/null +++ b/framework/application/forms/CMS/Sub/Features/FeatureDetail.php @@ -0,0 +1,22 @@ +setLabel('Titre'); + $this->addElement($title); + + $text = new CubeIT_Form_Element_Markitup_Essential('text'); + $text->setLabel('Texte'); + $this->addElement($text); + + $image = new CubeIT_Form_Element_File_Image('image'); + $image->setLabel('Image'); + $image->setMaxItems(1); + $this->addElement($image); + + + } +} \ 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 index 0000000..038181f --- /dev/null +++ b/framework/application/forms/CMS/Sub/Features/FeatureDetails.php @@ -0,0 +1,11 @@ +setBaseSubForm(new Fluidbook_Form_CMS_Sub_Features_FeatureDetail()); + $this->setNewLegend('Nouveau détail'); + $this->setBaseLegend('Editer « $title »'); + } +} \ 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 index 0000000..9d3041c --- /dev/null +++ b/framework/application/views/helpers/FeatureDetails.php @@ -0,0 +1,33 @@ +_detail($detail, $i % 2 == 1); + $i++; + } + + return $this->htmlElement($res, 'section', ['id' => 'featureDetails', 'class' => 'content-wrapper grid wrap']); + } + + protected function _detail($d, $imageRight) { + $c = $this->htmlElement($d['title'], 'h3'); + $c .= $this->markupDotclear($d['text']); + $c = $this->htmlElement($c, 'div', ['class' => 'content']); + $image = $this->imageProcess($d['image'], $d['title'], 755, 1000, [], 'R'); + + if ($imageRight) { + $res = $c . $image; + } else { + $res = $image . $c; + } + + + return $this->htmlElement($res, 'article', ['class' => $imageRight ? 'iright' : 'ileft']); + } +} \ 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 index 0000000..fcc4a6d --- /dev/null +++ b/framework/application/views/helpers/Logos.php @@ -0,0 +1,23 @@ +addScriptAndStyle('106-logos'); + + $res = ''; + foreach ($images as $image) { + $res .= $this->imageCms($image).' '; // Space needed for the justify + } + + $res = $this->htmlElement($res, 'div', ['class' => 'c']); + return $this->htmlElement($res, 'section', ['class' => 'logos content-wrapper grid wrap']); + } +} \ No newline at end of file diff --git a/framework/application/views/scripts/templates/exemples.phtml b/framework/application/views/scripts/templates/exemples.phtml index 4011fe4..f048012 100644 --- a/framework/application/views/scripts/templates/exemples.phtml +++ b/framework/application/views/scripts/templates/exemples.phtml @@ -1,4 +1,4 @@ introBlock($this->intro, ''); -echo $this->exemples($this->category, $this->title,$this->count); +echo $this->exemples($this->category, $this->title, $this->count); 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 index 0000000..5c870e3 --- /dev/null +++ b/framework/application/views/scripts/templates/fonctionnalitessub.phtml @@ -0,0 +1,10 @@ +headScript()->addScriptAndStyle('420-features-details'); + +$res = $this->introBlock($this->intro); +$res .= $this->featureDetails($this->details); +$res .= $this->logos($this->features_logos); +$res .= $this->exemples($this->ex_category, $this->ex_title, $this->ex_count); +$res .= $this->contactFooter(); + +echo $res; \ No newline at end of file diff --git a/less/106-logos.less b/less/106-logos.less new file mode 100644 index 0000000..d3fc506 --- /dev/null +++ b/less/106-logos.less @@ -0,0 +1,28 @@ +@import "000-imports"; + +.logos { + &.content-wrapper { + padding-top: 56px; + padding-bottom: 50px; + } + background-color: @color-light-grey; + .c { + display: inline-block; + width: 100%; + text-align: justify; + padding-left: 70px; + padding-right: 70px; + margin: 0 auto; + line-height: 0; + + &:after { + content: ""; + display: inline-block; + width: 100%; + height: 0; + } + img { + vertical-align: middle; + } + } +} \ No newline at end of file diff --git a/less/420-features-details.less b/less/420-features-details.less new file mode 100644 index 0000000..3e1f2c7 --- /dev/null +++ b/less/420-features-details.less @@ -0,0 +1,32 @@ +@import "000-imports"; + +#featureDetails { + padding-top: 0; + color: @color-text; + article { + margin-top: 110px; + &:first-child { + margin-top: 0; + } + + .content { + width: 755px; + padding: 60px 130px 0; + display: inline-block; + vertical-align: top; + font-size: 14px; + + h3 { + font-family: @montserrat; + text-transform: uppercase; + font-weight: 500; + margin-bottom: 15px; + } + } + img { + display: inline-block; + width: 755px; + vertical-align: top; + } + } +} \ No newline at end of file -- 2.39.5