From: vincent@cubedesigners.com Date: Thu, 20 Nov 2014 16:03:50 +0000 (+0000) Subject: (no commit message) X-Git-Url: http://git.cubedesigners.com/?a=commitdiff_plain;h=e0213ce709ddf02cdcb188d2657d17352e47f0f6;p=cubedesigners-v7.git --- diff --git a/framework/application/Cubedesigners/Util.php b/framework/application/Cubedesigners/Util.php new file mode 100644 index 0000000..05cdf9b --- /dev/null +++ b/framework/application/Cubedesigners/Util.php @@ -0,0 +1,20 @@ +getName()); + } + + protected static function _getCategories() { + if (null !== self::$_categories) { + return; + } + + self::$_categories = Cubedesigners_Model_Categorie::factory()->find(); + } + +} diff --git a/framework/application/forms/CMS/Agence.php b/framework/application/forms/CMS/Agence.php index ba3aca2..df32a30 100644 --- a/framework/application/forms/CMS/Agence.php +++ b/framework/application/forms/CMS/Agence.php @@ -10,8 +10,7 @@ class Cubedesigners_Form_CMS_Agence extends Cubedesigners_Form_CMS_Twocolumns { $this->addSubForm($pictos, 'pictos'); $photo = new CubeIT_Form_Element_File_Image('photo'); - $photo->setMaxItems(1); - $photo->setLabel('Photo'); + $photo->setLabel('Photos de l\'agence'); $this->addElement($photo); $equipe = new Cubedesigners_Form_CMS_Sub_Agence_Persons(); @@ -20,5 +19,3 @@ class Cubedesigners_Form_CMS_Agence extends Cubedesigners_Form_CMS_Twocolumns { } } - -?> \ No newline at end of file diff --git a/framework/application/forms/CMS/Sub/Casestudies/Content/Bloc.php b/framework/application/forms/CMS/Sub/Casestudies/Content/Bloc.php index a73f077..2807cf4 100644 --- a/framework/application/forms/CMS/Sub/Casestudies/Content/Bloc.php +++ b/framework/application/forms/CMS/Sub/Casestudies/Content/Bloc.php @@ -2,60 +2,63 @@ class Cubedesigners_Form_CMS_Sub_Casestudies_Content_Bloc extends CubeIT_Form_SubForm { - public function init() { - parent::init(); - - $isCompactTrad = false; - - $select = new Cubedesigners_Form_Element_ContentType("selected-type"); - $select->setAttrib('data-name', 'selected-type'); - $this->addElement($select); - - $margin = new Zend_Form_Element_Text('margin'); - $margin->setLabel("Décalage vertical du bloc (en pixels)"); - $this->addElement($margin); - - $zindex = new Zend_Form_Element_Select('zindex'); - $options = array('default' => 'Par défaut'); - for ($i = 1; $i <= 10; $i++) { - $options[$i] = $i; - } - $zindex->setMultiOptions($options); - $zindex->setLabel('z-index du bloc'); - $this->addElement($zindex); - - $annee = new Zend_Form_Element_Text('annee'); - $annee->setLabel('Année'); - $this->addElement($annee); - - $titre = new Zend_Form_Element_Text('titre'); - $titre->setLabel('Titre'); - $this->addElementLocalized($titre, $isCompactTrad); - - $texte = new CubeIT_Form_Element_Markitup_Basic('texte'); - $texte->setLabel('Texte'); - $this->addElementLocalized($texte, $isCompactTrad); - - $visuel = new CubeIT_Form_Element_File_Image('visuel'); - $visuel->setLabel('Visuel'); - $visuel->setMaxItems(1); - $this->addElementLocalized($visuel, $isCompactTrad); - - $video = new CubeIT_Form_Element_WebVideo('video'); - $video->setLabel('URL de la vidéo'); - $this->addElementLocalized($video, $isCompactTrad); - - $video_background = new CubeIT_Form_Element_File_Image('video_background'); - $video_background->setLabel('Fond de la vidéo'); - $video_background->setMaxItems(1); - $this->addElement($video_background); - - $type = new Zend_Form_Element_Hidden('form-type'); - $type->setAttrib('data-name', 'form-type'); - $type->setValue('test'); - $this->addElement($type); - } + public function init() { + parent::init(); -} + $isCompactTrad = false; + + $select = new Cubedesigners_Form_Element_ContentType("selected-type"); + $select->setAttrib('data-name', 'selected-type'); + $this->addElement($select); + + $margin = new Zend_Form_Element_Text('margin'); + $margin->setLabel("Décalage vertical du bloc (en pixels)"); + $this->addElement($margin); + + $zindex = new Zend_Form_Element_Select('zindex'); + $options = array('default' => 'Par défaut'); + for ($i = 1; $i <= 10; $i++) { + $options[$i] = $i; + } + $zindex->setMultiOptions($options); + $zindex->setLabel('z-index du bloc'); + $this->addElement($zindex); + + $annee = new Zend_Form_Element_Text('annee'); + $annee->setLabel('Année'); + $this->addElement($annee); + + $titre = new Zend_Form_Element_Text('titre'); + $titre->setLabel('Titre'); + $this->addElementLocalized($titre, $isCompactTrad); + + $texte = new CubeIT_Form_Element_Markitup_Basic('texte'); + $texte->setLabel('Texte'); + $this->addElementLocalized($texte, $isCompactTrad); -?> + $visuel = new CubeIT_Form_Element_File_Image('visuel'); + $visuel->setLabel('Visuel'); + $visuel->setMaxItems(1); + $this->addElementLocalized($visuel, $isCompactTrad); + + $visuelpadding = new Zend_Form_Element_Text('visuelpadding'); + $visuelpadding->setLabel('Margin intérieur sous le visuel'); + $visuelpadding->setValue(50); + $this->addElement($visuelpadding); + + $video = new CubeIT_Form_Element_WebVideo('video'); + $video->setLabel('URL de la vidéo'); + $this->addElementLocalized($video, $isCompactTrad); + + $video_background = new CubeIT_Form_Element_File_Image('video_background'); + $video_background->setLabel('Fond de la vidéo'); + $video_background->setMaxItems(1); + $this->addElement($video_background); + + $type = new Zend_Form_Element_Hidden('form-type'); + $type->setAttrib('data-name', 'form-type'); + $type->setValue('test'); + $this->addElement($type); + } + +} diff --git a/framework/application/views/helpers/CasestudiesDetail.php b/framework/application/views/helpers/CasestudiesDetail.php index 06e2b16..f71984d 100644 --- a/framework/application/views/helpers/CasestudiesDetail.php +++ b/framework/application/views/helpers/CasestudiesDetail.php @@ -1,96 +1,95 @@ -view->imageProcess($studie->visuel_detail, $studie->titre, 980, 400); - - $res = '
'; - $res .= '
'; - $res .= '
' . $visuel_detail . '
'; - - - $res .= '
' . $studie->legende . '
'; - - if ($studie->url != '') { - $res .= '' . __("Voir le site") . ''; - } - - $res .= '
'; - $res .= '
'; - - $style = ''; - if ($studie->couleur != '') { - $style = 'background-color:' . $studie->couleur; - } - - $res .= '
'; - - $blocs = $studie->blocs; - - foreach ($blocs as $bloc) { - - // fb($bloc); - $margin = ''; - if ($bloc->margin != '') { - $margin = 'margin-top:' . $bloc->margin . 'px;'; - } - - $zindex = ''; - if ($bloc->zindex != 'default') { - $zindex = 'z-index:' . $bloc->zindex . ';'; - } - - if ($bloc->selectedtype == "text") { - - $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); - - $res .= '
'; - } - - - $addVideoBackground = false; - if ($bloc->video_background != false) { - $addVideoBackground = true; - } - - if ($bloc->selectedtype == "video") { - - $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; - $res.= '
'; - } - if ($addVideoBackground) { - $res.= "
"; - } - - $res .= '
' . $video . '
'; - $res .= '
'; - } - } - $res .= '
'; - - return $res; - } - -} - -?> +view->imageProcess($studie->visuel_detail, $studie->titre, 980, 400); + + $res = '
'; + $res .= '
'; + $res .= '
' . $visuel_detail . '
'; + + $res .= '
' . $studie->legende . '
'; + + if ($studie->url != '') { + $res .= '' . __("Voir le site") . ''; + } + + $res .= '
'; + $res .= '
'; + + $style = ''; + if ($studie->couleur != '') { + $style = 'background-color:' . $studie->couleur; + } + + $res .= '
'; + + $blocs = $studie->blocs; + + foreach ($blocs as $bloc) { + + // fb($bloc); + $margin = ''; + if ($bloc->margin != '') { + $margin = 'margin-top:' . $bloc->margin . 'px;'; + } + + $zindex = ''; + if ($bloc->zindex != 'default') { + $zindex = 'z-index:' . $bloc->zindex . ';'; + } + + if ($bloc->selectedtype == "text") { + + $res .= '
'; + $res .= '
' . $bloc->titre . '
'; + $res .= '
' . $bloc->texte . '
'; + $res .= '
'; + } + + if ($bloc->selectedtype == "visuel") { + $visuel = CubeIT_View_Helper_ImageCms::getPath($bloc->visuel); + $width = -1; + $height = -1; + CubeIT_Image::getDimensions($visuel, $width, $height); + $padding = isset($bloc->visuelpadding) ? $bloc->visuelpadding : 50; + $res .= '
'; + } + + + $addVideoBackground = false; + if ($bloc->video_background != false) { + $addVideoBackground = true; + } + + if ($bloc->selectedtype == "video") { + + $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; + $res.= '
'; + } + if ($addVideoBackground) { + $res.= "
"; + } + + $res .= '
' . $video . '
'; + $res .= '
'; + } + } + $res .= '
'; + + return $res; + } + +} + +?> diff --git a/framework/application/views/helpers/CasestudiesList.php b/framework/application/views/helpers/CasestudiesList.php index 65a8d8f..dfc9327 100644 --- a/framework/application/views/helpers/CasestudiesList.php +++ b/framework/application/views/helpers/CasestudiesList.php @@ -5,7 +5,7 @@ class Cubedesigners_View_Helper_CasestudiesList extends CubeIT_View_Helper_Abstr protected $_datas; public function CasestudiesList($datas, $currentStudie = null) { - + $this->addScriptAndStyle('casestudies'); $this->_datas = $datas; $listStudies = array(); $listStudiesPropulsed = array(); @@ -125,14 +125,15 @@ class Cubedesigners_View_Helper_CasestudiesList extends CubeIT_View_Helper_Abstr $listStudies = array_reverse($listStudies); - foreach ($listStudies as $s) { - $res.=$this->_case($s); + foreach ($listStudies as $i => $s) { + $res.=$this->_case($s, $i); } } return $res; } - protected function _case($s) { + protected function _case($s, $i) { + $addOffline = ''; if ($acl && $s->online == 0) { $addOffline = 'data-offline="1"'; @@ -145,7 +146,12 @@ class Cubedesigners_View_Helper_CasestudiesList extends CubeIT_View_Helper_Abstr $c.= '

