From 9ab909fa18d3c5bb905991f444b76b3cea5183a2 Mon Sep 17 00:00:00 2001 From: "vincent@cubedesigners.com" Date: Fri, 21 Nov 2014 20:30:52 +0000 Subject: [PATCH] --- .htaccess | 10 +- framework/application/Bootstrap.php | 2 +- framework/application/Cubedesigners/Util.php | 11 + .../controllers/RealisationsController.php | 32 +-- framework/application/forms/Settings.php | 5 + .../views/helpers/CasestudiesDetail.php | 9 +- .../views/helpers/CasestudiesList.php | 6 +- .../views/helpers/HomeSlideshow.php | 2 +- .../application/views/helpers/Realisation.php | 33 ++- .../views/helpers/RealisationsList.php | 2 +- .../views/scripts/realisations/index.phtml | 3 +- .../views/scripts/studies/index.phtml | 4 +- js/slideshow.js | 3 +- less/casestudies.less | 5 +- less/casestudies_detail.less | 213 +++++++++--------- less/common.less | 6 +- less/mixins.less | 0 less/realisation.less | 20 ++ less/slideshow.less | 31 +++ 19 files changed, 243 insertions(+), 154 deletions(-) create mode 100644 less/mixins.less create mode 100644 less/realisation.less diff --git a/.htaccess b/.htaccess index bd79ecc..4715571 100644 --- a/.htaccess +++ b/.htaccess @@ -18,14 +18,14 @@ SetEnv SESSION_USE_TRANS_SID 0 -# Rewrite for Zend Framework +# Rewrite for Zend Framework Options +FollowSymlinks RewriteEngine on RewriteBase / # Redirection to www. subdomain - RewriteCond %{HTTP_HOST} ^example.com$ - RewriteRule ^(.*)$ http://www.example.com/$1 [R=301,L] + RewriteCond %{HTTP_HOST} ^cubedesigners.fr$ + RewriteRule ^(.*)$ http://www.cubedesigners.fr/$1 [R=301,L] # Redirect auth header to env RewriteRule ^.*$ - [E=REMOTE_USER:%{HTTP:Authorization}] # Skip static files @@ -77,11 +77,11 @@ SetOutputFilter DEFLATE SetEnvIfNoCase Request_URI \.(?:gif|jpe?g|png|swf|zip|exe|mp3|f4v|mp4|flv|gz|pdf|swc|ogv|ogm|ogg|webm|svgz|eot|otf|ttf|woff)$ no-gzip dont-vary - + Header append Vary User-Agent - + BrowserMatch ^Mozilla/4 gzip-only-text/html BrowserMatch ^Mozilla/4\.0[678] no-gzip BrowserMatch \bMSIE !no-gzip !gzip-only-text/html diff --git a/framework/application/Bootstrap.php b/framework/application/Bootstrap.php index f738e2c..a0ba199 100644 --- a/framework/application/Bootstrap.php +++ b/framework/application/Bootstrap.php @@ -60,7 +60,7 @@ class Bootstrap extends CubeIT_Bootstrap { $p = new CubeIT_Navigation_Page_Locale(); $p->setController('Realisations'); $p->setId($page->getId() . '/' . $r->id); - $p->setAutoUri($r, $datas['seourl_rea'], $page->getLocale()); + $p->setUri(Cubedesigners_Util::generateAutoUri($r, $datas['seourl_rea'], $page->getLocale())); $p->setSitemap(true); $p->setEditable(false); diff --git a/framework/application/Cubedesigners/Util.php b/framework/application/Cubedesigners/Util.php index 05cdf9b..5b247bb 100644 --- a/framework/application/Cubedesigners/Util.php +++ b/framework/application/Cubedesigners/Util.php @@ -6,9 +6,20 @@ class Cubedesigners_Util { public static function getCategoryById($id) { self::_getCategories(); + if (!isset(self::$_categories[$id])) { + return; + } return CubeIT_Util_Cms::unserialize(self::$_categories[$id]->getName()); } + public static function generateAutoUri($datas, $template, $locale = null) { + $datas = CubeIT_Util_Cms::unserialize($datas, $locale); + if (isset($datas->categories)) { + $datas->categories = self::getCategoryById($datas->categories); + } + return CubeIT_Navigation_Page::generateAutoUri($datas, $template, $locale); + } + protected static function _getCategories() { if (null !== self::$_categories) { return; diff --git a/framework/application/controllers/RealisationsController.php b/framework/application/controllers/RealisationsController.php index 4cc1081..d5da89d 100644 --- a/framework/application/controllers/RealisationsController.php +++ b/framework/application/controllers/RealisationsController.php @@ -8,30 +8,14 @@ class RealisationsController extends CubeIT_Controller_PageController { $datas = $this->getBootstrap()->getCMSDatasOfNavigationPage($parent); $this->view->datas = $datas; - $url = $this->getRequest()->getParam('page'); - - $ok = false; - - $db = Zend_Db_Table::getDefaultAdapter(); - $s = $db->select()->from('realisations') - ->order('id ASC'); - $q = $s->query(); - - while ($r = $q->fetch()) { - if (CubeIT_Navigation_Page::generateAutoUri($r, $datas['seourl_rea'], null) == $url) { - $this->view->casestudies_titre = $datas["titre"]; - $this->view->titre = $r->titre; - $this->view->realisation = $r; - - $ok = true; - break; - } - } - - if (!$ok) { - $this->_404(); - return; - } + $r = new Cubedesigners_Model_Realisation(); + $r->selectById($this->getParam('realisation_id')); + $r = $r->toObject(); + + $u = Cubedesigners_Util::generateAutoUri($r, $datas['seourl_rea'], null); + $this->view->casestudies_titre = $datas["titre"]; + $this->view->titre = $r->titre; + $this->view->realisation = $r; } } diff --git a/framework/application/forms/Settings.php b/framework/application/forms/Settings.php index 2275cd4..8966e05 100644 --- a/framework/application/forms/Settings.php +++ b/framework/application/forms/Settings.php @@ -7,6 +7,11 @@ class Cubedesigners_Form_Settings extends CubeIT_Form_Settings { $this->setTitle('Edition des paramètres du site'); + $locales = new CubeIT_Form_Element_LocalesMultiCheckbox('localesEnabled'); + $locales->setLabel('Langues actives'); + $this->addElement($locales); + + $longTitle = new Zend_Form_Element_Text('longTitle'); $longTitle->setLabel('Titre long par défaut (limité à 65 caractères)'); $longTitle->setAttrib('maxlength', 65); diff --git a/framework/application/views/helpers/CasestudiesDetail.php b/framework/application/views/helpers/CasestudiesDetail.php index b4b458c..1dd1474 100644 --- a/framework/application/views/helpers/CasestudiesDetail.php +++ b/framework/application/views/helpers/CasestudiesDetail.php @@ -6,7 +6,13 @@ class Cubedesigners_View_Helper_CasestudiesDetail extends CubeIT_View_Helper_Abs $visuel_detail = $this->view->imageProcess($studie->visuel_detail, $studie->titre, 980, 400); - $res = '
'; + $res = '
'; + $res.='
'; + $res.='

