From 64b39d079d4dfccf2dcd830d78c3c2a300b93d12 Mon Sep 17 00:00:00 2001 From: "bruno@cubedesigners.com" Date: Fri, 21 Mar 2014 16:26:10 +0000 Subject: [PATCH] --- framework/application/Bootstrap.php | 1 + .../forms/CMS/Sub/Casestudies/Studies.php | 4 + .../application/layouts/scripts/layout.phtml | 3 +- .../views/helpers/CasestudiesDetail.php | 136 ++++++----- .../views/helpers/CasestudiesList.php | 211 +++++++++++++++--- .../views/helpers/CasestudiesTagsList.php | 56 ++--- .../views/helpers/CategoriesList.php | 7 +- .../views/scripts/studies/index.phtml | 3 +- .../scripts/templates/realisations.phtml | 2 - js/realisations.js | 22 +- less/agence.less | 10 +- less/casestudies.less | 7 +- less/casestudies_detail.less | 6 +- less/common.less | 1 + less/header.less | 2 +- less/home.less | 6 + less/realisations.less | 10 + 17 files changed, 339 insertions(+), 148 deletions(-) diff --git a/framework/application/Bootstrap.php b/framework/application/Bootstrap.php index 9ad468d..c73615c 100644 --- a/framework/application/Bootstrap.php +++ b/framework/application/Bootstrap.php @@ -78,6 +78,7 @@ class Bootstrap extends CubeIT_Bootstrap { $casestudies->addColumn('technologies', 'text'); $casestudies->addColumn('tags_secondaires', 'text'); $casestudies->addColumn('online', 'boolean'); + $casestudies->addColumn('propulse', 'boolean'); $casestudies->addColumn('annee', 'text'); // Réalisations diff --git a/framework/application/forms/CMS/Sub/Casestudies/Studies.php b/framework/application/forms/CMS/Sub/Casestudies/Studies.php index 028e2a7..fa7acaa 100644 --- a/framework/application/forms/CMS/Sub/Casestudies/Studies.php +++ b/framework/application/forms/CMS/Sub/Casestudies/Studies.php @@ -14,6 +14,10 @@ class Cubedesigners_Form_CMS_Sub_Casestudies_Studies extends CubeIT_Form_List { $online->setLabel('En ligne'); $this->addElement($online); + $propulse = new Zend_Form_Element_Checkbox('propulse'); + $propulse->setLabel('Propulsée'); + $this->addElement($propulse); + $annee = new Zend_Form_Element_Text('annee'); $annee->setLabel('Année'); $this->addElement($annee); diff --git a/framework/application/layouts/scripts/layout.phtml b/framework/application/layouts/scripts/layout.phtml index b375859..a4c278a 100644 --- a/framework/application/layouts/scripts/layout.phtml +++ b/framework/application/layouts/scripts/layout.phtml @@ -6,12 +6,13 @@ $this->headScript()->addGSAP(); $this->headScript()->addWebFont($fonts); if ($this->acl()->isAllowed('edition')) { - $this->headScript()->addCommonsAdmin(); + $this->headScript()->addCommonsAdmin(); } $this->headScript()->addIEConditionnals(); $this->headScript()->appendFile('/js/common.js'); $this->headLink()->appendStylesheet('/less/common.less', 'all'); +$this->headMeta()->setViewport(1080); profile(__FILE__, __LINE__, 'Before rendering body'); $res = $this->htmlPage($this->render('common/body.phtml')); diff --git a/framework/application/views/helpers/CasestudiesDetail.php b/framework/application/views/helpers/CasestudiesDetail.php index 9e9b1eb..06e2b16 100644 --- a/framework/application/views/helpers/CasestudiesDetail.php +++ b/framework/application/views/helpers/CasestudiesDetail.php @@ -2,100 +2,94 @@ class Cubedesigners_View_Helper_CasestudiesDetail extends Zend_View_Helper_Abstract { - public function CasestudiesDetail($studie) { + public function CasestudiesDetail($studie) { - $visuel_detail = $this->view->imageProcess($studie->visuel_detail, $studie->titre, 980, 400); + $visuel_detail = $this->view->imageProcess($studie->visuel_detail, $studie->titre, 980, 400); - $res = '
'; - $res .= '
'; - $res .= '
' . $visuel_detail . '
'; + $res = '
'; + $res .= '
'; + $res .= '
' . $visuel_detail . '
'; - $res .= '
' . $studie->legende . '
'; + $res .= '
' . $studie->legende . '
'; - if ($studie->url != '') { - $res .= '' . __("Voir le site") . ''; - } + if ($studie->url != '') { + $res .= '' . __("Voir le site") . ''; + } - $res .= '
'; - $res .= '
'; + $res .= '
'; + $res .= '
'; - $style = ''; - if ($studie->couleur != '') { - $style = 'background-color:' . $studie->couleur; - } + $style = ''; + if ($studie->couleur != '') { + $style = 'background-color:' . $studie->couleur; + } - $res .= '
'; + $res .= '
'; + $blocs = $studie->blocs; + foreach ($blocs as $bloc) { - //$blocs = json_decode($studie->blocs[0], true); - $blocs = $studie->blocs; - fb($blocs); - foreach ($blocs as $bloc) { + // fb($bloc); + $margin = ''; + if ($bloc->margin != '') { + $margin = 'margin-top:' . $bloc->margin . 'px;'; + } - // fb($bloc); - $margin = ''; - if ($bloc->margin != '') { - $margin = 'margin-top:' . $bloc->margin . 'px;'; - } + $zindex = ''; + if ($bloc->zindex != 'default') { + $zindex = 'z-index:' . $bloc->zindex . ';'; + } - $zindex = ''; - if ($bloc->zindex != 'default') { - $zindex = 'z-index:' . $bloc->zindex . ';'; - } + if ($bloc->selectedtype == "text") { - if ($bloc->selectedtype == "text") { + $res .= '
'; + $res .= '
' . $bloc->titre . '
'; + $res .= '
' . $bloc->texte . '
'; + $res .= '
'; + } - $res .= '
'; - $res .= '
' . $bloc->titre . '
'; - $res .= '
' . $bloc->texte . '
'; - $res .= '
'; - } + if ($bloc->selectedtype == "visuel") { + $visuel = $this->view->imageProcess()->imageProcessGetUrl($bloc->visuel, '', 1200, null); + $width = -1; + $height = -1; + CubeIT_Image::getDimensions($visuel, $width, $height); - if ($bloc->selectedtype == "visuel") { - $visuel = $this->view->imageProcess()->imageProcessGetUrl($bloc->visuel, '', 1200, null); - $width = -1; - $height = -1; - CubeIT_Image::getDimensions($visuel, $width, $height); + $res .= '
'; + } + $addVideoBackground = false; + if ($bloc->video_background != false) { + $addVideoBackground = true; + } - $res .= '
'; - } + if ($bloc->selectedtype == "video") { + $res .= '
'; + $video = $this->view->videoWeb($bloc->video, 980); - $addVideoBackground = false; - if ($bloc->video_background != false) { - $addVideoBackground = true; - } + if ($addVideoBackground) { + $background = $this->view->imageProcess()->imageProcessGetUrl($bloc->video_background, '', 1200, null); + $width = -1; + $height = -1; + CubeIT_Image::getDimensions($background, $width, $height); + $top = ($height - 550) / 2; + $res.= '
'; + } + if ($addVideoBackground) { + $res.= "
"; + } - if ($bloc->selectedtype == "video") { + $res .= '
' . $video . '
'; + $res .= '
'; + } + } + $res .= '
'; - $res .= '
'; - $video = $this->view->videoWeb($bloc->video, 980); - - if ($addVideoBackground) { - $background = $this->view->imageProcess()->imageProcessGetUrl($bloc->video_background, '', 1200, null); - $width = -1; - $height = -1; - CubeIT_Image::getDimensions($background, $width, $height); - $top = ($height - 550) / 2; - //fb($height); - $res.= '
'; - } - if ($addVideoBackground) { - $res.= "
"; - } - - $res .= '
' . $video . '
'; - $res .= '
'; - } - } - $res .= '
'; - - return $res; - } + return $res; + } } diff --git a/framework/application/views/helpers/CasestudiesList.php b/framework/application/views/helpers/CasestudiesList.php index f62b603..e2f978a 100644 --- a/framework/application/views/helpers/CasestudiesList.php +++ b/framework/application/views/helpers/CasestudiesList.php @@ -2,20 +2,35 @@ class Cubedesigners_View_Helper_CasestudiesList extends Zend_View_Helper_Abstract { - public function CasestudiesList($datas) { + public function CasestudiesList($datas, $currentStudie = null) { + + $listStudies = array(); + $listStudiesPropulsed = array(); + + if ($currentStudie != null) { + // fb($currentStudie); + $studieCategorie = $currentStudie->categories; + $studieSecondaires = $currentStudie->tags_secondaires; + $studieTechnologies = $currentStudie->technologies; + $studieDomaines = $currentStudie->domaines; + $studieDate = $currentStudie->annee; + } $acl = Bootstrap::getInstance()->isAllowed("edition"); - $db = Zend_Db_Table::getDefaultAdapter(); $s = $db->select()->from('casestudies') ->order('id ASC'); - if (!$acl) { $s->where('online = ?', 1); } + /* if ($currentStudie != null) { + + $s->where('categories = ?', $studieCategorie); + } */ + $q = $s->query(); $count = 1; @@ -24,34 +39,178 @@ class Cubedesigners_View_Helper_CasestudiesList extends Zend_View_Helper_Abstrac while ($r = $q->fetch()) { - $r = CubeIT_Util_Cms::unserialize($r); - - $addSpacer = false; - - if ($count == 3) { - $count = 1; - $addClass = ''; - } else { - $addClass = ' blocmargin'; - $count++; + if ($r->id != $currentStudie->id) { + $r = CubeIT_Util_Cms::unserialize($r); + + //fb($r); + + $r->point = 0; + + $addSpacer = false; + + if ($count == 3) { + $count = 1; + $addClass = ''; + } else { + $addClass = ' blocmargin'; + $count++; + } + + $addOffline = ''; + if ($acl && $r->online == 0) { + $addOffline = 'data-offline="1"'; + } + + if ($currentStudie != null) { + if ($r->propulse == 1) + $r->point += 10000; + + if ($r->categories == $studieCategorie) + $r->point += 1000; + + if (is_array($r->tags_secondaires) && is_array($currentStudie->tags_secondaires)) { + if (count($r->tags_secondaires) >= 1 && count($currentStudie->tags_secondaires) >= 1) { + + for ($i = 0; $i < count($studieSecondaires); $i++) { + if (in_array($currentStudie->tags_secondaires[$i], $r->tags_secondaires)) + $r->point += 100; + } + } + } + + 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)) + $r->point += 15; + } + } + } + + if ($r->domaines != '') { + if ($r->domaines == $currentStudie->domaines) + $r->point += 10; + } + + if ($r->annee != '') { + if ($r->annee == $currentStudie->annee) + $r->point += 5; + } + } + + + /* if ($r->propulse == 1) { + array_push($listStudiesPropulsed, $r); + } else { */ + if (count($listStudies) < 3) { + array_push($listStudies, $r); + } else { + if ($r->point > $listStudies[0]->point) { + $listStudies[2] = $listStudies[1]; + $listStudies[1] = $listStudies[0]; + $listStudies[0] = $r; + } else if ($r->point > $listStudies[1]->point) { + $listStudies[2] = $listStudies[1]; + $listStudies[1] = $r; + } else if ($r->point > $listStudies[2]->point) { + $listStudies[2] = $r; + } else { + + } + } + //} + + + if ($currentStudie == null) { + $image = $this->view->imageProcess($r->visuel, $r->titre, 300, 225); + $url = CubeIT_Navigation_Page::generateAutoUri($r, $datas['seourl_stu']); + $res .= ''; + $res .= '
'; + $res .= '
' . $image . '
'; + $res .= '
' . $r->titre . '
'; + $res .= '
' . $r->description . '
'; + $res .= '
'; + $res .= '
'; + } } + } - $addOffline = ''; - if ($acl && $r->online == 0) { - $addOffline = 'data-offline="1"'; + if ($currentStudie != null) { + + $nbStudies = 0; + $count = 1; + + $listStudies = array_reverse($listStudies); + + /* if (count($listStudiesPropulsed) > 0) { + for ($k = 0; $k < count($listStudiesPropulsed); $k++) { + + $addSpacer = false; + + if ($count == 3) { + $count = 1; + $addClass = ''; + } else { + $addClass = ' blocmargin'; + $count++; + } + + $addOffline = ''; + if ($acl && $listStudiesPropulsed[$k]->online == 0) { + $addOffline = 'data-offline="1"'; + } + + $image = $this->view->imageProcess($listStudiesPropulsed[$k]->visuel, $listStudiesPropulsed[$k]->titre, 300, 225); + $url = CubeIT_Navigation_Page::generateAutoUri($listStudiesPropulsed[$k], $datas['seourl_stu']); + $res .= ''; + $res .= '
'; + $res .= '
' . $image . '
'; + $res .= '
' . $listStudiesPropulsed[$k]->titre . '
'; + $res .= '
' . $listStudiesPropulsed[$k]->description . '
'; + $res .= '
'; + $res .= '
'; + + $nbStudies++; + } + } */ + + + for ($j = 0; $j < count($listStudies); $j++) { + + if ($nbStudies < 3) { + $addSpacer = false; + + if ($count == 3) { + $count = 1; + $addClass = ''; + } else { + $addClass = ' blocmargin'; + $count++; + } + + $addOffline = ''; + if ($acl && $listStudies[$j]->online == 0) { + $addOffline = 'data-offline="1"'; + } + + $image = $this->view->imageProcess($listStudies[$j]->visuel, $listStudies[$j]->titre, 300, 225); + $url = CubeIT_Navigation_Page::generateAutoUri($listStudies[$j], $datas['seourl_stu']); + $res .= ''; + $res .= '
'; + $res .= '
' . $image . '
'; + $res .= '
' . $listStudies[$j]->titre . '
'; + $res .= '
' . $listStudies[$j]->description . '
'; + $res .= '
'; + $res .= '
'; + + $nbStudies++; + } } - - $image = $this->view->imageProcess($r->visuel, $r->titre, 300, 225); - $url = CubeIT_Navigation_Page::generateAutoUri($r, $datas['seourl_stu']); - $res .= ''; - $res .= '
'; - $res .= '
' . $image . '
'; - $res .= '
' . $r->titre . '
'; - $res .= '
' . $r->description . '
'; - $res .= '
'; - $res .= '
'; } + //fb($listStudies); + return $res; } diff --git a/framework/application/views/helpers/CasestudiesTagsList.php b/framework/application/views/helpers/CasestudiesTagsList.php index ceddc15..747b29f 100644 --- a/framework/application/views/helpers/CasestudiesTagsList.php +++ b/framework/application/views/helpers/CasestudiesTagsList.php @@ -2,44 +2,44 @@ class Cubedesigners_View_Helper_CasestudiesTagsList extends Zend_View_Helper_Abstract { - public function CasestudiesTagsList($studies) { + public function CasestudiesTagsList($studies) { - $tagslist = Array(); + $tagslist = Array(); - $db0 = Zend_Db_Table::getDefaultAdapter(); - $s0 = $db0->select()->from('casestudies') - ->order('id ASC'); - $s0->where('online = ?', 1); - $q0 = $s0->query(); + $db0 = Zend_Db_Table::getDefaultAdapter(); + $s0 = $db0->select()->from('casestudies') + ->order('id ASC'); + $s0->where('online = ?', 1); + $q0 = $s0->query(); - while ($r0 = $q0->fetch()) { - $temp = explode(',', $r0->tags); + while ($r0 = $q0->fetch()) { + $temp = explode(',', $r0->tags); - for ($i = 0; $i < count($temp); $i++) { - if (!in_array($temp[$i], $tagslist)) { - array_push($tagslist, $temp[$i]); + for ($i = 0; $i < count($temp); $i++) { + if (!in_array($temp[$i], $tagslist)) { + array_push($tagslist, $temp[$i]); + } + } } - } - } - $db = Zend_Db_Table::getDefaultAdapter(); - $s = $db->select()->from('tags') - ->order('name ASC'); - $q = $s->query(); + $db = Zend_Db_Table::getDefaultAdapter(); + $s = $db->select()->from('tags') + ->order('name ASC'); + $q = $s->query(); - $res = ''; + return $res; + } } diff --git a/framework/application/views/helpers/CategoriesList.php b/framework/application/views/helpers/CategoriesList.php index 7b2bd09..07a3e4c 100644 --- a/framework/application/views/helpers/CategoriesList.php +++ b/framework/application/views/helpers/CategoriesList.php @@ -11,7 +11,6 @@ class Cubedesigners_View_Helper_CategoriesList extends Zend_View_Helper_Abstract $db0 = Zend_Db_Table::getDefaultAdapter(); $s0 = $db0->select()->from($rubrique) ->order('id ASC'); - if (!$acl) { $s0->where('online = ?', 1); } @@ -34,6 +33,12 @@ class Cubedesigners_View_Helper_CategoriesList extends Zend_View_Helper_Abstract $res .= '
  • ' . __('TOUT VOIR') . '
  • '; while ($r = $q->fetch()) { + + $addOffline = ''; + if ($acl && $r->online == 0) { + $addOffline = 'data-offline="1"'; + } + if (in_array($r->id, $categorieslist)) { $res .= '
  • ' . $r->name . '
  • '; diff --git a/framework/application/views/scripts/studies/index.phtml b/framework/application/views/scripts/studies/index.phtml index 4e331c2..03ceb75 100644 --- a/framework/application/views/scripts/studies/index.phtml +++ b/framework/application/views/scripts/studies/index.phtml @@ -1,6 +1,7 @@ headScript()->addScriptAndStyle('casestudies'); $this->headScript()->addScriptAndStyle('casestudies_detail'); +//fb($this->studie); ?>
    markupDotclear($this->titre); ?>
    @@ -12,5 +13,5 @@ echo $this->CasestudiesDetail($this->studie);
    markupDotclear($this->casestudies_titre); ?>
    - CasestudiesList($this->datas); ?> + CasestudiesList($this->datas, $this->studie); ?>
    \ No newline at end of file diff --git a/framework/application/views/scripts/templates/realisations.phtml b/framework/application/views/scripts/templates/realisations.phtml index da5ca4f..471c3ef 100644 --- a/framework/application/views/scripts/templates/realisations.phtml +++ b/framework/application/views/scripts/templates/realisations.phtml @@ -1,7 +1,5 @@ headScript()->addScriptAndStyle('realisations'); -//$datas = Bootstrap::getInstance()->getCMSDatasOfPage($this->id); -//$this->headScriptVariables()->setVariable('realisations', $datas); ?>
    markupDotclear($this->titre); ?>
    diff --git a/js/realisations.js b/js/realisations.js index e88ea9b..1377ef2 100644 --- a/js/realisations.js +++ b/js/realisations.js @@ -111,22 +111,21 @@ function load_realisations() { $("html, body").animate({ scrollTop: $('#detailContent').offset().top-100 }, 1000); $('.close').css("top", $('#detailContent').offset().top); - $( "#detail" ).slideDown( "slow", function() { isAnim = false; addCloseAction(); currentSlide = 1; autoSlide = true; initSlideShow(); - + }).animate( { opacity: 1 }, - { queue: false, duration: 'slow' } + { queue: true, duration: 'slow' } ); }).animate( { opacity: 1 }, - { queue: false, duration: 'slow' } + { queue: true, duration: 'slow' } ); }else{ $(cible.parent()).before(detail); @@ -135,15 +134,16 @@ function load_realisations() { $('.close').css("top", $('#detailContent').offset().top); $( "#detail" ).slideDown( "slow", function() { - + isAnim = false; addCloseAction(); currentSlide = 1; autoSlide = true; initSlideShow(); + }).animate( { opacity: 1 }, - { queue: false, duration: 'slow' } + { queue: true, duration: 'slow' } ); } @@ -168,7 +168,7 @@ function load_realisations() { function addCloseAction() { $(".close").click(function() { - $("html, body").animate({ scrollTop: 0 }, 1000); + //$("html, body").animate({ scrollTop: 0 }, 1000); $( "#detail" ).slideUp( "slow", function() { $('#detailContent').remove(); currentOpen = 0; @@ -183,10 +183,10 @@ function addCloseAction() { } function initTagsLink() { - + $(".tag").click(function() { - $(".close").click(); + $(".close").click(); $(this).toggleClass('active'); @@ -201,7 +201,7 @@ function initTagsLink() { var index = $.inArray( $(this).attr("data-id"), showIds ); showIds.splice(index, 1); } - + if( showIds.length > 0 ) { $(".tag:first").removeClass('active'); }else{ @@ -254,7 +254,7 @@ function initSlideShow() { var total_lenght = totalWidth; - var t= setInterval(function(){ + var t= setInterval(function(){ var offset = $(le_div).offset(); diff --git a/less/agence.less b/less/agence.less index cb0b0cc..cfad1d8 100644 --- a/less/agence.less +++ b/less/agence.less @@ -39,6 +39,7 @@ width:30%; margin-right: 20px; } + .agency-pictos .bloc-holder .blocs .spacer { clear:left; padding:25px 0; @@ -55,8 +56,6 @@ padding-right: 20px; } - - /* Agence photo */ .agency-photo { overflow:hidden; @@ -67,8 +66,6 @@ } } - - /* Agence equipe */ .agency-persons { background-color:#3885e0; @@ -123,3 +120,8 @@ } +/* max-width pour faibles résolutions */ +@media screen and (max-width: 1009px) { + + +} \ No newline at end of file diff --git a/less/casestudies.less b/less/casestudies.less index 2015e03..e42d7a1 100644 --- a/less/casestudies.less +++ b/less/casestudies.less @@ -4,7 +4,6 @@ margin: 0 auto; padding: 0 0 20px 0; - ul { list-style: none; } @@ -74,4 +73,10 @@ } #casestudies-detail-content { background-color: #3885E0; +} + +/* max-width pour faibles résolutions */ +@media screen and (max-width: 1009px) { + + } \ No newline at end of file diff --git a/less/casestudies_detail.less b/less/casestudies_detail.less index e68b199..cbb3319 100644 --- a/less/casestudies_detail.less +++ b/less/casestudies_detail.less @@ -38,7 +38,6 @@ padding-bottom: 20px; } - .visuel-holder .legende { font-size: 18px; float:left; @@ -102,3 +101,8 @@ position: relative; } } + +/* max-width pour faibles résolutions */ +@media screen and (max-width: 1009px) { + +} diff --git a/less/common.less b/less/common.less index f607d2b..739e7be 100644 --- a/less/common.less +++ b/less/common.less @@ -31,6 +31,7 @@ a:active { //min-width: 1024px; //max-width: 1200px; width:100%; + overflow:hidden; } #main .main-holder { diff --git a/less/header.less b/less/header.less index 5dfb5eb..eccbb12 100644 --- a/less/header.less +++ b/less/header.less @@ -64,7 +64,7 @@ } #header .logo { - background: url('../images/logo-mobile.png') no-repeat; + //background: url('../images/logo-mobile.png') no-repeat; width:212px; height:97px; float:left; diff --git a/less/home.less b/less/home.less index 8b330d7..feeed60 100644 --- a/less/home.less +++ b/less/home.less @@ -157,4 +157,10 @@ #home-expertise .bloc-holder .sousbloc img { float:left; padding: 0 25px 0 0; +} + +/* max-width pour faibles résolutions */ +@media screen and (max-width: 1009px) { + + } \ No newline at end of file diff --git a/less/realisations.less b/less/realisations.less index 1ba97a2..bcb1e34 100644 --- a/less/realisations.less +++ b/less/realisations.less @@ -104,6 +104,10 @@ margin-bottom: 15px; width:10000px; white-space: nowrap; + -webkit-transform: translate3d(0,0,0); + -webkit-backface-visibility: hidden; + -webkit-perspective: 1000; + transform: translate3d(0,0,0); } #detailContent { @@ -231,3 +235,9 @@ } + +/* max-width pour faibles résolutions */ +@media screen and (max-width: 1009px) { + + +} -- 2.39.5