From a180557d33a362601d7c108bac09091b0dee74ab Mon Sep 17 00:00:00 2001 From: Vincent Vanwaelscappel Date: Tue, 14 Jan 2025 13:56:34 +0100 Subject: [PATCH] wait #7258 @2 --- framework/application/Bootstrap.php | 1 + .../application/forms/CMS/Casestudies.php | 6 +- .../forms/CMS/Sub/CaseStudiesList.php | 8 +-- .../CMS/Sub/Casestudies/Content/Bloc.php | 12 ++-- .../CMS/Sub/Casestudies/Content/Blocs.php | 4 +- .../CMS/Sub/Casestudies/MultiCheckboxList.php | 2 +- .../forms/CMS/Sub/Casestudies/Studies.php | 58 +++++++++---------- .../CMS/Sub/Realisations/Realisations.php | 2 +- framework/application/forms/Settings.php | 5 -- .../views/helpers/CategoriesDropdown.php | 25 -------- .../views/scripts/templates/casestudies.phtml | 10 +--- js/casestudies.js | 9 +-- less/casestudies.less | 17 ------ 13 files changed, 51 insertions(+), 108 deletions(-) diff --git a/framework/application/Bootstrap.php b/framework/application/Bootstrap.php index 849b21b..87c42a7 100644 --- a/framework/application/Bootstrap.php +++ b/framework/application/Bootstrap.php @@ -132,6 +132,7 @@ class Bootstrap extends CubeIT_Bootstrap $templates['realisations'] = 'Réalisations'; $templates['Etudes de cas'] = array('casestudies' => 'Accueil des études de cas', 'casestudies_detail' => 'Détail d\'étude de cas'); $templates['services'] = 'Services'; + $templates['recommendation'] = 'Recommendation'; $templates['news'] = 'News'; $templates['contact'] = 'Contact'; diff --git a/framework/application/forms/CMS/Casestudies.php b/framework/application/forms/CMS/Casestudies.php index 83387bf..9654eaf 100644 --- a/framework/application/forms/CMS/Casestudies.php +++ b/framework/application/forms/CMS/Casestudies.php @@ -6,15 +6,15 @@ class Cubedesigners_Form_CMS_Casestudies extends Cubedesigners_Form_CMS { parent::init(); $titre = new CubeIT_Form_Element_Markitup('titre'); - $titre->setLabel('Titre'); + $titre->setLabel('Introduction'); $this->addElement($titre); $stuurl = new CubeIT_Form_Element_Url('seourl_stu'); - $stuurl->setLabel("Modèle d'URL des études de cas"); + $stuurl->setLabel("Work URL template"); $this->addElement($stuurl); $studies = new Cubedesigners_Form_CMS_Element_Casestudies('studies'); - $studies->setLabel('Gestion des études de cas'); + $studies->setLabel('Manage works'); $this->addElement($studies); } diff --git a/framework/application/forms/CMS/Sub/CaseStudiesList.php b/framework/application/forms/CMS/Sub/CaseStudiesList.php index 6cd87e0..d17bf1b 100644 --- a/framework/application/forms/CMS/Sub/CaseStudiesList.php +++ b/framework/application/forms/CMS/Sub/CaseStudiesList.php @@ -6,20 +6,20 @@ class Cubedesigners_Form_CMS_Sub_CaseStudiesList extends CubeIT_Form_SubForm { parent::init(); $titre = new Zend_Form_Element_Text('titre'); - $titre->setLabel('Titre'); + $titre->setLabel('Titrle'); $this->addElementLocalized($titre); $soustitre = new Zend_Form_Element_Text('soustitre'); - $soustitre->setLabel('Sous-titre'); + $soustitre->setLabel('Subtitle'); $this->addElementLocalized($soustitre); $lines = new CubeIT_Form_Element_Int('lines'); - $lines->setLabel('Nombre de lignes à afficher'); + $lines->setLabel('Number of lines to show'); $lines->setValue(2); $this->addElement($lines); $propulse = new Cubedesigners_Form_CMS_Sub_Casestudies_MultiCheckboxList('propulse'); - $propulse->setLabel('Propulser les case studies'); + $propulse->setLabel('Promote work'); $this->addElement($propulse); } diff --git a/framework/application/forms/CMS/Sub/Casestudies/Content/Bloc.php b/framework/application/forms/CMS/Sub/Casestudies/Content/Bloc.php index 96cfb12..7307b72 100644 --- a/framework/application/forms/CMS/Sub/Casestudies/Content/Bloc.php +++ b/framework/application/forms/CMS/Sub/Casestudies/Content/Bloc.php @@ -5,7 +5,7 @@ class Cubedesigners_Form_CMS_Sub_Casestudies_Content_Bloc extends CubeIT_Form_Su public function init() { parent::init(); - $isCompactTrad = false; + $isCompactTrad = true; $select = new Cubedesigners_Form_Element_ContentType("selected-type"); $select->setAttrib('data-name', 'selected-type'); @@ -37,15 +37,15 @@ class Cubedesigners_Form_CMS_Sub_Casestudies_Content_Bloc extends CubeIT_Form_Su // $this->addElement($annee); $titre = new Zend_Form_Element_Text('titre'); - $titre->setLabel('Titre'); + $titre->setLabel('Title'); $this->addElementLocalized($titre, $isCompactTrad); $texte = new CubeIT_Form_Element_Markitup_Basic('texte'); - $texte->setLabel('Texte'); + $texte->setLabel('Text'); $this->addElementLocalized($texte, $isCompactTrad); $visuel = new CubeIT_Form_Element_File_Image('visuel'); - $visuel->setLabel('Visuel'); + $visuel->setLabel('Picture'); $visuel->setMaxItems(1); $this->addElementLocalized($visuel, $isCompactTrad); @@ -55,11 +55,11 @@ class Cubedesigners_Form_CMS_Sub_Casestudies_Content_Bloc extends CubeIT_Form_Su // $this->addElement($visuelpadding); $video = new CubeIT_Form_Element_WebVideo('video'); - $video->setLabel('URL de la vidéo'); + $video->setLabel('Video URL'); $this->addElementLocalized($video, $isCompactTrad); $video_background = new CubeIT_Form_Element_File_Image('video_background'); - $video_background->setLabel('Fond de la vidéo'); + $video_background->setLabel('Video background'); $video_background->setMaxItems(1); $this->addElement($video_background); diff --git a/framework/application/forms/CMS/Sub/Casestudies/Content/Blocs.php b/framework/application/forms/CMS/Sub/Casestudies/Content/Blocs.php index eb1e01e..6c7a03b 100644 --- a/framework/application/forms/CMS/Sub/Casestudies/Content/Blocs.php +++ b/framework/application/forms/CMS/Sub/Casestudies/Content/Blocs.php @@ -7,8 +7,8 @@ class Cubedesigners_Form_CMS_Sub_Casestudies_Content_Blocs extends CubeIT_Form_M $bloc = new Cubedesigners_Form_CMS_Sub_Casestudies_Content_Bloc(); $this->setBaseSubForm($bloc); - $this->setBaseLegend('Edition du contenu'); - $this->setNewLegend('Nouveau contenu'); + $this->setBaseLegend('Edit content'); + $this->setNewLegend('New content'); } } diff --git a/framework/application/forms/CMS/Sub/Casestudies/MultiCheckboxList.php b/framework/application/forms/CMS/Sub/Casestudies/MultiCheckboxList.php index d57c1a6..9daf91c 100644 --- a/framework/application/forms/CMS/Sub/Casestudies/MultiCheckboxList.php +++ b/framework/application/forms/CMS/Sub/Casestudies/MultiCheckboxList.php @@ -9,7 +9,7 @@ class Cubedesigners_Form_CMS_Sub_Casestudies_MultiCheckboxList extends CubeIT_Fo $options = array(); foreach ($studies as $s) { $t = $s->getTitre(); - $options[$s->getId()] = $t['fr']; + $options[$s->getId()] = $t['en']; } $this->setMultiOptions($options); } diff --git a/framework/application/forms/CMS/Sub/Casestudies/Studies.php b/framework/application/forms/CMS/Sub/Casestudies/Studies.php index dff148a..1daa039 100644 --- a/framework/application/forms/CMS/Sub/Casestudies/Studies.php +++ b/framework/application/forms/CMS/Sub/Casestudies/Studies.php @@ -5,22 +5,22 @@ class Cubedesigners_Form_CMS_Sub_Casestudies_Studies extends CubeIT_Form_List_Mo public function init() { parent::init(); - $isCompactTrad = false; + $isCompactTrad = true; $id = new CubeIT_Form_Element_Id(); $this->addElement($id); $online = new Zend_Form_Element_Checkbox('online'); - $online->setLabel('En ligne'); + $online->setLabel('Online'); $this->addElement($online); $annee = new CubeIT_Form_Element_Date('annee'); $annee->setPrecision(Zend_Date::DAY); - $annee->setLabel('Année'); + $annee->setLabel('Year'); $this->addElement($annee); $titre = new Zend_Form_Element_Text('titre'); - $titre->setLabel('Titre'); + $titre->setLabel('Title'); $this->addElementLocalized($titre, $isCompactTrad); $description = new Zend_Form_Element_Text('description'); @@ -28,11 +28,11 @@ class Cubedesigners_Form_CMS_Sub_Casestudies_Studies extends CubeIT_Form_List_Mo $this->addElementLocalized($description, $isCompactTrad); $url = new CubeIT_Form_Element_Url('url'); - $url->setLabel('URL du site'); + $url->setLabel('Website URL'); $this->addElementLocalized($url, $isCompactTrad, true); $visuel = new CubeIT_Form_Element_File_Image('visuel'); - $visuel->setLabel('Visuel de la page Case Studies'); + $visuel->setLabel('Thumbnails for portfolio page'); $visuel->setMaxItems(1); $this->addElementLocalized($visuel, $isCompactTrad, true); @@ -41,12 +41,12 @@ class Cubedesigners_Form_CMS_Sub_Casestudies_Studies extends CubeIT_Form_List_Mo $this->addElement($hover_color); $visuel_detail = new CubeIT_Form_Element_File_Image('visuel_detail'); - $visuel_detail->setLabel('Visuel de la page de détail'); + $visuel_detail->setLabel('Main picture'); $visuel_detail->setMaxItems(1); $this->addElementLocalized($visuel_detail, $isCompactTrad, true); $legende = new Zend_Form_Element_Text('legende'); - $legende->setLabel('Legende du visuel'); + $legende->setLabel('Picture legend'); $this->addElementLocalized($legende, $isCompactTrad); $header_style = new Zend_Form_Element_Select('header_style'); @@ -55,39 +55,39 @@ class Cubedesigners_Form_CMS_Sub_Casestudies_Studies extends CubeIT_Form_List_Mo $this->addElement($header_style); $color = new CubeIT_Form_Element_Color('couleur'); - $color->setLabel('Code couleur de la zone de contenu'); + $color->setLabel('Color of contents area'); $this->addElement($color); $blocs = new Cubedesigners_Form_CMS_Sub_Casestudies_Content_Blocs('blocs'); - $blocs->setLegend('Contenu'); + $blocs->setLegend('Contents'); $this->addSubForm($blocs, 'blocs'); - $categories = new Cubedesigners_Form_Element_CategoriesCheckboxes('categories'); - $categories->setLabel('Catégories'); - $this->addElement($categories); - - $tags = new Cubedesigners_Form_Element_Tags('tags_secondaires'); - $tags->setLabel('Tags secondaires'); - $this->addElement($tags); - - $domaine = new Cubedesigners_Form_Element_Domaines('domaines'); - $domaine->setLabel("Domaine d'activité"); - $this->addElement($domaine); - - $technologies = new Cubedesigners_Form_Element_Technologies('technologies'); - $technologies->setLabel('Technologies'); - $this->addElement($technologies); +// $categories = new Cubedesigners_Form_Element_CategoriesCheckboxes('categories'); +// $categories->setLabel('Catégories'); +// $this->addElement($categories); +// +// $tags = new Cubedesigners_Form_Element_Tags('tags_secondaires'); +// $tags->setLabel('Tags secondaires'); +// $this->addElement($tags); +// +// $domaine = new Cubedesigners_Form_Element_Domaines('domaines'); +// $domaine->setLabel("Domaine d'activité"); +// $this->addElement($domaine); +// +// $technologies = new Cubedesigners_Form_Element_Technologies('technologies'); +// $technologies->setLabel('Technologies'); +// $this->addElement($technologies); $casesStudies = new Cubedesigners_Form_CMS_Sub_CaseStudiesList(); - $casesStudies->setLegend('Liens vers case studies connexes'); + $casesStudies->setLegend('Link to related work'); $this->addSubForm($casesStudies, 'connexe'); $bootstrap = Bootstrap::getInstance(); $view = $bootstrap->getView(); - $this->setListTitle('Etudes de cas'); - $this->setNewTitle('Créer une étude de cas'); - $this->setEditTitle('Edition de l\'étude de cas « $titre »'); + $this->setListTitle('Works'); + $this->setNewTitle('Create a new work'); + $this->setEditTitle('Edit work « $titre »'); $this->setModel('Cubedesigners_Model_Casestudy'); $this->setTitleColumn('titre'); } diff --git a/framework/application/forms/CMS/Sub/Realisations/Realisations.php b/framework/application/forms/CMS/Sub/Realisations/Realisations.php index f96ad8d..5352cc6 100644 --- a/framework/application/forms/CMS/Sub/Realisations/Realisations.php +++ b/framework/application/forms/CMS/Sub/Realisations/Realisations.php @@ -5,7 +5,7 @@ class Cubedesigners_Form_CMS_Sub_Realisations_Realisations extends CubeIT_Form_L public function init() { parent::init(); - $isCompactTrad = false; + $isCompactTrad = true; $id = new CubeIT_Form_Element_Id(); $this->addElement($id); diff --git a/framework/application/forms/Settings.php b/framework/application/forms/Settings.php index bb86335..c793530 100644 --- a/framework/application/forms/Settings.php +++ b/framework/application/forms/Settings.php @@ -49,11 +49,6 @@ class Cubedesigners_Form_Settings extends CubeIT_Form_Settings { $privacy = new CubeIT_Form_Element_Markitup('privacy_text'); $privacy->setLabel(__('Mention vie privée')); $this->addElement($privacy); - - $tags = new Cubedesigners_Form_Element_Tags('tags'); - $tags->setLabel(__('Tags')); - $this->addElement($tags); - } } diff --git a/framework/application/views/helpers/CategoriesDropdown.php b/framework/application/views/helpers/CategoriesDropdown.php index 5e5585a..1eb0d90 100644 --- a/framework/application/views/helpers/CategoriesDropdown.php +++ b/framework/application/views/helpers/CategoriesDropdown.php @@ -2,40 +2,15 @@ class Cubedesigners_View_Helper_CategoriesDropdown extends CubeIT_View_Helper_Abstract { - /* - * TODO: Refactor this to match new functionality of multiple categories per table? See CategoriesFilter.php. Also check that this isn't used elsewhere... - */ - public function CategoriesDropdown($table, $listID, $columnWidth = '170', $gutterSize = '32') { $this->headScript()->addIsotope(); $this->addScriptAndStyle('isotope-select'); - $is_admin = Bootstrap::getInstance()->isAllowed("edition"); - $db = Zend_Db_Table::getDefaultAdapter(); - - // Get distinct list of categories present in the table - $select = $db->select() - ->from($table, [$table.'.categories']) - ->joinInner('categories', $table.'.categories = categories.id', ['categories.name']) - ->group($table.'.categories') - ->order('categories.sort_order ASC'); - - if (!$is_admin) { - $select->where($table.'.online = ?', 1); - } - - //echo 'QUERY: '. (string) $select; - - $query = $select->query(); - $categories = [ '' => __('Choisir un domaine...'), '0' => __('Tout voir') ]; - while ($row = $query->fetch()) { - $categories[$row->categories] = CubeIT_Util_Cms::unserialize($row->name); - } return $this->formSelect( $listID . '-filter', // Select element's name diff --git a/framework/application/views/scripts/templates/casestudies.phtml b/framework/application/views/scripts/templates/casestudies.phtml index 53b9fe2..973bd56 100644 --- a/framework/application/views/scripts/templates/casestudies.phtml +++ b/framework/application/views/scripts/templates/casestudies.phtml @@ -1,13 +1,14 @@ headScript()->addScriptAndStyle('selectric'); $this->headScript()->addScriptAndStyle('casestudies'); +$this->headScript()->addIsotope(); +$this->headScript()->addScriptAndStyle('isotope-select'); ?>
markupDotclear($this->titre); ?>
-
+
CategoriesFilter('casestudies', 'casestudies-list', 460, 96); ?>
@@ -17,9 +18,4 @@ $this->headScript()->addScriptAndStyle('casestudies'); echo $this->CasestudiesList($datas); ?>
- - -
diff --git a/js/casestudies.js b/js/casestudies.js index 4d0e45a..7092fc0 100644 --- a/js/casestudies.js +++ b/js/casestudies.js @@ -1,12 +1,5 @@ TO_LOAD_ONCE[TO_LOAD_ONCE.length] = 'load_casestudies();'; function load_casestudies() { - $('#casestudies-list-filter').selectric({ - maxHeight: 450, - arrowButtonMarkup: '', // Disable dropdown element since we are using an SVG in the background - disableOnMobile: true, - onChange: function (element) { - $(element).change(); // Trigger change on select box so isotope will update (see isotope-select.js) - }, - }); + } diff --git a/less/casestudies.less b/less/casestudies.less index 2dfc078..0fd8fc1 100644 --- a/less/casestudies.less +++ b/less/casestudies.less @@ -1,22 +1,5 @@ @import "00-constants"; -.casestudies-filter { - margin-bottom: 2em; - text-align: right; - font-size: 20px; - - .selectric-items { - width: auto !important; - } - - select { - // The select box normally isn't visible but it is triggered - // and on iOS, if the font size is too small (below 16px after - // display scaling), the page will be zoomed when the select is focused - // Related: https://stackoverflow.com/questions/2989263/disable-auto-zoom-in-input-text-tag-safari-on-iphone - font-size: 32px; - } -} .casestudies-list { //min-width: 980px; -- 2.39.5