' . $s->titre . '

'; $c.='

' . $s->description . '

'; - return $this->link($c, $url, array('data-cat' => $s->categories)); + $class = array(); + if ($i % 3 == 2) { + $class[] = 'last'; + } + + return $this->link($c, $url, array('data-cat' => $s->categories, 'class' => $class)); } } diff --git a/framework/application/views/helpers/CategoriesList.php b/framework/application/views/helpers/CategoriesList.php index 01d35a8..8ad7142 100644 --- a/framework/application/views/helpers/CategoriesList.php +++ b/framework/application/views/helpers/CategoriesList.php @@ -2,7 +2,7 @@ class Cubedesigners_View_Helper_CategoriesList extends Zend_View_Helper_Abstract { - public function CategoriesList($rubrique, $listId) { + public function CategoriesList($rubrique, $listId, $itemsPerLine) { $acl = Bootstrap::getInstance()->isAllowed("edition"); @@ -36,7 +36,7 @@ class Cubedesigners_View_Helper_CategoriesList extends Zend_View_Helper_Abstract $tags[$r->id] = $r->name; } } - $res.=$this->view->tags($tags, array('data-perline' => 3, 'data-list' => '#' . $listId)); + $res.=$this->view->tags($tags, array('data-perline' => $itemsPerLine, 'data-list' => '#' . $listId)); return $res; diff --git a/framework/application/views/helpers/RealisationsList.php b/framework/application/views/helpers/RealisationsList.php index 688692c..471e198 100644 --- a/framework/application/views/helpers/RealisationsList.php +++ b/framework/application/views/helpers/RealisationsList.php @@ -21,30 +21,22 @@ class Cubedesigners_View_Helper_RealisationsList extends CubeIT_View_Helper_Abst $test = 0; while ($r = $q->fetch()) { - $r = CubeIT_Util_Cms::unserialize($r); - $addSpacer = false; - - $addClass = ' blocmargin'; - - $addOffline = ''; if ($acl && $r->online == 0) { $addOffline = 'data-offline="1"'; } - $visuel = $this->view->imageProcess($r->visuel_detail, '', null, 440); + $rea = $this->view->imageProcess($r->visuel, $r->titre, 170, 127); + $rea.='