' . $studie->titre . '

'; + $res.='

' . $studie->description . '

'; + $res.='
'; + + $res .= '
'; $res .= '
'; $res .= '
' . $visuel_detail . '
'; @@ -86,6 +92,7 @@ class Cubedesigners_View_Helper_CasestudiesDetail extends CubeIT_View_Helper_Abs } } $res .= '
'; + $res .= '
'; return $res; } diff --git a/framework/application/views/helpers/CasestudiesList.php b/framework/application/views/helpers/CasestudiesList.php index 8f900f0..aab0611 100644 --- a/framework/application/views/helpers/CasestudiesList.php +++ b/framework/application/views/helpers/CasestudiesList.php @@ -78,8 +78,8 @@ class Cubedesigners_View_Helper_CasestudiesList extends CubeIT_View_Helper_Abstr if (is_array($r->technologies) && is_array($currentStudie->technologies)) { if (count($r->technologies) >= 1 && count($currentStudie->technologies) >= 1) { - for ($i = 0; $i < count($studieSecondaires); $i++) { - if (in_array($currentStudie->technologies[$i], $r->technologies)) { + foreach ($currentStudie->technologies as $t) { + if (in_array([$i], $r->technologies)) { $r->point += 15; } } @@ -144,7 +144,7 @@ class Cubedesigners_View_Helper_CasestudiesList extends CubeIT_View_Helper_Abstr } */ $image = $this->view->imageProcess($s->visuel, $s->titre, 300, 225); - $url = CubeIT_Navigation_Page::generateAutoUri($s, $this->_datas['seourl_stu']); + $url = Cubedesigners_Util::generateAutoUri($s, $this->_datas['seourl_stu']); $c = $image; $c.= '

