]> _ Git - fluidbook-v3.git/commitdiff
#487 @2
authorvincent@cubedesigners.com <vincent@cubedesigners.com@f5622870-0f3c-0410-866d-9cb505b7a8ef>
Fri, 1 Jul 2016 12:11:19 +0000 (12:11 +0000)
committervincent@cubedesigners.com <vincent@cubedesigners.com@f5622870-0f3c-0410-866d-9cb505b7a8ef>
Fri, 1 Jul 2016 12:11:19 +0000 (12:11 +0000)
framework/application/forms/CMS/Exemples.php
framework/application/views/helpers/Exemples.php
framework/application/views/scripts/templates/exemples.phtml
framework/application/views/scripts/templates/exemplessub.phtml
less/220-exemples.less

index 1f69a6e3409ca672b4043bd1a6ce148cebcdbab6..5d0574ea794b99b2bb41feb0b9ca90ef94987909 100644 (file)
@@ -12,6 +12,11 @@ class Fluidbook_Form_CMS_Exemples extends Fluidbook_Form_CMS_Base {
                $category->setLabel('Catégorie de références');\r
                $this->addElement($category);\r
 \r
+               $elements = new CubeIT_Form_Element_Int('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('exemples');\r
                $exemples->setLabel('Gestion des exemples');\r
                $this->addElement($exemples);\r
index aae5468dd5b24ea68b20ec1a0d3fbcdcd78be8e7..1f0cc1af6207ef530f6058bdf70d1422c9c799d5 100644 (file)
@@ -4,13 +4,13 @@ class Fluidbook_View_Helper_Exemples extends CubeIT_View_Helper_Abstract {
        /**\r
         * @return string\r
         */\r
-       public function exemples($category, $title) {\r
+       public function exemples($category, $title, $nb) {\r
                $this->headScript()->addScriptAndStyle('220-exemples');\r
                $this->headScript()->addMasonry();\r
 \r
                $exemples = Fluidbook_Model_Reference::factory()->order('date', 'DESC')->find();\r
 \r
-               $max_featured = 2;\r
+               $max_featured = floor($nb / 5);\r
                $normal_per_featured = 4;\r
                $max_normal = $max_featured * $normal_per_featured;\r
 \r
index 1968de5a1f3546491b0068b09fb14a100359b482..e830333fc0f88cbfa881d14d67fbeef2f87934df 100644 (file)
@@ -1,3 +1,3 @@
 <?php\r
 echo $this->introBlock($this->intro, '');\r
-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
index f88dbb9150d0269a292bc8e1dc300efc52404318..f04801261795aff082d13a80136976262ea9b528 100644 (file)
@@ -1,4 +1,4 @@
 <?php\r
 echo $this->introBlock($this->intro, '');\r
-echo $this->exemples($this->category, $this->title);\r
+echo $this->exemples($this->category, $this->title, $this->count);\r
 echo $this->contactFooter();
\ No newline at end of file
index 939d7bdaedc0d57bd467bff096926cb61ac02fd6..7a5f19366c20d97e3d990c484709bd0cb79f43bd 100644 (file)
                        &.featured {\r
                                color: #fff;\r
                                background-color: transparent;\r
-                               &:nth-of-type(odd) {\r
+                               &:nth-of-type(11n+1) {\r
                                        background: linear-gradient(45deg, rgba(249, 134, 126, 1) 0%, rgba(231, 92, 123, 1) 100%);\r
                                        button{\r
                                                .border-button-fill(#fff,rgba(231, 92, 123, 1));\r
                                        }\r
                                }\r
-                               &:nth-child(7n+2) {\r
+                               &:nth-child(11n+9) {\r
                                        background: linear-gradient(45deg, #f5aa72 0%, #f6786e 100%);\r
                                        button{\r
                                                .border-button-fill(#fff,#f6786e);\r