]> _ Git - ccgm.git/commitdiff
(no commit message)
authorvincent@cubedesigners.com <vincent@cubedesigners.com@f5622870-0f3c-0410-866d-9cb505b7a8ef>
Wed, 2 Oct 2013 11:41:22 +0000 (11:41 +0000)
committervincent@cubedesigners.com <vincent@cubedesigners.com@f5622870-0f3c-0410-866d-9cb505b7a8ef>
Wed, 2 Oct 2013 11:41:22 +0000 (11:41 +0000)
framework/application/forms/CMS/Faq.php
framework/application/forms/CMS/Sub/Faq/Temoignage.php [new file with mode: 0644]
framework/application/forms/CMS/Sub/Faq/Temoignages.php [new file with mode: 0644]
framework/application/views/helpers/Temoignages.php [new file with mode: 0644]
framework/application/views/scripts/templates/faq.phtml
less/faq.less

index 2ff03d70bb252dc1977a9555d50a52a619a4d126..d00c7629c631ae335b817852dae5d6f3f43d3798 100644 (file)
@@ -12,6 +12,14 @@ class CCGM_Form_CMS_Faq extends CCGM_Form_CMS_Default {
                $questions = new CCGM_Form_CMS_Sub_Faq_Questions();
                $questions->setLegend('Question / Réponses');
                $this->addSubForm($questions, 'questions');
+
+               $titret = new Zend_Form_Element_Text('titre_temoignages');
+               $titret->setLabel('Titre de la rubrique "témoignages"');
+               $this->addElement($titret);
+
+               $temoignages = new CCGM_Form_CMS_Sub_Faq_Temoignages();
+               $temoignages->setLegend('Témoignages');
+               $this->addSubForm($temoignages, 'temoignages');
        }
 
 }
diff --git a/framework/application/forms/CMS/Sub/Faq/Temoignage.php b/framework/application/forms/CMS/Sub/Faq/Temoignage.php
new file mode 100644 (file)
index 0000000..2f6358b
--- /dev/null
@@ -0,0 +1,16 @@
+<?php
+
+class CCGM_Form_CMS_Sub_Faq_Temoignage extends CubeIT_Form_SubForm {
+
+       public function init() {
+               parent::init();
+
+               $temoignage = new Zend_Form_Element_Textarea('temoignage');
+               $temoignage->setLabel('Témoignage');
+               $temoignage->setAttrib('rows', 3);
+               $this->addElement($temoignage);
+       }
+
+}
+
+?>
diff --git a/framework/application/forms/CMS/Sub/Faq/Temoignages.php b/framework/application/forms/CMS/Sub/Faq/Temoignages.php
new file mode 100644 (file)
index 0000000..10e2896
--- /dev/null
@@ -0,0 +1,15 @@
+<?php
+
+class CCGM_Form_CMS_Sub_Faq_Temoignages extends CubeIT_Form_Multi_SubForm {
+
+       public function init() {
+               parent::init();
+               $base = new CCGM_Form_CMS_Sub_Faq_Temoignage();
+               $this->setBaseSubForm($base);
+               $this->setNewLegend('Nouvau témoignage');
+               $this->setBaseLegend('Editer le témoignage « $temoignage »');
+       }
+
+}
+
+?>
diff --git a/framework/application/views/helpers/Temoignages.php b/framework/application/views/helpers/Temoignages.php
new file mode 100644 (file)
index 0000000..c4016b0
--- /dev/null
@@ -0,0 +1,18 @@
+<?php
+
+class CCGM_View_Helper_Temoignages extends Zend_View_Helper_Abstract {
+
+       public function temoignages($titre, $temoignages) {
+               $this->view->headScript()->addScriptAndStyle('rightbar');
+               $res = '<aside id="rightbar" class="temoignages">';
+               $res.='<h2>' . $titre . '</h2>';
+               foreach ($temoignages as $t) {
+                       $res.='<article>' . nl2br($t['temoignage']) . '</article>';
+               }
+               $res.='</aside>';
+               return $res;
+       }
+
+}
+
+?>
index 798e42693f2c1f88c08a15ee529ad067086b0169..78c1784e25c798cf58c7cad1ff74193b2287c43f 100644 (file)
@@ -4,5 +4,5 @@
                <h1><?php echo $this->titre ?></h1>\r
                <?php echo $this->faq($this->questions); ?>\r
        </div>\r
-       <?php echo $this->rightbar() ?>\r
+       <?php echo $this->temoignages($this->titre_temoignages,$this->temoignages) ?>\r
 </section>
\ No newline at end of file
index 801f5bbf118852bbe562c73950cef62bbb5883c6..01d31298f3b73c694045be6b0f5d20d530c4c57e 100644 (file)
@@ -9,4 +9,34 @@
 
 .faq dd{
        margin:12px 0 20px 0;
+}
+
+#rightbar.temoignages{
+       h2{
+               color:#e30186;
+               font-size: 24px;
+       }
+
+       article{
+               background-color:#f1f0f0;
+               color:#898989;
+               font-weight: 300;
+               font-size: 13px;
+               font-style: italic;
+               padding:20px 25px;
+               margin:0 0 30px 0;
+               position:relative;
+
+               &:after {
+                       border-color: transparent #f1f0f0;
+                       border-style: solid;
+                       border-width: 0 0 17px 20px;
+                       bottom: -17px;
+                       content: "";
+                       display: block;
+                       position: absolute;
+                       right: 91px;
+                       width: 0;
+               }
+       }
 }
\ No newline at end of file