' . $s->titre . '

'; diff --git a/framework/application/views/helpers/HomeSlideshow.php b/framework/application/views/helpers/HomeSlideshow.php index 43d1bdc..6185c38 100644 --- a/framework/application/views/helpers/HomeSlideshow.php +++ b/framework/application/views/helpers/HomeSlideshow.php @@ -16,7 +16,7 @@ class Cubedesigners_View_Helper_HomeSlideshow extends CubeIT_View_Helper_Abstrac foreach ($slides as $id => $slide) { if (null !== $slide['mask']) { - $image = $this->view->imageMasked($slide['image'], $slide['mask'], $slide['legend']); + $image = $this->view->imageMasked($slide['image'], $slide['mask'], $slide['legende']); $d = CubeIT_View_Helper_Image::$lastDimensions; } else { $image = $this->view->imageCms($slide['image'], $slide['legend']); diff --git a/framework/application/views/helpers/Realisation.php b/framework/application/views/helpers/Realisation.php index a438b42..0f7f4cc 100644 --- a/framework/application/views/helpers/Realisation.php +++ b/framework/application/views/helpers/Realisation.php @@ -4,13 +4,42 @@ class Cubedesigners_View_Helper_Realisation extends CubeIT_View_Helper_Abstract public function realisation($r) { - $res = '
'; + $this->addScriptAndStyle('realisation'); + $r = CubeIT_Util_Cms::unserialize($r); + + $res = ''; + $res.='
'; + $res .= '
'; $res .= '

' . $r->titre . '

'; $res .= '

' . Cubedesigners_Util::getCategoryById($r->categories) . '

'; $res.='
'; - $res.=$this->imageSlideshowScroll($r->visuel_detail, 545, array(), array('shortcuts' => false)); + + $slides = array(); + foreach ($r->visuel_detail as $s) { + if (CubeIT_Files::getExtension($s) == 'flv') { + $slides[] = $this->view->videoCubetube($s, 780, 16 / 9, array('background' => 'ffffff')); + } else { + $slides[] = $s; + } + } + + $res.=$this->imageSlideshowScroll($slides, 439, array(), array('shortcuts' => false)); + $res.='
'; + $res.=$this->_button($r->url); + $res.=$this->markupDotclear($r->description); + $res.='
'; + $res.='
'; return $res; } + protected function _button($b) { + $b = CubeIT_Util_Array::asArray($b); + + if ($b['label'] == '') { + $b['label'] = __('Voir le site'); + } + return $this->linkCMS($b, array('class' => 'but')); + } + } diff --git a/framework/application/views/helpers/RealisationsList.php b/framework/application/views/helpers/RealisationsList.php index 471e198..113e1a1 100644 --- a/framework/application/views/helpers/RealisationsList.php +++ b/framework/application/views/helpers/RealisationsList.php @@ -34,7 +34,7 @@ class Cubedesigners_View_Helper_RealisationsList extends CubeIT_View_Helper_Abst $rea.='

' . $r->titre . '

'; $rea.='

' . Cubedesigners_Util::getCategoryById($r->categories) . ' // ' . $this->dateTime($r->date, Zend_Date::YEAR) . '