' . $r->titre . '

'; + $rea.='

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

'; - $image = $this->view->imageProcess($r->visuel, $r->titre, 127, 127); $url = CubeIT_Navigation_Page::generateAutoUri($r, $datas['seourl_rea']); - $res .= $this->link($image, $url, array('data-id' => $r->id, 'data-categorie' => $r->categories)); - $test++; - - $count++; + $res .= $this->link($rea, $url, array('data-id' => $r->id, 'data-cat' => $r->categories)); } return $res; diff --git a/framework/application/views/scripts/studies/index.phtml b/framework/application/views/scripts/studies/index.phtml index 03ceb75..d6b9424 100644 --- a/framework/application/views/scripts/studies/index.phtml +++ b/framework/application/views/scripts/studies/index.phtml @@ -1,17 +1,15 @@ -headScript()->addScriptAndStyle('casestudies'); -$this->headScript()->addScriptAndStyle('casestudies_detail'); -//fb($this->studie); -?> - -
markupDotclear($this->titre); ?>
- -CasestudiesDetail($this->studie); -?> - -
markupDotclear($this->casestudies_titre); ?>
- -
- CasestudiesList($this->datas, $this->studie); ?> +headScript()->addScriptAndStyle('casestudies_detail'); +?> + +
markupDotclear($this->titre); ?>
+ +CasestudiesDetail($this->studie); +?> + +
markupDotclear($this->casestudies_titre); ?>
+ +
+ CasestudiesList($this->datas, $this->studie); ?>
\ No newline at end of file diff --git a/framework/application/views/scripts/templates/agence.phtml b/framework/application/views/scripts/templates/agence.phtml index b8a2698..7fbd109 100644 --- a/framework/application/views/scripts/templates/agence.phtml +++ b/framework/application/views/scripts/templates/agence.phtml @@ -13,7 +13,7 @@ echo $this->twocols();
-
imageProcess($this->photo, '', 1200, 545); ?>
+
imageSlideshowContinuous($this->photo, 545); ?>
diff --git a/framework/application/views/scripts/templates/casestudies.phtml b/framework/application/views/scripts/templates/casestudies.phtml index d49ede2..afa7782 100644 --- a/framework/application/views/scripts/templates/casestudies.phtml +++ b/framework/application/views/scripts/templates/casestudies.phtml @@ -7,7 +7,7 @@ $this->headScript()->addScriptAndStyle('casestudies');
CategoriesList('casestudies', 'casestudies-list'); + echo $this->CategoriesList('casestudies', 'casestudies-list', 3); ?>
diff --git a/framework/application/views/scripts/templates/realisations.phtml b/framework/application/views/scripts/templates/realisations.phtml index ce461b0..db3ceec 100644 --- a/framework/application/views/scripts/templates/realisations.phtml +++ b/framework/application/views/scripts/templates/realisations.phtml @@ -6,7 +6,7 @@ $this->headScript()->addScriptAndStyle('realisations');
CategoriesList("realisations"); + echo $this->CategoriesList("realisations", 'realisations-list', 5); ?>
diff --git a/js/admin.js b/js/admin.js index 09ee701..e9ffcab 100644 --- a/js/admin.js +++ b/js/admin.js @@ -1,47 +1,50 @@ -TO_LOAD[TO_LOAD.length] = 'load_admin();'; - -function load_admin() { - initSelectType(); -} - -function initSelectType() { - $( "select[data-name='selected-type']" ).each( function() { - var cible = $(this).parent().parent(); - displayFormTypeElements( cible, this.value ); - }); - - $(document).on("change", "select[data-name='selected-type']", function() { - var cible = $(this).parent().parent(); - displayFormTypeElements( cible, this.value ); - }); -} - -function displayFormTypeElements( cible, choice ) { - - switch ( choice ) { - case 'text' : - cible.children("#titre-element").css("display","block"); - cible.children("#texte-element").css("display","block"); - cible.children("#visuel-element").css("display","none"); - cible.children("#video-element").css("display","none"); - cible.children(".elementwrap-video_background").css("display","none"); - break; - - case 'visuel' : - cible.children("#titre-element").css("display","none"); - cible.children("#texte-element").css("display","none"); - cible.children("#visuel-element").css("display","block"); - cible.children("#video-element").css("display","none"); - cible.children(".elementwrap-video_background").css("display","none"); - break; - - case 'video' : - cible.children("#titre-element").css("display","none"); - cible.children("#texte-element").css("display","none"); - cible.children("#visuel-element").css("display","none"); - cible.children("#video-element").css("display","block"); - cible.children(".elementwrap-video_background").css("display","block"); - break; - } - +TO_LOAD[TO_LOAD.length] = 'load_admin();'; + +function load_admin() { + initSelectType(); +} + +function initSelectType() { + $("select[data-name='selected-type']").each(function () { + var cible = $(this).parent().parent(); + displayFormTypeElements(cible, this.value); + }); + + $(document).on("change", "select[data-name='selected-type']", function () { + var cible = $(this).parent().parent(); + displayFormTypeElements(cible, this.value); + }); +} + +function displayFormTypeElements(cible, choice) { + + switch (choice) { + case 'text' : + cible.children("#titre-element").css("display", "block"); + cible.children("#texte-element").css("display", "block"); + cible.children("#visuel-element").css("display", "none"); + cible.children("#visuelpadding-element").css("display", "none"); + cible.children("#video-element").css("display", "none"); + cible.children(".elementwrap-video_background").css("display", "none"); + break; + + case 'visuel' : + cible.children("#titre-element").css("display", "none"); + cible.children("#texte-element").css("display", "none"); + cible.children("#visuel-element").css("display", "block"); + cible.children("#visuelpadding-element").css("display", "block"); + cible.children("#video-element").css("display", "none"); + cible.children(".elementwrap-video_background").css("display", "none"); + break; + + case 'video' : + cible.children("#titre-element").css("display", "none"); + cible.children("#texte-element").css("display", "none"); + cible.children("#visuel-element").css("display", "none"); + cible.children("#visuelpadding-element").css("display", "none"); + cible.children("#video-element").css("display", "block"); + cible.children(".elementwrap-video_background").css("display", "block"); + break; + } + } \ No newline at end of file diff --git a/less/casestudies.less b/less/casestudies.less index 1e0287a..4d1deda 100644 --- a/less/casestudies.less +++ b/less/casestudies.less @@ -1,3 +1,7 @@ +.title.margin{ + margin-bottom: 40px; +} + #casestudies-list { min-width: 980px; max-width: 980px; diff --git a/less/common.less b/less/common.less index ddc9308..74243e1 100644 --- a/less/common.less +++ b/less/common.less @@ -91,3 +91,9 @@ a.but { line-height: 25px; } } + +.dotclear{ + h3,h4{ + font-weight: 500; + } +} \ No newline at end of file diff --git a/less/list.less b/less/list.less index 7079648..19269dc 100644 --- a/less/list.less +++ b/less/list.less @@ -3,6 +3,10 @@ section.list{ &#agency,&#expertises{ background-color:#3885e0; color:#fff; + a{ + color:#fff; + text-decoration: underline; + } } &#expertisehome { diff --git a/less/realisations.less b/less/realisations.less index 7f3c857..c2eaf90 100644 --- a/less/realisations.less +++ b/less/realisations.less @@ -7,15 +7,37 @@ a,a:hover { color:#000; display:inline-block; - margin:0 15px 10px 0; - width:127px; - height:127px; + margin:0 32px 30px 0; + width:170px; + height:170px; img{ display: block; - width:127px; + width:170px; height:127px; } - &:nth-child(7n){ + h2,h3{ + white-space: nowrap; + overflow-x: hidden; + overflow-y: visible; + max-width: 170px; + text-overflow: ellipsis; + } + + h2 { + font-size: 23px; + line-height: 20px; + color:#1b1b1b; + margin:8px 0 0 0; + height:25px; + } + h3 { + font-size: 14px; + line-height: 16px; + color:#545454; + height:18px; + margin:0 0 20px 0; + } + &.last{ margin-right: 0px; } } diff --git a/less/twocols.less b/less/twocols.less index baf6677..7949ddf 100644 --- a/less/twocols.less +++ b/less/twocols.less @@ -5,7 +5,7 @@ } ul{ - margin:-30px 0 30px 0; + margin:15px 0 30px 0; list-style: none; li{ &:before{