From 145efc29e4199d427e9ee5533dbca94098ac88c4 Mon Sep 17 00:00:00 2001 From: "vincent@cubedesigners.com" Date: Tue, 20 Jan 2015 19:13:44 +0000 Subject: [PATCH] Improve rendering of text templates Improve export of translations in Excel --- .../forms/CMS/Sub/Agence/Persons.php | 20 +- .../forms/CMS/Sub/Agence/Persons/Bloc.php | 36 ++- .../forms/CMS/Sub/Agence/Persons/Blocs.php | 15 +- .../forms/CMS/Sub/CaseStudiesList.php | 2 +- .../CMS/Sub/Casestudies/Content/Bloc.php | 4 +- .../CMS/Sub/Casestudies/Content/Blocs.php | 19 +- .../forms/CMS/Sub/Casestudies/Studies.php | 6 +- .../views/scripts/templates/text.phtml | 1 + less/header.less | 287 +++++++++--------- less/text.less | 15 + less/twocols.less | 76 ++--- 11 files changed, 243 insertions(+), 238 deletions(-) create mode 100644 less/text.less diff --git a/framework/application/forms/CMS/Sub/Agence/Persons.php b/framework/application/forms/CMS/Sub/Agence/Persons.php index 8fd47fb..1820195 100644 --- a/framework/application/forms/CMS/Sub/Agence/Persons.php +++ b/framework/application/forms/CMS/Sub/Agence/Persons.php @@ -2,18 +2,16 @@ class Cubedesigners_Form_CMS_Sub_Agence_Persons extends CubeIT_Form_SubForm { - public function init() { - parent::init(); + public function init() { + parent::init(); - $titre = new Zend_Form_Element_Text('titre'); - $titre->setLabel('Titre'); - $this->addElement($titre); + $titre = new Zend_Form_Element_Text('titre'); + $titre->setLabel('Titre'); + $this->addElement($titre); - $blocs = new Cubedesigners_Form_CMS_Sub_Agence_Persons_Blocs('blocs'); - $blocs->setLegend('Personnes'); - $this->addSubForm($blocs, 'blocs'); - } + $blocs = new Cubedesigners_Form_CMS_Sub_Agence_Persons_Blocs('blocs'); + $blocs->setLegend('Personnes'); + $this->addSubForm($blocs, 'blocs'); + } } - -?> diff --git a/framework/application/forms/CMS/Sub/Agence/Persons/Bloc.php b/framework/application/forms/CMS/Sub/Agence/Persons/Bloc.php index e1cba8a..736d052 100644 --- a/framework/application/forms/CMS/Sub/Agence/Persons/Bloc.php +++ b/framework/application/forms/CMS/Sub/Agence/Persons/Bloc.php @@ -2,27 +2,25 @@ class Cubedesigners_Form_CMS_Sub_Agence_Persons_Bloc extends CubeIT_Form_SubForm { - public function init() { - parent::init(); + public function init() { + parent::init(); - $titre = new Zend_Form_Element_Text('titre'); - $titre->setLabel('Prénom et nom'); - $this->addElement($titre); + $titre = new Zend_Form_Element_Text('titre'); + $titre->setLabel('Prénom et nom'); + $this->addElement($titre); - $poste = new Zend_Form_Element_Text('poste'); - $poste->setLabel('Poste'); - $this->addElement($poste); + $poste = new Zend_Form_Element_Text('poste'); + $poste->setLabel('Poste'); + $this->addElement($poste); - $texte = new CubeIT_Form_Element_Markitup_Basic('texte'); - $texte->setLabel('Texte'); - $this->addElement($texte); + $texte = new CubeIT_Form_Element_Markitup_Basic('texte'); + $texte->setLabel('Texte'); + $this->addElement($texte); - $photo = new CubeIT_Form_Element_File_Image('photo'); - $photo->setLabel('Photo'); - $photo->setMaxItems(1); - $this->addElement($photo); - } + $photo = new CubeIT_Form_Element_File_Image('photo'); + $photo->setLabel('Photo'); + $photo->setMaxItems(1); + $this->addElement($photo); + } -} - -?> +} \ No newline at end of file diff --git a/framework/application/forms/CMS/Sub/Agence/Persons/Blocs.php b/framework/application/forms/CMS/Sub/Agence/Persons/Blocs.php index 0c6fe36..f2878b7 100644 --- a/framework/application/forms/CMS/Sub/Agence/Persons/Blocs.php +++ b/framework/application/forms/CMS/Sub/Agence/Persons/Blocs.php @@ -2,15 +2,14 @@ class Cubedesigners_Form_CMS_Sub_Agence_Persons_Blocs extends CubeIT_Form_Multi_SubForm { - public function init() { - parent::init(); + public function init() { + parent::init(); - $bloc = new Cubedesigners_Form_CMS_Sub_Agence_Persons_Bloc(); - $this->setBaseSubForm($bloc); - $this->setBaseLegend('Edition de « $titre »'); - $this->setNewLegend('Nouvelle personne'); - } + $bloc = new Cubedesigners_Form_CMS_Sub_Agence_Persons_Bloc(); + $this->setBaseSubForm($bloc); + $this->setBaseLegend('Edition de « $titre »'); + $this->setNewLegend('Nouvelle personne'); + } } -?> diff --git a/framework/application/forms/CMS/Sub/CaseStudiesList.php b/framework/application/forms/CMS/Sub/CaseStudiesList.php index 268dae4..6cd87e0 100644 --- a/framework/application/forms/CMS/Sub/CaseStudiesList.php +++ b/framework/application/forms/CMS/Sub/CaseStudiesList.php @@ -13,7 +13,7 @@ class Cubedesigners_Form_CMS_Sub_CaseStudiesList extends CubeIT_Form_SubForm { $soustitre->setLabel('Sous-titre'); $this->addElementLocalized($soustitre); - $lines = new Zend_Form_Element_Text('lines'); + $lines = new CubeIT_Form_Element_Int('lines'); $lines->setLabel('Nombre de lignes à afficher'); $lines->setValue(2); $this->addElement($lines); diff --git a/framework/application/forms/CMS/Sub/Casestudies/Content/Bloc.php b/framework/application/forms/CMS/Sub/Casestudies/Content/Bloc.php index 2807cf4..7e6ca7f 100644 --- a/framework/application/forms/CMS/Sub/Casestudies/Content/Bloc.php +++ b/framework/application/forms/CMS/Sub/Casestudies/Content/Bloc.php @@ -11,7 +11,7 @@ class Cubedesigners_Form_CMS_Sub_Casestudies_Content_Bloc extends CubeIT_Form_Su $select->setAttrib('data-name', 'selected-type'); $this->addElement($select); - $margin = new Zend_Form_Element_Text('margin'); + $margin = new CubeIT_Form_Element_Int('margin'); $margin->setLabel("Décalage vertical du bloc (en pixels)"); $this->addElement($margin); @@ -41,7 +41,7 @@ class Cubedesigners_Form_CMS_Sub_Casestudies_Content_Bloc extends CubeIT_Form_Su $visuel->setMaxItems(1); $this->addElementLocalized($visuel, $isCompactTrad); - $visuelpadding = new Zend_Form_Element_Text('visuelpadding'); + $visuelpadding = new CubeIT_Form_Element_Int('visuelpadding'); $visuelpadding->setLabel('Margin intérieur sous le visuel'); $visuelpadding->setValue(50); $this->addElement($visuelpadding); diff --git a/framework/application/forms/CMS/Sub/Casestudies/Content/Blocs.php b/framework/application/forms/CMS/Sub/Casestudies/Content/Blocs.php index 69c8243..9812c7c 100644 --- a/framework/application/forms/CMS/Sub/Casestudies/Content/Blocs.php +++ b/framework/application/forms/CMS/Sub/Casestudies/Content/Blocs.php @@ -2,16 +2,13 @@ class Cubedesigners_Form_CMS_Sub_Casestudies_Content_Blocs extends CubeIT_Form_Multi_SubForm { - public function init() { - parent::init(); + public function init() { + parent::init(); - $bloc = new Cubedesigners_Form_CMS_Sub_Casestudies_Content_Bloc(); - $this->setBaseSubForm($bloc); - //$this->setBaseLegend('Edition du contenu « $titre »'); - $this->setBaseLegend('Edition du contenu'); - $this->setNewLegend('Nouveau contenu'); - } + $bloc = new Cubedesigners_Form_CMS_Sub_Casestudies_Content_Bloc(); + $this->setBaseSubForm($bloc); + $this->setBaseLegend('Edition du contenu'); + $this->setNewLegend('Nouveau contenu'); + } -} - -?> +} \ No newline at end of file diff --git a/framework/application/forms/CMS/Sub/Casestudies/Studies.php b/framework/application/forms/CMS/Sub/Casestudies/Studies.php index cf5c552..9d0f5d8 100644 --- a/framework/application/forms/CMS/Sub/Casestudies/Studies.php +++ b/framework/application/forms/CMS/Sub/Casestudies/Studies.php @@ -14,10 +14,6 @@ class Cubedesigners_Form_CMS_Sub_Casestudies_Studies extends CubeIT_Form_List_Mo $online->setLabel('En ligne'); $this->addElement($online); - $propulse = new Zend_Form_Element_Checkbox('propulse'); - $propulse->setLabel('Propulsée'); - $this->addElement($propulse); - $annee = new CubeIT_Form_Element_Date('annee'); $annee->setPrecision(Zend_Date::DAY); $annee->setLabel('Année'); @@ -49,7 +45,7 @@ class Cubedesigners_Form_CMS_Sub_Casestudies_Studies extends CubeIT_Form_List_Mo $legende->setLabel('Legende du visuel'); $this->addElementLocalized($legende, $isCompactTrad); - $color = new Zend_Form_Element_Text('couleur'); + $color = new CubeIT_Form_Element_Color('couleur'); $color->setLabel('Code couleur de la zone de contenu'); $this->addElement($color); diff --git a/framework/application/views/scripts/templates/text.phtml b/framework/application/views/scripts/templates/text.phtml index 98d08cf..64878e5 100644 --- a/framework/application/views/scripts/templates/text.phtml +++ b/framework/application/views/scripts/templates/text.phtml @@ -1,3 +1,4 @@ twocols(); +$this->headScript()->addScriptAndStyle('text'); diff --git a/less/header.less b/less/header.less index 252ff4c..8b0fc57 100644 --- a/less/header.less +++ b/less/header.less @@ -1,46 +1,46 @@ #header { - height:130px; + height: 130px; - ul{ + ul { text-transform: uppercase; - font-size:15px; - color:#3885e0; + font-size: 15px; + color: #3885e0; list-style: none; - li{ - float:left; + li { + float: left; - a{ - color:#282828; + a { + color: #282828; padding: 10px; - &:hover{ + &:hover { border-radius: 2px; background-color: #84ae1e; - color:#fff !important; + color: #fff !important; } } - &.active a{ - color:#3885e0; + &.active a { + color: #3885e0; } } - } + } .logo { - width:318px; - height:132px; - position:absolute; + width: 318px; + height: 132px; + position: absolute; top: 0; left: 0; - &:hover{ - .svg{ - cursor:pointer; - svg{ - #Background{ - fill:#ff0000 !important; + &:hover { + .svg { + cursor: pointer; + svg { + #Background { + fill: #ff0000 !important; } } } @@ -48,17 +48,17 @@ } .sublogo { - display:none; + display: none; } - .navigation{ + .navigation { margin: 50px 0; - float:right; + float: right; } - .navigation li{ - margin:0 20px 0 0; - &:last-child{ + .navigation li { + margin: 0 20px 0 0; + &:last-child { margin-right: 0; } } @@ -67,12 +67,10 @@ //////////////////////// // @TODO tidy this up... and remove old .menu-link classes - .nav-icon { - display: none; + display: none; } - /////// //a.menu-link { @@ -84,121 +82,124 @@ //} .js nav[role=navigation] { - max-height: none; + max-height: none; } @media screen and (max-width: 890px) { - // Nav-icon from: http://w3bits.com/animated-menu-icon-css/ - .nav-icon { - //margin: 1em; - width: 34px; - position: absolute; - top: 3px; - right: 0; - padding: 2em 34px; // 34px is to push it away from the right margin and keep aligned with right edge - box-sizing: content-box; - display: inline-block; - - &:hover { - cursor: pointer; - } - } - - .nav-icon:after, - .nav-icon:before, - .nav-icon div { - background-color: #3885e0; - border-radius: 3px; - content: ''; - display: block; - height: 4px; - margin: 6px 0; - transition: all .3s ease-in-out; - } - - .nav-icon.active:after, - .nav-icon.active:before, - .nav-icon.active div { - background-color: #fff; - } - .nav-icon.active { - opacity: 0.7; - } - - - // Nav icon animation - .nav-icon.active:before { - transform: translateY(10px) rotate(135deg); - } - - .nav-icon.active:after { - transform: translateY(-10px) rotate(-135deg); - } - - .nav-icon.active div { - transform: scale(0); - transition: all .15s ease-in-out; - } - - - -//////// - - #header.content { - padding: 0; - } - - #header { - height: auto; - min-height: 130px; - } - - nav[role=navigation] { - background-color: #202020; - //margin: 0 -20px; // To offset the 20px margin from .content - } - -// a.menu-link { -// position: absolute; -// top: 0; -// right: 0; -// padding: 0.5em 34px 0.5em 0.5em; // 34px is to push it away from the right margin and keep aligned with right edge -//// background: #3885e0; -//// border-radius: 2px; -// font: bold 36px sans-serif; -// color: #3885e0; -// text-transform: uppercase; -// display: inline-block; -// } - nav[role=navigation] { - clear: both; - transition: all 0.3s ease-out; - } - .js nav[role=navigation] { - overflow: hidden; - max-height: 0; - } - nav[role=navigation].active { - max-height: 16em; - padding: 135px 0 20px 0; - box-sizing: content-box; - } - #header .navigation { - margin: 0; - padding: 0; - float: none; - text-align: center; - - li { - float: none; - margin: 0; - } - - a { - color: #fff !important; - display: block; - } - } + // Nav-icon from: http://w3bits.com/animated-menu-icon-css/ + .nav-icon { + //margin: 1em; + width: 34px; + position: absolute; + top: 3px; + right: 0; + padding: 2em 34px; // 34px is to push it away from the right margin and keep aligned with right edge + box-sizing: content-box; + display: inline-block; + + &:hover { + cursor: pointer; + } + } + + .nav-icon:after, + .nav-icon:before, + .nav-icon div { + background-color: #3885e0; + border-radius: 3px; + content: ''; + display: block; + height: 4px; + margin: 6px 0; + transition: all .3s ease-in-out; + } + + .nav-icon.active:after, + .nav-icon.active:before, + .nav-icon.active div { + background-color: #fff; + } + + .nav-icon.active { + opacity: 0.7; + } + + // Nav icon animation + .nav-icon.active:before { + transform: translateY(10px) rotate(135deg); + } + + .nav-icon.active:after { + transform: translateY(-10px) rotate(-135deg); + } + + .nav-icon.active div { + transform: scale(0); + transition: all .15s ease-in-out; + } + + //////// + #header.content { + padding: 0; + } + + #header { + height: auto; + min-height: 130px; + } + + nav[role=navigation] { + background-color: #202020; + //margin: 0 -20px; // To offset the 20px margin from .content + } + + // a.menu-link { + // position: absolute; + // top: 0; + // right: 0; + // padding: 0.5em 34px 0.5em 0.5em; // 34px is to push it away from the right margin and keep aligned with right edge + //// background: #3885e0; + //// border-radius: 2px; + // font: bold 36px sans-serif; + // color: #3885e0; + // text-transform: uppercase; + // display: inline-block; + // } + nav[role=navigation] { + clear: both; + transition: all 0.3s ease-out; + } + + .js nav[role=navigation] { + overflow: hidden; + max-height: 0; + } + + nav[role=navigation].active { + max-height: 16em; + padding: 135px 0 20px 0; + box-sizing: content-box; + } + + #header .navigation { + margin: 0; + padding: 0; + float: none; + text-align: center; + + li { + float: none; + margin: 0; + } + + a { + color: #fff !important; + display: block; + &:hover { + border-radius: 0; + } + } + } } diff --git a/less/text.less b/less/text.less new file mode 100644 index 0000000..861a8d6 --- /dev/null +++ b/less/text.less @@ -0,0 +1,15 @@ +.twocols .dotclear { + + p { + margin: 20px 0 20px 0; + } + + ul { + margin: 10px 0 20px 0; + } + + h2 { + margin-top: 40px; + } + +} \ No newline at end of file diff --git a/less/twocols.less b/less/twocols.less index 28d9f9a..5e97774 100644 --- a/less/twocols.less +++ b/less/twocols.less @@ -1,54 +1,54 @@ -.twocols{ - - max-width: 980px; - margin: 0 auto; - - .dotclear{ - p{ - margin:30px 0 30px 0; - } - - ul{ - margin:15px 0 30px 0; - list-style: none; - li{ - &:before{ - content:"- "; - } - } - } - } +.twocols { + + max-width: 980px; + margin: 0 auto; + + .dotclear { + p { + margin: 30px 0 30px 0; + } + + ul { + margin: 15px 0 30px 0; + list-style: none; + li { + &:before { + content: "- "; + } + } + } + } .cols { - padding-bottom: 50px; - white-space:nowrap; + padding-bottom: 50px; + white-space: nowrap; .col { white-space: normal; - display:inline-block; + display: inline-block; width: 50%; padding-right: 20px; vertical-align: top; - - &:last-child{ - padding-right:0; - padding-left: 20px; + + &:last-child { + padding-right: 0; + padding-left: 20px; } } - @media screen and (max-width: 790px) { + @media screen and (max-width: 790px) { - padding-bottom: 10px; + padding-bottom: 10px; - .col { - width: 100%; - padding: 0; - display: block; + .col { + width: 100%; + padding: 0; + display: block; - &:last-child { - padding: 0; - } - } - } + &:last-child { + padding: 0; + } + } + } } } \ No newline at end of file -- 2.39.5