]> _ Git - ccgm.git/commitdiff
wip #1784 @0.5
authorvincent@cubedesigners.com <vincent@cubedesigners.com@f5622870-0f3c-0410-866d-9cb505b7a8ef>
Fri, 1 Dec 2017 17:33:39 +0000 (17:33 +0000)
committervincent@cubedesigners.com <vincent@cubedesigners.com@f5622870-0f3c-0410-866d-9cb505b7a8ef>
Fri, 1 Dec 2017 17:33:39 +0000 (17:33 +0000)
framework/application/views/helpers/Actualites.php
js/actualites.js
less/actualites.less

index 0248d755dcf05bd762fbd9bc45c6b30fd068630e..067972cc9c857b763fd7ca5390a175a31340dda0 100644 (file)
@@ -9,22 +9,23 @@ class CCGM_View_Helper_Actualites extends Zend_View_Helper_Abstract {
                }\r
 \r
                $this->view->headScript()->addScriptAndStyle('actualites')\r
-                               ->addGSAP();\r
+                       ->addGSAP();\r
                $res = '<div class="updates">';\r
-               $res.='<div class="holder">';\r
-               $res.='<div class="mask">';\r
-               $res.='<div class="slideset">';\r
+               $res .= '<div class="holder">';\r
+               $res .= '<div class="mask">';\r
+               $res .= '<div class="slideset">';\r
                foreach ($actus as $a) {\r
-                       $res.=$this->_actu($a);\r
+                       $res .= $this->_actu($a);\r
                }\r
-               $res.='</div>';\r
-               $res.='</div>';\r
-               $res.='<div class="btn-area">';\r
-               $res.='<a class="btn-prev" title="Actualités plus récente" href="#"></a>';\r
-               $res.='<a class="btn-next" title="Actualités plus ancienne" href="#"></a>';\r
-               $res.='</div>';\r
-               $res.='</div>';\r
-               $res.='</div>';\r
+               $res .= '</div>';\r
+               $res .= '</div>';\r
+               $res .= '<div class="btn-area">';\r
+               $res .= '<a class="btn-prev" title="Actualités plus récente" href="#"></a>';\r
+               $res .= '<a class="btn-next" title="Actualités plus ancienne" href="#"></a>';\r
+               $res .= $this->view->link('Voir les actualités', 'internal:news', ['class' => 'news']);\r
+               $res .= '</div>';\r
+               $res .= '</div>';\r
+               $res .= '</div>';\r
                return $res;\r
        }\r
 \r
@@ -36,13 +37,13 @@ class CCGM_View_Helper_Actualites extends Zend_View_Helper_Abstract {
                $res = '<div class="slide">';\r
                $p = '';\r
                if (!$a['noshowdate']) {\r
-                       $p.=$this->view->dateTime($a['date'], Zend_Date::DAY . '/' . Zend_Date::MONTH . '/' . Zend_Date::YEAR, array('class' => 'date')) . ' ';\r
+                       $p .= $this->view->dateTime($a['date'], Zend_Date::DAY . '/' . Zend_Date::MONTH . '/' . Zend_Date::YEAR, array('class' => 'date')) . ' ';\r
                } else {\r
                        $attrs['class'] = 'nodate';\r
                }\r
-               $p.=nl2br($a['news']);\r
-               $res.=$this->view->htmlElement($p, 'p', $attrs);\r
-               $res.='</div>';\r
+               $p .= nl2br($a['news']);\r
+               $res .= $this->view->htmlElement($p, 'p', $attrs);\r
+               $res .= '</div>';\r
                return $res;\r
        }\r
 \r
