From 4e694b07e87eeb8432ffc589108bd069f41d5ae9 Mon Sep 17 00:00:00 2001 From: "vincent@cubedesigners.com" Date: Tue, 9 Sep 2014 12:13:03 +0000 Subject: [PATCH] --- framework/application/forms/CMS/Expertise.php | 6 +- .../views/helpers/CasestudiesTagsList.php | 92 ++--- .../views/helpers/CategoriesList.php | 101 +++--- .../application/views/helpers/HomeBlocs.php | 27 +- framework/application/views/helpers/Liste.php | 4 +- framework/application/views/helpers/Tags.php | 20 ++ .../views/scripts/templates/expertise.phtml | 6 + less/casestudies.less | 45 +-- less/list.less | 31 +- less/realisations.less | 318 ++++++++---------- less/taglist.less | 21 ++ 11 files changed, 339 insertions(+), 332 deletions(-) create mode 100644 framework/application/views/helpers/Tags.php create mode 100644 framework/application/views/scripts/templates/expertise.phtml create mode 100644 less/taglist.less diff --git a/framework/application/forms/CMS/Expertise.php b/framework/application/forms/CMS/Expertise.php index 54b7c71..a8e5b19 100644 --- a/framework/application/forms/CMS/Expertise.php +++ b/framework/application/forms/CMS/Expertise.php @@ -1,5 +1,9 @@ select()->from('casestudies') - ->order('id ASC'); - $s0->where('online = ?', 1); - $q0 = $s0->query(); - - 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]); - } - } - } - - $db = Zend_Db_Table::getDefaultAdapter(); - $s = $db->select()->from('tags') - ->order('name ASC'); - $q = $s->query(); - - $res = ''; - return $res; - } - -} - -?> +select()->from('casestudies') + ->order('id ASC'); + $s0->where('online = ?', 1); + $q0 = $s0->query(); + + 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]); + } + } + } + + $db = Zend_Db_Table::getDefaultAdapter(); + $s = $db->select()->from('tags') + ->order('name ASC'); + $q = $s->query(); + + $tags = array(); + while ($r = $q->fetch()) { + if (in_array($r->id, $tagslist)) { + $tags[$r->id] = $r->name; + } + } + + $res.=$this->view->tags($tags); + + + + return $res; + } + +} + +?> diff --git a/framework/application/views/helpers/CategoriesList.php b/framework/application/views/helpers/CategoriesList.php index 07a3e4c..620e6c6 100644 --- a/framework/application/views/helpers/CategoriesList.php +++ b/framework/application/views/helpers/CategoriesList.php @@ -1,54 +1,47 @@ -isAllowed("edition"); - - $categorieslist = Array(); - - $db0 = Zend_Db_Table::getDefaultAdapter(); - $s0 = $db0->select()->from($rubrique) - ->order('id ASC'); - if (!$acl) { - $s0->where('online = ?', 1); - } - - $q0 = $s0->query(); - - while ($r0 = $q0->fetch()) { - - if (!in_array($r0->categories, $categorieslist)) { - array_push($categorieslist, $r0->categories); - } - } - - $db = Zend_Db_Table::getDefaultAdapter(); - $s = $db->select()->from('categories') - ->order('name ASC'); - $q = $s->query(); - - $res = ''; - return $res; - } - -} - -?> +isAllowed("edition"); + + $categorieslist = Array(); + + $db0 = Zend_Db_Table::getDefaultAdapter(); + $s0 = $db0->select()->from($rubrique) + ->order('id ASC'); + if (!$acl) { + $s0->where('online = ?', 1); + } + + $q0 = $s0->query(); + + while ($r0 = $q0->fetch()) { + + if (!in_array($r0->categories, $categorieslist)) { + array_push($categorieslist, $r0->categories); + } + } + + $db = Zend_Db_Table::getDefaultAdapter(); + $s = $db->select()->from('categories') + ->order('name ASC'); + $q = $s->query(); + + + $tags = array(); + while ($r = $q->fetch()) { + if (in_array($r->id, $categorieslist)) { + $tags[$r->id] = $r->name; + } + } + $res.=$this->view->tags($tags); + + + return $res; + } + +} + +?> diff --git a/framework/application/views/helpers/HomeBlocs.php b/framework/application/views/helpers/HomeBlocs.php index b63e951..25dbe56 100644 --- a/framework/application/views/helpers/HomeBlocs.php +++ b/framework/application/views/helpers/HomeBlocs.php @@ -2,30 +2,39 @@ class Cubedesigners_View_Helper_HomeBlocs extends Zend_View_Helper_Abstract { - public function homeBlocs($blocs, $displayDetailsButton = false) { + public function homeBlocs($blocs, $displayDetailsButton = false, $cols = 2) { $blocs = $blocs['blocs']; - $res = '
'; + $res = ''; $i = 0; - foreach ($blocs as $id => $bloc) { - if (($i % 2) == 0 && $i != 0) { - $res.='
'; + foreach ($blocs as $bloc) { + if ($cols == 2) { + if (($i % 2) == 0 && $i != 0) { + $res.='
'; + } } $image = $this->view->imageCms($bloc['picto'], $bloc['titre'], 120, 120); $res .= '
'; $res.= $image; + + $res.= '
'; $res.= '

' . $bloc['titre'] . '

'; - $res.= '
' . $this->view->markupDotclear($bloc['texte']); - if ($displayDetailsButton) { + $res.=$this->view->markupDotclear($bloc['texte']); + if ($displayDetailsButton && isset($bloc['lien']) && $bloc['lien']) { $res.=$this->view->linkInternal(__('En savoir plus'), $bloc['lien'], array('class' => 'but')); } $res.='
'; $res .= '
'; $i++; } - $res .= '
'; - return $res; + + $class = array('blocs'); + if ($cols == 2) { + $class[] = 'two'; + } + + return $this->view->htmlElement($res, 'div', array('class' => $class)); } } diff --git a/framework/application/views/helpers/Liste.php b/framework/application/views/helpers/Liste.php index a853fe7..755874c 100644 --- a/framework/application/views/helpers/Liste.php +++ b/framework/application/views/helpers/Liste.php @@ -2,7 +2,7 @@ class Cubedesigners_View_Helper_Liste extends Zend_View_Helper_Abstract { - public function liste($items, $displayDetailsButtons = false, $attrs = array()) { + public function liste($items, $displayDetailsButtons = false, $attrs = array(), $cols = 2) { $defaultAttrs = array('class' => array('list')); $attrs = array_merge($defaultAttrs, $attrs); @@ -10,7 +10,7 @@ class Cubedesigners_View_Helper_Liste extends Zend_View_Helper_Abstract { $this->view->headLink()->appendStylesheet('/less/list.less'); $res = '
'; $res.='

' . ucfirst($items['titre']) . '

'; - $res.=$this->view->homeBlocs($items, $displayDetailsButtons); + $res.=$this->view->homeBlocs($items, $displayDetailsButtons, $cols); if ($items['button']['label']) { $res.=$this->view->linkCMS($items['button'], array('class' => 'but')); } diff --git a/framework/application/views/helpers/Tags.php b/framework/application/views/helpers/Tags.php new file mode 100644 index 0000000..8d58825 --- /dev/null +++ b/framework/application/views/helpers/Tags.php @@ -0,0 +1,20 @@ +view->headLink()->appendStylesheet('/less/taglist.less'); + if (isset($attrs['class'])) { + $attrs['class'].=" tags"; + } else { + $attrs['class'] = 'tags'; + } + $items[] = array('content' => __('TOUT VOIR'), 'class' => 'active', 'data-id' => 0); + + foreach ($tags as $id => $name) { + $items[] = array('content' => $name, 'data-id' => $id); + } + return $this->listUnordered($items, $attrs); + } + +} diff --git a/framework/application/views/scripts/templates/expertise.phtml b/framework/application/views/scripts/templates/expertise.phtml new file mode 100644 index 0000000..5ed48f1 --- /dev/null +++ b/framework/application/views/scripts/templates/expertise.phtml @@ -0,0 +1,6 @@ +headScript()->addScriptAndStyle('expertises'); +echo $this->twocols(); +echo $this->htmlElement(nl2br($this->citation), 'blockquote', array('class' => 'citation')); +echo $this->liste($this->expertises, true, array('id' => 'expertises'), 1); diff --git a/less/casestudies.less b/less/casestudies.less index e42d7a1..a260a41 100644 --- a/less/casestudies.less +++ b/less/casestudies.less @@ -1,49 +1,16 @@ -#casestudies-tagslist { - min-width: 980px; - max-width: 980px; - margin: 0 auto; - padding: 0 0 20px 0; - - ul { - list-style: none; - } - - li { - font-size: 14px; - color: #6f6f6f; - padding: 3px 6px; - border-radius: 2px; - background-color: #ededed; - margin:0 6px 6px 0; - display: inline-block; - } - - li:hover, li:active { - cursor: pointer; - color: #fff; - background-color: #84ae1e; - } - - .active { - color: #fff; - background-color: #84ae1e; - } -} - - #casestudies-list { min-width: 980px; max-width: 980px; margin: 0 auto; padding: 0 0 50px 0; overflow: hidden; - - .bloc { + + .bloc { width:300px; float:left; } - a,a:hover { + a,a:hover { color:#000; } @@ -57,7 +24,7 @@ .bloc .project-title { font-size: 32px; } - .bloc .project-description { + .bloc .project-description { font-size: 14px; margin-bottom: 20px; } @@ -77,6 +44,6 @@ /* max-width pour faibles résolutions */ @media screen and (max-width: 1009px) { - - + + } \ No newline at end of file diff --git a/less/list.less b/less/list.less index d249074..7079648 100644 --- a/less/list.less +++ b/less/list.less @@ -29,28 +29,43 @@ section.list{ background-color: #2874ce; } + + .blocs { padding: 40px 0; overflow:hidden; - white-space:nowrap; + .spacer { clear:left; padding:25px 0; } + &.two{ + white-space:nowrap; + .sousbloc{ + white-space: normal; + width:470px; + margin:0 40px 0 0; + .text{ + width:325px; + } + } + } + .sousbloc { - white-space: normal; display:inline-block; - width:470px; - margin:0 40px 0 0; + widows: 980px; + margin:0 0 50px 0; .text { - width: 60%; - float:left; + display: inline-block; + width:835px; + vertical-align: top; } img { - float:left; - padding: 0 25px 0 0; + display: inline-block; + margin:0 25px 0 0; + vertical-align: top; } } } diff --git a/less/realisations.less b/less/realisations.less index 5124197..e84aac4 100644 --- a/less/realisations.less +++ b/less/realisations.less @@ -1,35 +1,7 @@ #realisations-tagslist { - min-width: 980px; - max-width: 980px; + width: 980px; margin: 0 auto; padding: 0 0 20px 0; - - ul { - list-style: none; - } - - li { - font-size: 14px; - color: #6f6f6f; - padding: 3px 6px; - border-radius: 2px; - background-color: #ededed; - margin:0 6px 6px 0; - display: inline-block; - } - - li:hover, li:active { - cursor: pointer; - color: #fff; - background-color: #84ae1e; - } - - .active { - color: #fff; - background-color: #84ae1e; - } - - } @@ -39,15 +11,15 @@ max-width: 980px; margin: 0 auto; padding: 0 0 50px 0; - // overflow: hidden; - - .bloc { + // overflow: hidden; + + .bloc { width:230px; //float:left; - display:inline-block; + display:inline-block; } - - a,a:hover { + + a,a:hover { color:#000; } @@ -57,30 +29,30 @@ background-color: #ccc; margin:0; } - + .bloc .gray { - filter: grayscale(100%); - -webkit-filter: grayscale(100%); - -moz-filter: grayscale(100%); - -o-filter: grayscale(100%); - -ms-filter: grayscale(100%); - filter: url("data:image/svg+xml;utf8,#grayscale"); /* Firefox 10+, Firefox on Android */ - filter: gray; /* IE6-9 */ + filter: grayscale(100%); + -webkit-filter: grayscale(100%); + -moz-filter: grayscale(100%); + -o-filter: grayscale(100%); + -ms-filter: grayscale(100%); + filter: url("data:image/svg+xml;utf8,#grayscale"); /* Firefox 10+, Firefox on Android */ + filter: gray; /* IE6-9 */ } - + .bloc { - filter: grayscale(0%); - -webkit-filter: grayscale(0%); - -moz-filter: grayscale(0%); - -o-filter: grayscale(0%); - -ms-filter: grayscale(0%); - filter: url("data:image/svg+xml;utf8,#grayscale"); + filter: grayscale(0%); + -webkit-filter: grayscale(0%); + -moz-filter: grayscale(0%); + -o-filter: grayscale(0%); + -ms-filter: grayscale(0%); + filter: url("data:image/svg+xml;utf8,#grayscale"); //filter: none; /* IE6-9 */ transition: all 500ms; } - - + + .bloc .project-title { font-size: 14px; padding: 0 0 20px 0; @@ -88,164 +60,164 @@ } .blocmargin { - margin:0 15px 15px 0; - + margin:0 15px 15px 0; + } - + .spacer { clear: left; height:20px; } - + #detail { - height:440px; - clear: both; - display:none; - margin-bottom: 15px; + height:440px; + clear: both; + display:none; + margin-bottom: 15px; width:10000px; - white-space: nowrap; - transition: all .5s; + white-space: nowrap; + transition: all .5s; } - + .showUp { height:0px !important; overflow:hidden; opacity: 0; - } - - .showDown { + } + + .showDown { height:440px !important; opacity: 1; - } - + } + #detailContent { - overflow: visible; - width: 100%; - height: auto; - + overflow: visible; + width: 100%; + height: auto; + .close { - position:absolute; - right: 0; - //top: 0; - background-image: url('../images/rea_close.jpg'); - width: 62px; - height: 62px; - cursor: pointer; - } + position:absolute; + right: 0; + //top: 0; + background-image: url('../images/rea_close.jpg'); + width: 62px; + height: 62px; + cursor: pointer; + } } - - + + #detail .detailLeft { - vertical-align: top; + vertical-align: top; display:inline-block; - width:230px; - min-width: 230px; - max-width: 230px; - padding-right:15px; + width:230px; + min-width: 230px; + max-width: 230px; + padding-right:15px; white-space: normal; - - div { - max-width: 220px; - } - - .titre { - font-size: 32px; - } - - .legende { - font-size: 14px; - color: #545454; - } - - .agence { - font-size: 14px; - color: #545454; - } - + + div { + max-width: 220px; + } + + .titre { + font-size: 32px; + } + + .legende { + font-size: 14px; + color: #545454; + } + + .agence { + font-size: 14px; + color: #545454; + } + ul { - margin-top:20px; - list-style: none; - } + margin-top:20px; + list-style: none; + } li { - font-size: 14px; - color: #6f6f6f; - padding: 3px 6px; - border-radius: 2px; - background-color: #ededed; - margin:0 6px 6px 0; - display: inline-block; - } - + font-size: 14px; + color: #6f6f6f; + padding: 3px 6px; + border-radius: 2px; + background-color: #ededed; + margin:0 6px 6px 0; + display: inline-block; + } + li:hover, li:active { - cursor:default; - color: #fff; - background-color: #84ae1e; - } - - .description { - font-size: 14px; - color: #545454; - margin-bottom: 20px; - margin-top:20px; - } - + cursor:default; + color: #fff; + background-color: #84ae1e; + } + + .description { + font-size: 14px; + color: #545454; + margin-bottom: 20px; + margin-top:20px; + } + } - + .link { - background-color: #3885e0; - border-radius: 2px; - padding: 5px 20px; - color:#fff; + background-color: #3885e0; + border-radius: 2px; + padding: 5px 20px; + color:#fff; } .link:hover { - background-color: #84ae1e; - color:#fff; + background-color: #84ae1e; + color:#fff; } - + #detail .detailRight { - display:inline-block; - vertical-align:top; - //position: absolute; - //right: 0; - - - - - .slides { - overflow: hidden; - width: 10000px; - } - - - .slides ul{ - position:relative; - list-style-type:none; - margin: 0px; - padding: 0px; - width:9999px; - } + display:inline-block; + vertical-align:top; + //position: absolute; + //right: 0; + + + + + .slides { + overflow: hidden; + width: 10000px; + } + + + .slides ul{ + position:relative; + list-style-type:none; + margin: 0px; + padding: 0px; + width:9999px; + } + + .slides li{ + padding:0px; + margin:0px; + list-style:none; + display: inline-block; + } + + + - .slides li{ - padding:0px; - margin:0px; - list-style:none; - display: inline-block; - } - - - - } - - + + } /* max-width pour faibles résolutions */ @media screen and (max-width: 1009px) { - - + + } diff --git a/less/taglist.less b/less/taglist.less new file mode 100644 index 0000000..6c5de08 --- /dev/null +++ b/less/taglist.less @@ -0,0 +1,21 @@ +ul.tags { + margin:0 0 20px; + list-style: none; + li { + font-size: 14px; + color: #6f6f6f; + padding: 3px 6px; + border-radius: 2px; + background-color: #ededed; + margin:0 6px 6px 0; + display: inline-block; + &:before{ + content:"" !important; + } + &:hover, &.active { + cursor: pointer; + color: #fff; + background-color: #84ae1e; + } + } +} \ No newline at end of file -- 2.39.5