From ddac919fbd2e5999caf81a0e267f81f144dfa070 Mon Sep 17 00:00:00 2001 From: "vincent@cubedesigners.com" Date: Wed, 14 May 2014 18:06:36 +0000 Subject: [PATCH] --- framework/application/configs/application.ini | 4 - .../forms/CMS/Sub/Home/Actualite.php | 6 +- .../application/views/helpers/Actualites.php | 18 ++- less/actualites.less | 149 +++++++++++------- 4 files changed, 107 insertions(+), 70 deletions(-) diff --git a/framework/application/configs/application.ini b/framework/application/configs/application.ini index c2f3305..e86d0d2 100644 --- a/framework/application/configs/application.ini +++ b/framework/application/configs/application.ini @@ -48,8 +48,6 @@ mailjet.password = b4d51c4c1d0193f9b0963c2c374dd882 locales.fr = [production : base] - -dev = true variant = 0 webhost = www.ccgm.fr @@ -57,8 +55,6 @@ webhost = www.ccgm.fr seo.universalAnalytics = UA-42799235-1 [medecins : base] -dev=true - variant = 1 webhost = medecins.ccgm.fr diff --git a/framework/application/forms/CMS/Sub/Home/Actualite.php b/framework/application/forms/CMS/Sub/Home/Actualite.php index 88bb7f5..8c805ee 100644 --- a/framework/application/forms/CMS/Sub/Home/Actualite.php +++ b/framework/application/forms/CMS/Sub/Home/Actualite.php @@ -10,6 +10,10 @@ class CCGM_Form_CMS_Sub_Home_Actualite extends CubeIT_Form_SubForm { $date->setPrecision(CubeIT_Date::DAY); $this->addElement($date); + $noshowdate = new Zend_Form_Element_Checkbox('noshowdate'); + $noshowdate->setLabel('Masquer la date (la date indiquée plus haut sera utilisée pour déterminer l\'ordre des actualités'); + $this->addElement($noshowdate); + $news = new Zend_Form_Element_Textarea('news'); $news->setLabel('Information'); $news->setAttrib('rows', 2); @@ -21,4 +25,4 @@ class CCGM_Form_CMS_Sub_Home_Actualite extends CubeIT_Form_SubForm { $this->addSubForm($lien, 'lien'); } -} \ No newline at end of file +} diff --git a/framework/application/views/helpers/Actualites.php b/framework/application/views/helpers/Actualites.php index f842242..0248d75 100644 --- a/framework/application/views/helpers/Actualites.php +++ b/framework/application/views/helpers/Actualites.php @@ -29,10 +29,20 @@ class CCGM_View_Helper_Actualites extends Zend_View_Helper_Abstract { } protected function _actu($a) { - $res = '

'; - $res.=$this->view->dateTime($a['date'], Zend_Date::DAY . '/' . Zend_Date::MONTH . '/' . Zend_Date::YEAR, array('class' => 'date')) . ' '; - $res.=$a['news']; - $res.='

'; + $nline = min(substr_count($a['news'], "\n") + 1, 2); + + $attrs = array('data-lines' => $nline); + + $res = '
'; + $p = ''; + if (!$a['noshowdate']) { + $p.=$this->view->dateTime($a['date'], Zend_Date::DAY . '/' . Zend_Date::MONTH . '/' . Zend_Date::YEAR, array('class' => 'date')) . ' '; + } else { + $attrs['class'] = 'nodate'; + } + $p.=nl2br($a['news']); + $res.=$this->view->htmlElement($p, 'p', $attrs); + $res.='
'; return $res; } diff --git a/less/actualites.less b/less/actualites.less index a5fcfb6..69e0318 100644 --- a/less/actualites.less +++ b/less/actualites.less @@ -1,65 +1,92 @@ .updates { background:#f4f1f1; position: relative; - font-weight:400; - font-style:italic; - font-size:14px; - line-height:31px; + + + .holder{ + margin:0 auto; + width:981px; + position:relative; + padding: 19px 0 16px; + background-image:url(../images/news.svg); + background-position: 0 50%; + background-repeat: no-repeat; + height:30px; + + .mask { + position: relative; + overflow: hidden; + height:40px; + width: 910px; + + .slideset { + position: relative; + overflow: hidden; + width: 870px; + height:40px; + left:39px; + + .slide { + width: 870px; + display:none; + position:absolute; + top:0px; + + + p{ + white-space: nowrap; + overflow: hidden; + text-overflow: ellipsis; + font-weight:400; + font-style:italic; + font-size:14px; + line-height:31px; + + &[data-lines="2"]{ + line-height: 18px; + margin-top: -4px; + } + + .date{ + font-weight:500; + margin: 0 5px 0 0; + font-style:italic; + } + } + } + } + } + + .btn-area{ + position:absolute; + right:0; + top:20px; + + + .btn-prev, + .btn-next { + width: 30px; + height: 31px; + text-indent: -9999px; + overflow: hidden; + top:0px; + right:35px; + position:absolute; + background-image: url(../images/arrow-news-left.svg); + background-repeat: no-repeat; + background-size: 30px 30px; + } + + .btn-next { + margin:0 0 0 5px; + right:0px; + background-image: url(../images/arrow-news-right.svg); + background-repeat: no-repeat; + } + } + } + + + + } -.updates .holder{ - margin:0 auto; - width:981px; - position:relative; - padding: 19px 0 16px; - background-image:url(../images/news.svg); - background-position: 0 50%; - background-repeat: no-repeat; -} -.updates .mask { - position: relative; - overflow: hidden; - width: 910px; -} -.updates .slideset { - position: relative; - overflow: hidden; - width: 870px; - height: 30px; - left:39px; -} -.updates .slide { - width: 870px; - display:none; - position:absolute; - top:0px; -} -.updates .btn-prev, -.updates .btn-next { - width: 30px; - height: 31px; - text-indent: -9999px; - overflow: hidden; - top:0px; - right:35px; - position:absolute; - background-image: url(../images/arrow-news-left.svg); - background-repeat: no-repeat; - background-size: 30px 30px; -} -.updates .btn-next { - margin:0 0 0 5px; - right:0px; - background-image: url(../images/arrow-news-right.svg); - background-repeat: no-repeat; -} -.updates .btn-area{ - position:absolute; - right:0; - top:20px; -} -.updates p{white-space: nowrap;overflow: hidden;text-overflow: ellipsis;} -.updates .date{ - font-weight:500; - margin: 0 5px 0 0; - font-style:italic; -} \ No newline at end of file -- 2.39.5