index bd9f3628f2d9f6e68301298be8dea611205cf5f1..61e606f78a4170c999edfaad23dc4f631d4d053c 100644 (file)
-(function($) {\r
-       function JQactualites(element) {\r
-               this.element = element;\r
-               this.currentIndex = -1;\r
-               this.number = this.element.find('.slide').length;\r
-               this.animating = false;\r
-               this.init();\r
-       }\r
-\r
-       JQactualites.prototype = {\r
-               init: function() {\r
-                       var $this = this;\r
-\r
-                       if (this.number < 2) {\r
-                               this.element.find('.btn-area').hide();\r
-                       }\r
-\r
-                       this.element.find('.btn-area a').click(function() {\r
-                               if ($(this).hasClass('btn-next')) {\r
-                                       $this.goNext();\r
-                               } else if ($(this).hasClass('btn-prev')) {\r
-                                       $this.goPrev();\r
-                               }\r
-                               return false;\r
-                       });\r
-\r
-                       this.gotoIndex(0);\r
-               },\r
-               goNext: function() {\r
-                       this.gotoIndex(this.currentIndex + 1);\r
-               },\r
-               goPrev: function() {\r
-                       this.gotoIndex(this.currentIndex - 1);\r
-               },\r
-               gotoIndex: function(index) {\r
-\r
-                       if (this.animating) {\r
-                               return;\r
-                       }\r
-                       var $this = this;\r
-                       this.animating = true;\r
-                       var w = 870;\r
-                       var d = 0.5;\r
-                       var dir = -1;\r
-                       if (index > this.currentIndex) {\r
-                               dir = 1;\r
-                       }\r
-                       dir *= -1;\r
-                       index = (index + this.number) % this.number;\r
-                       var nextActu = this.getActu(index);\r
-\r
-                       if (this.currentIndex == -1) {\r
-                               $(nextActu).show();\r
-                               this.arrowsVisibility(index, d);\r
-                               this.endTransition(index);\r
-                               return;\r
-                       }\r
-                       var currentActu = this.getActu(this.currentIndex);\r
-\r
-\r
-                       $(nextActu).css('left', w * -dir).show();\r
-                       TweenMax.to(nextActu, d, {left: 0});\r
-                       TweenMax.to(currentActu, d, {left: w * dir, onComplete: function() {\r
-                                       $this.endTransition(index);\r
-                               }\r
-                       });\r
-                       this.arrowsVisibility(index, d);\r
-\r
-\r
-\r
-\r
-               },\r
-               arrowsVisibility: function(index, d) {\r
-                       var prev = this.element.find('.btn-prev');\r
-                       var next = this.element.find('.btn-next');\r
-                       if (index == 0) {\r
-                               $(prev).fadeOut(d * 1000);\r
-                       } else {\r
-                               $(prev).fadeIn(d * 1000);\r
-                       }\r
-\r
-                       if (index == this.number - 1) {\r
-                               $(next).fadeOut(d * 1000);\r
-                       } else {\r
-                               $(next).fadeIn(d * 1000);\r
-                       }\r
-               },\r
-               getActu: function(index) {\r
-                       return this.element.find('.slide:eq(' + index + ')');\r
-               },\r
-               endTransition: function(index) {\r
-                       this.animating = false;\r
-                       this.getActu(this.currentIndex).hide();\r
-                       this.currentIndex = index;\r
-               },\r
-       };\r
-\r
-       jQuery.fn.actualites = function() {\r
-               return this.each(function() {\r
-                       var $this = $(this);\r
-                       $(this).data('actualites', new JQactualites($this));\r
-               })\r
-       };\r
+(function ($) {\r
+    function JQactualites(element) {\r
+        this.element = element;\r
+        this.currentIndex = -1;\r
+        this.number = this.element.find('.slide').length;\r
+        this.animating = false;\r
+        this.init();\r
+    }\r
+\r
+    JQactualites.prototype = {\r
+        init: function () {\r
+            var $this = this;\r
+\r
+            if (this.number < 2) {\r
+                this.element.find('.btn-area').hide();\r
+            }\r
+\r
+            this.element.find('.btn-area a').click(function () {\r
+                if ($(this).hasClass('btn-next')) {\r
+                    $this.goNext();\r
+                } else if ($(this).hasClass('btn-prev')) {\r
+                    $this.goPrev();\r
+                } else {\r
+                    return true;\r
+                }\r
+                return false;\r
+            });\r
+\r
+            this.gotoIndex(0);\r
+        },\r
+        goNext: function () {\r
+            this.gotoIndex(this.currentIndex + 1);\r
+        },\r
+        goPrev: function () {\r
+            this.gotoIndex(this.currentIndex - 1);\r
+        },\r
+        gotoIndex: function (index) {\r
+\r
+            if (this.animating) {\r
+                return;\r
+            }\r
+            var $this = this;\r
+            this.animating = true;\r
+            var w = 870;\r
+            var d = 0.5;\r
+            var dir = -1;\r
+            if (index > this.currentIndex) {\r
+                dir = 1;\r
+            }\r
+            dir *= -1;\r
+            index = (index + this.number) % this.number;\r
+            var nextActu = this.getActu(index);\r
+\r
+            if (this.currentIndex == -1) {\r
+                $(nextActu).show();\r
+                this.arrowsVisibility(index, d);\r
+                this.endTransition(index);\r
+                return;\r
+            }\r
+            var currentActu = this.getActu(this.currentIndex);\r
+\r
+\r
+            $(nextActu).css('left', w * -dir).show();\r
+            TweenMax.to(nextActu, d, {left: 0});\r
+            TweenMax.to(currentActu, d, {\r
+                left: w * dir, onComplete: function () {\r
+                    $this.endTransition(index);\r
+                }\r
+            });\r
+            this.arrowsVisibility(index, d);\r
+\r
+\r
+        },\r
+        arrowsVisibility: function (index, d) {\r
+            var prev = this.element.find('.btn-prev');\r
+            var next = this.element.find('.btn-next');\r
+            if (index == 0) {\r
+                $(prev).fadeOut(d * 1000);\r
+            } else {\r
+                $(prev).fadeIn(d * 1000);\r
+            }\r
+\r
+            if (index == this.number - 1) {\r
+                $(next).fadeOut(d * 1000);\r
+            } else {\r
+                $(next).fadeIn(d * 1000);\r
+            }\r
+        },\r
+        getActu: function (index) {\r
+            return this.element.find('.slide:eq(' + index + ')');\r
+        },\r
+        endTransition: function (index) {\r
+            this.animating = false;\r
+            this.getActu(this.currentIndex).hide();\r
+            this.currentIndex = index;\r
+        },\r
+    };\r
+\r
+    jQuery.fn.actualites = function () {\r
+        return this.each(function () {\r
+            var $this = $(this);\r
+            $(this).data('actualites', new JQactualites($this));\r
+        })\r
+    };\r
 })(jQuery);\r
 \r
 TO_LOAD_ONCE[TO_LOAD_ONCE.length] = 'load_actualites();';\r
 \r
 function load_actualites() {\r
-       $(".updates").actualites();\r
+    $(".updates").actualites();\r
 }\r
index 521e71efce325da374ef85cfe27f8dabb8652110..6e8f175ab5f0ec971ac1b830fb887e0fde2762e3 100644 (file)
                                left:39px;
 
                                .slide {
-                                       width: 870px;
+                                       width: 720px;
                                        display:none;
                                        position:absolute;
                                        top:0px;
 
-
                                        p{
                                                white-space: nowrap;
                                                overflow: hidden;
@@ -72,7 +71,7 @@
                                text-indent: -9999px;
                                overflow: hidden;
                                top:0px;
-                               right:35px;
+                               right:185px;
                                position:absolute;
                                background-image: url(../images/arrow-news-left.svg);
                                background-repeat: no-repeat;
 
                        .btn-next {
                                margin:0 0 0 5px;
-                               right:0px;
+                               right:150px;
                                background-image: url(../images/arrow-news-right.svg);
                                background-repeat: no-repeat;
                        }
+
+                       .news{
+                               text-align: center;
+                               box-sizing: border-box;
+                               width: 140px;
+                               white-space: nowrap;
+                               background-color: #0ea6db;
+                               font-weight: 300;
+                               font-style: italic;
+                               line-height: 29px;
+                               display: inline-block;
+                               border-radius: 3px;
+                               color: #fff;
+                               padding: 0 13px 1px 10px;
+                               margin: 0 0 0 1px;
+                               position: absolute;
+                               right: 0;
+                       }
                }
        }