From: stephen@cubedesigners.com Date: Thu, 7 Feb 2019 16:35:31 +0000 (+0000) Subject: WIP #2033 @3 X-Git-Url: http://git.cubedesigners.com/?a=commitdiff_plain;h=f6ac37971046028a43075cda450da8e58a4f75c0;p=cubedesigners-v7.git WIP #2033 @3 --- diff --git a/framework/application/forms/CMS/Sub/Casestudies/Content/Bloc.php b/framework/application/forms/CMS/Sub/Casestudies/Content/Bloc.php index 7e6ca7f..9475469 100644 --- a/framework/application/forms/CMS/Sub/Casestudies/Content/Bloc.php +++ b/framework/application/forms/CMS/Sub/Casestudies/Content/Bloc.php @@ -11,6 +11,14 @@ class Cubedesigners_Form_CMS_Sub_Casestudies_Content_Bloc extends CubeIT_Form_Su $select->setAttrib('data-name', 'selected-type'); $this->addElement($select); + $bg_color = new CubeIT_Form_Element_Color('bg_color'); + $bg_color->setLabel('Block background colour (leave blank for default)'); + $this->addElement($bg_color); + + $text_color = new CubeIT_Form_Element_Color('text_color'); + $text_color->setLabel('Text colour (leave blank for default)'); + $this->addElement($text_color); + $margin = new CubeIT_Form_Element_Int('margin'); $margin->setLabel("Décalage vertical du bloc (en pixels)"); $this->addElement($margin); diff --git a/framework/application/forms/CMS/Sub/Casestudies/Content/Blocs.php b/framework/application/forms/CMS/Sub/Casestudies/Content/Blocs.php index 9812c7c..eb1e01e 100644 --- a/framework/application/forms/CMS/Sub/Casestudies/Content/Blocs.php +++ b/framework/application/forms/CMS/Sub/Casestudies/Content/Blocs.php @@ -11,4 +11,4 @@ class Cubedesigners_Form_CMS_Sub_Casestudies_Content_Blocs extends CubeIT_Form_M $this->setNewLegend('Nouveau contenu'); } -} \ No newline at end of file +} diff --git a/framework/application/views/helpers/CasestudiesDetail.php b/framework/application/views/helpers/CasestudiesDetail.php index c6526d3..8e92b87 100644 --- a/framework/application/views/helpers/CasestudiesDetail.php +++ b/framework/application/views/helpers/CasestudiesDetail.php @@ -12,8 +12,8 @@ class Cubedesigners_View_Helper_CasestudiesDetail extends CubeIT_View_Helper_Abs $res = '
'; $res.='
'; - $res.='

' . $studie->titre . '

'; - $res.='

' . $studie->legende . '

'; + $res.='

' . $studie->titre . '

'; + $res.='

' . $studie->legende . '

'; $res.='
'; // $res .= '
'; @@ -54,9 +54,25 @@ class Cubedesigners_View_Helper_CasestudiesDetail extends CubeIT_View_Helper_Abs $zindex = 'z-index:' . $bloc->zindex . ';'; } + $colours = ''; + + if ($bloc->bg_color != '') { + $colours .= 'background-color:'. $bloc->bg_color .';'; + } + if ($bloc->text_color != '') { + $colours .= 'color:'. $bloc->text_color .';'; + } + + + // TODO: Manage padding better so it can be disabled for blocks that have the same colour where we don't want a double gap between them. + + $res .= '
'; + + //-------------- + if ($bloc->selectedtype == "text") { - $res .= '
'; + $res .= '
'; $res .= '
' . $bloc->titre . '
'; $res .= $this->markupDotclear($bloc->texte); $res .= '
'; @@ -104,6 +120,8 @@ class Cubedesigners_View_Helper_CasestudiesDetail extends CubeIT_View_Helper_Abs $res .= '
' . $video . '
'; $res .= '
'; } + + $res .= '
'; // .detail-block } $res .= '
'; $res .= '
'; diff --git a/less/casestudies_detail.less b/less/casestudies_detail.less index 64576d1..ab1fc39 100644 --- a/less/casestudies_detail.less +++ b/less/casestudies_detail.less @@ -66,14 +66,19 @@ } .casestudies-detail-content { - text-align: center; background-color: #0194d5; - padding: 50px 0 0px 0; + + .detail-block { + .constrain(padding-top, 7.5vw); + .constrain(padding-bottom, 7.5vw); + .constrain(padding-left, 10vw); + .constrain(padding-right, 10vw); + } .detail-text { color: #fff; - max-width: 708px; // 640 + 34*2 - margin: auto; + max-width: 850px; + margin: 0 auto; position: relative; z-index: 10; @@ -87,8 +92,9 @@ } .detail-text .titre { - font-size: 32px; - padding-bottom: 10px; + font-size: 60px; + line-height: 1.1; + margin-bottom: 0.5em; } .detail-text .dotclear { @@ -101,9 +107,9 @@ .detail-visuel { // padding: 0px 0 50px 0; // z-index: 1; - padding-left: 34px; - padding-right: 34px; - max-width: 1268px; // Max image width + horizontal padding (this must be set so % margins scale properly on images + //padding-left: 34px; + //padding-right: 34px; + //max-width: 1268px; // Max image width + horizontal padding (this must be set so % margins scale properly on images margin: 0 auto; img {