From: bruno@cubedesigners.com Date: Fri, 24 Jan 2014 13:57:23 +0000 (+0000) Subject: (no commit message) X-Git-Url: http://git.cubedesigners.com/?a=commitdiff_plain;h=9a9ed783a97565ec9a3062d53beb22a285467baa;p=cubedesigners-v7.git --- diff --git a/framework/application/controllers/AjaxController.php b/framework/application/controllers/AjaxController.php index 7cef670..54805d4 100644 --- a/framework/application/controllers/AjaxController.php +++ b/framework/application/controllers/AjaxController.php @@ -2,7 +2,11 @@ class AjaxController extends CubeIT_Controller_AjaxController { - + public function displayCaseStudies() { + $studies = $_GET['studies']; + //fb($studies, 'displayCaseStudies'); + //$this->view->CasestudiesList($this->studies); + } } diff --git a/framework/application/forms/CMS/Sub/Casestudies/Content/Bloc.php b/framework/application/forms/CMS/Sub/Casestudies/Content/Bloc.php new file mode 100644 index 0000000..4b0087d --- /dev/null +++ b/framework/application/forms/CMS/Sub/Casestudies/Content/Bloc.php @@ -0,0 +1,32 @@ +setAttrib('data-name', 'selected-type'); + $this->addElement($select); + + $titre = new Zend_Form_Element_Text('titre'); + $titre->setLabel('Titre'); + $this->addElement($titre); + + $texte = new CubeIT_Form_Element_Markitup_Basic('texte'); + $texte->setLabel('Texte'); + $this->addElement($texte); + + $visuel = new CubeIT_Form_Element_File_Image('visuel'); + $visuel->setLabel('Visuel'); + $visuel->setMaxItems(1); + $this->addElement($visuel); + + $video = new CubeIT_Form_Element_WebVideo('video'); + $video->setLabel('URL de la vidéo'); + $this->addElement($video); + } + +} + +?> diff --git a/framework/application/forms/CMS/Sub/Casestudies/Content/Blocs.php b/framework/application/forms/CMS/Sub/Casestudies/Content/Blocs.php new file mode 100644 index 0000000..69c8243 --- /dev/null +++ b/framework/application/forms/CMS/Sub/Casestudies/Content/Blocs.php @@ -0,0 +1,17 @@ +setBaseSubForm($bloc); + //$this->setBaseLegend('Edition du contenu « $titre »'); + $this->setBaseLegend('Edition du contenu'); + $this->setNewLegend('Nouveau contenu'); + } + +} + +?> diff --git a/framework/application/forms/CMS/Sub/Casestudies/Studie.php b/framework/application/forms/CMS/Sub/Casestudies/Studie.php index 7212a38..d543739 100644 --- a/framework/application/forms/CMS/Sub/Casestudies/Studie.php +++ b/framework/application/forms/CMS/Sub/Casestudies/Studie.php @@ -18,6 +18,10 @@ class Cubedesigners_Form_CMS_Sub_Casestudies_Studie extends CubeIT_Form_SubForm $visuel->setMaxItems(1); $this->addElement($visuel); + $blocs = new Cubedesigners_Form_CMS_Sub_Casestudies_Content_Blocs('blocs'); + $blocs->setLegend('Contenu'); + $this->addSubForm($blocs, 'blocs'); + $tags = new Cubedesigners_Form_Element_Tags('tags'); $tags->setLabel('Tags'); $this->addElement($tags); diff --git a/framework/application/forms/Element/ContentType.php b/framework/application/forms/Element/ContentType.php new file mode 100644 index 0000000..5fc9c81 --- /dev/null +++ b/framework/application/forms/Element/ContentType.php @@ -0,0 +1,13 @@ +setMultiOptions(array('text' => 'Texte', 'visuel' => 'Visuel', 'video' => 'Vidéo')); + } + +} + +?> diff --git a/framework/application/views/helpers/CasestudiesList.php b/framework/application/views/helpers/CasestudiesList.php index 35025e4..4a719e0 100644 --- a/framework/application/views/helpers/CasestudiesList.php +++ b/framework/application/views/helpers/CasestudiesList.php @@ -23,7 +23,7 @@ class Cubedesigners_View_Helper_CasestudiesList extends Zend_View_Helper_Abstrac $image = $this->view->imageProcess($studie['visuel'], $studie['titre'], 300, 225); - $res .= '
'; + $res .= '
'; $res .= '
' . $image . '
'; $res .= '
' . $studie["titre"] . '
'; $res .= '
' . $studie["description"] . '
'; diff --git a/js/admin.js b/js/admin.js index e69de29..54dacd0 100644 --- a/js/admin.js +++ b/js/admin.js @@ -0,0 +1,44 @@ +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, 'text' ); + }); + + $(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(".elementwrap-titre").css("display","block"); + cible.children(".elementwrap-texte").css("display","block"); + cible.children(".elementwrap-visuel").css("display","none"); + cible.children(".elementwrap-video").css("display","none"); + break; + + case 'visuel' : + cible.children(".elementwrap-titre").css("display","none"); + cible.children(".elementwrap-texte").css("display","none"); + cible.children(".elementwrap-visuel").css("display","block"); + cible.children(".elementwrap-video").css("display","none"); + break; + + case 'video' : + cible.children(".elementwrap-titre").css("display","none"); + cible.children(".elementwrap-texte").css("display","none"); + cible.children(".elementwrap-visuel").css("display","none"); + cible.children(".elementwrap-video").css("display","block"); + break; + } + +} \ No newline at end of file diff --git a/js/casestudies.js b/js/casestudies.js index 2bce166..1d47c9a 100644 --- a/js/casestudies.js +++ b/js/casestudies.js @@ -27,7 +27,7 @@ function initTagsLink() { } displayStudies(); - alert(showIds); + //alert(showIds); }); } @@ -38,11 +38,23 @@ function displayStudies() { //$(".tag:first").toggleClass('active'); } - $.ajax({ - url : '/ajax/displaystudies', - dataType : 'text', - //data : JSON.stringify(showIds) - }); + /*$.ajax({ + url : '/ajax/displaycasestudies', + type : 'GET', + data: 'studies=' + showIds, + success: function(){ + + } + });*/ + + $('#casestudies-list .bloc').each(function(){ + //alert($(this).attr("data-tags")); + + var tags = $(this).attr("data-tags").split(','); + //fb(tags, "Tags a afficher"); + + + }); } diff --git a/less/casestudies.less b/less/casestudies.less index f9da4c9..689846e 100644 --- a/less/casestudies.less +++ b/less/casestudies.less @@ -12,7 +12,7 @@ #casestudies-tagslist li { font-size: 14px; color: #6f6f6f; - padding: 3px; + padding: 3px 6px; border-radius: 2px; background-color: #ededed; margin:0 6px 6px 0;