From 08a1d42e6aeea0bbbeee7e89addf2ce57b8d623d Mon Sep 17 00:00:00 2001 From: "vincent@cubedesigners.com" Date: Fri, 1 Jul 2016 12:11:19 +0000 Subject: [PATCH] #487 @2 --- framework/application/forms/CMS/Exemples.php | 5 +++++ framework/application/views/helpers/Exemples.php | 4 ++-- framework/application/views/scripts/templates/exemples.phtml | 2 +- .../application/views/scripts/templates/exemplessub.phtml | 2 +- less/220-exemples.less | 4 ++-- 5 files changed, 11 insertions(+), 6 deletions(-) diff --git a/framework/application/forms/CMS/Exemples.php b/framework/application/forms/CMS/Exemples.php index 1f69a6e..5d0574e 100644 --- a/framework/application/forms/CMS/Exemples.php +++ b/framework/application/forms/CMS/Exemples.php @@ -12,6 +12,11 @@ class Fluidbook_Form_CMS_Exemples extends Fluidbook_Form_CMS_Base { $category->setLabel('Catégorie de références'); $this->addElement($category); + $elements = new CubeIT_Form_Element_Int('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('exemples'); $exemples->setLabel('Gestion des exemples'); $this->addElement($exemples); diff --git a/framework/application/views/helpers/Exemples.php b/framework/application/views/helpers/Exemples.php index aae5468..1f0cc1a 100644 --- a/framework/application/views/helpers/Exemples.php +++ b/framework/application/views/helpers/Exemples.php @@ -4,13 +4,13 @@ class Fluidbook_View_Helper_Exemples extends CubeIT_View_Helper_Abstract { /** * @return string */ - public function exemples($category, $title) { + public function exemples($category, $title, $nb) { $this->headScript()->addScriptAndStyle('220-exemples'); $this->headScript()->addMasonry(); $exemples = Fluidbook_Model_Reference::factory()->order('date', 'DESC')->find(); - $max_featured = 2; + $max_featured = floor($nb / 5); $normal_per_featured = 4; $max_normal = $max_featured * $normal_per_featured; diff --git a/framework/application/views/scripts/templates/exemples.phtml b/framework/application/views/scripts/templates/exemples.phtml index 1968de5..e830333 100644 --- a/framework/application/views/scripts/templates/exemples.phtml +++ b/framework/application/views/scripts/templates/exemples.phtml @@ -1,3 +1,3 @@ introBlock($this->intro, ''); -echo $this->exemples($this->category, $this->title); \ No newline at end of file +echo $this->exemples($this->category, $this->title,$this->count); \ No newline at end of file diff --git a/framework/application/views/scripts/templates/exemplessub.phtml b/framework/application/views/scripts/templates/exemplessub.phtml index f88dbb9..f048012 100644 --- a/framework/application/views/scripts/templates/exemplessub.phtml +++ b/framework/application/views/scripts/templates/exemplessub.phtml @@ -1,4 +1,4 @@ introBlock($this->intro, ''); -echo $this->exemples($this->category, $this->title); +echo $this->exemples($this->category, $this->title, $this->count); echo $this->contactFooter(); \ No newline at end of file diff --git a/less/220-exemples.less b/less/220-exemples.less index 939d7bd..7a5f193 100644 --- a/less/220-exemples.less +++ b/less/220-exemples.less @@ -61,13 +61,13 @@ &.featured { color: #fff; background-color: transparent; - &:nth-of-type(odd) { + &:nth-of-type(11n+1) { background: linear-gradient(45deg, rgba(249, 134, 126, 1) 0%, rgba(231, 92, 123, 1) 100%); button{ .border-button-fill(#fff,rgba(231, 92, 123, 1)); } } - &:nth-child(7n+2) { + &:nth-child(11n+9) { background: linear-gradient(45deg, #f5aa72 0%, #f6786e 100%); button{ .border-button-fill(#fff,#f6786e); -- 2.39.5