'; - $url = CubeIT_Navigation_Page::generateAutoUri($r, $datas['seourl_rea']); + $url = Cubedesigners_Util::generateAutoUri($r, $datas['seourl_rea']); $res .= $this->link($rea, $url, array('data-id' => $r->id, 'data-cat' => $r->categories)); } diff --git a/framework/application/views/scripts/realisations/index.phtml b/framework/application/views/scripts/realisations/index.phtml index 8c9d0e7..753fd69 100644 --- a/framework/application/views/scripts/realisations/index.phtml +++ b/framework/application/views/scripts/realisations/index.phtml @@ -1,6 +1,7 @@ headTitle($this->realisation->titre . ' // ' . $this->currentPage->getParent()->getTitle() . ' // Cubedesigners', 'SET'); +$r = CubeIT_Util_Cms::unserialize($this->realisation); +$this->headTitle($r->titre . ' - ' . $r->legende . ' // ' . $this->currentPage->getParent()->getTitle(), 'SET'); $this->headSeo()->setDescription($this->realisation->description); $this->headOpenGraph()->setDescription($this->realisation->description); diff --git a/framework/application/views/scripts/studies/index.phtml b/framework/application/views/scripts/studies/index.phtml index 57c0b44..75ad2d1 100644 --- a/framework/application/views/scripts/studies/index.phtml +++ b/framework/application/views/scripts/studies/index.phtml @@ -1,11 +1,11 @@ headTitle($this->titre . ' // ' . $this->currentPage->getParent()->getTitle() . ' // Cubedesigners', 'SET'); $this->headSeo()->setDescription($this->studie->legende); -$this->headOpenGraph()->setDescription($this->realisation->legende); +$this->headOpenGraph()->setDescription($this->studie->legende); $this->headScript()->addScriptAndStyle('casestudies_detail'); ?> -
markupDotclear($this->titre); ?>
+ CasestudiesDetail($this->studie); diff --git a/js/slideshow.js b/js/slideshow.js index 7785807..a1cf3b2 100644 --- a/js/slideshow.js +++ b/js/slideshow.js @@ -3,11 +3,12 @@ registerLoader(loadCarrousel); function loadCarrousel() { $(window).on('cubeitresize', function () { var s = $(".slideshow,.slideshowcontinuous"); - fb(s); var ww = $(window).width(); var m = (ww - 1600) / 2; $(s).find(".imgholder").css({marginLeft: m}); $(s).find(".arrows").css({left: 960 + ((ww - 960) / 2) - 77 - 10}); }); + + } diff --git a/less/casestudies.less b/less/casestudies.less index 4d1deda..4eec6d0 100644 --- a/less/casestudies.less +++ b/less/casestudies.less @@ -29,13 +29,16 @@ h2 { font-size: 32px; line-height: 35px; + height:38px; color:#1b1b1b; } h3 { font-size: 14px; line-height: 16px; + height:18px; color:#545454; - margin-bottom: 20px; + margin:-3px 0 20px; + } &.last{ margin-right: 0; diff --git a/less/casestudies_detail.less b/less/casestudies_detail.less index a56006d..4500320 100644 --- a/less/casestudies_detail.less +++ b/less/casestudies_detail.less @@ -1,110 +1,105 @@ -/* Case studies detail Title */ -.casestudies-detail-title { - min-width: 980px; - max-width: 980px; - width:100%; - margin: 0 auto; - padding: 50px 0px 50px 0; - font-size: 32px; -} - -/* Case studies detail visuel */ -#casestudies-detail-visuel { - padding-bottom:50px; - - a { - background-color: #3885e0; - border-radius: 2px; - padding: 5px 20px; - color:#fff; - } - - a:hover, a:active { - background-color: #65a8f6; - color:#fff; - } - - .visuel-holder { - min-width: 980px; - max-width: 980px; - width:100%; - margin: 0 auto; - overflow:hidden; - } - - .visuel-holder .visuel { - width:980px; - height:400px; - padding-bottom: 20px; - } - - .visuel-holder .legende { - font-size: 18px; - float:left; - } - -} - - - -#casestudies-detail-content { - text-align: center; - background-color: #0194d5; - padding: 50px 0 0px 0; - - - .detail-text { - color: #fff; - width:640px; - margin:auto; - position: relative; - z-index: 10; - } - - .detail-text .titre { - font-size:32px; - padding-bottom: 10px; - } - - .detail-text .dotclear { - font-size:18px; - p{ - margin:10px 0 0 0; +.case{ + margin:50px 0 0 0; + h1{ + font-size: 32px; + } + h2{ + margin:0 0 15px 0; + } + + /* Case studies detail visuel */ + #casestudies-detail-visuel { + padding-bottom:50px; + + a { + background-color: #3885e0; + border-radius: 2px; + padding: 5px 20px; + color:#fff; } - } - - .detail-visuel { - padding: 0px 0 50px 0; - z-index: 1; - } - - .detail-video-background { - /*display: table;*/ - position: absolute; - top: -325px; - //left: 110px; - width:1280xp; - height:1280px; - z-index: 2; - } - - .detail-video { - padding: 0px 0 50px 0; - position: relative; - z-index: 5; - text-align: center; - /* vertical-align: middle; - display: table-cell; */ - } - - .detail-visuel { - width:100%; - background-position: 50%; - position: relative; - } -} - -/* max-width pour faibles résolutions */ -@media screen and (max-width: 1009px) { - -} + + a:hover, a:active { + background-color: #65a8f6; + color:#fff; + } + + .visuel-holder { + min-width: 980px; + max-width: 980px; + width:100%; + margin: 0 auto; + overflow:hidden; + } + + .visuel-holder .visuel { + width:980px; + height:400px; + padding-bottom: 20px; + } + + .visuel-holder .legende { + font-size: 18px; + float:left; + } + + } + + + + #casestudies-detail-content { + text-align: center; + background-color: #0194d5; + padding: 50px 0 0px 0; + + + .detail-text { + color: #fff; + width:640px; + margin:auto; + position: relative; + z-index: 10; + } + + .detail-text .titre { + font-size:32px; + padding-bottom: 10px; + } + + .detail-text .dotclear { + font-size:18px; + p{ + margin:10px 0 0 0; + } + } + + .detail-visuel { + padding: 0px 0 50px 0; + z-index: 1; + } + + .detail-video-background { + /*display: table;*/ + position: absolute; + top: -325px; + //left: 110px; + width:1280xp; + height:1280px; + z-index: 2; + } + + .detail-video { + padding: 0px 0 50px 0; + position: relative; + z-index: 5; + text-align: center; + /* vertical-align: middle; + display: table-cell; */ + } + + .detail-visuel { + width:100%; + background-position: 50%; + position: relative; + } + } +} \ No newline at end of file diff --git a/less/common.less b/less/common.less index bf8d6e9..ae70280 100644 --- a/less/common.less +++ b/less/common.less @@ -12,7 +12,6 @@ body { font-weight:300; color:#1b1b1b; opacity:0; - letter-spacing: -0.01em; transition:opacity 0.25s linear; } @@ -84,7 +83,7 @@ a.but { h1 { text-align: left; font-size: 56px; - line-height: 61px; + line-height: 81px; } h2 { text-align: left; @@ -97,4 +96,7 @@ a.but { h3,h4{ font-weight: 500; } + p{ + line-height: 1.56em; + } } \ No newline at end of file diff --git a/less/mixins.less b/less/mixins.less new file mode 100644 index 0000000..e69de29 diff --git a/less/realisation.less b/less/realisation.less new file mode 100644 index 0000000..51ac7d7 --- /dev/null +++ b/less/realisation.less @@ -0,0 +1,20 @@ +.realisation{ + margin:50px 0 0 0; + h1{ + font-size: 32px; + } + h2{ + margin:0 0 15px 0; + } + + .but{ + margin:20px 0; + float:right; + background-color: #3885e0 !important; + } + + .dotclear{ + clear: both; + margin:30px 0 30px 0; + } +} \ No newline at end of file diff --git a/less/slideshow.less b/less/slideshow.less index ee4abf1..042e57c 100644 --- a/less/slideshow.less +++ b/less/slideshow.less @@ -12,6 +12,37 @@ } } +.slideshowscroll{ + .slideshowmixin(); + + .slidescont{ + overflow:hidden; + max-width: 100%; + -webkit-overflow-scrolling: touch; + + } + .slidesfree{ + width:100000px; + } + .slides{ + display: inline-block; + overflow: visible; + max-width: none; + white-space:nowrap; + position:relative; + + + .slide{ + position:static; + display:inline-block !important; + margin:0 0 0 20px; + height:439px !important; + width:auto !important; + } + } + height:439px; +} + .slideshowcontinuous{ .slideshowmixin(); -- 2.39.5