From 0efe7cfadb8751cfc88269d6a826fee160d51025 Mon Sep 17 00:00:00 2001 From: "stephen@cubedesigners.com" Date: Tue, 28 Jun 2016 16:39:56 +0000 Subject: [PATCH] Contact page, general CSS grid and responsive behaviour WIP #486 @6.5 --- framework/application/forms/RequestQuote.php | 60 +++++++++++++++++++ framework/application/forms/Settings.php | 13 ++++ .../views/scripts/templates/contact.phtml | 22 ++++++- less/001-variables.less | 1 + less/002-common.less | 37 ++++++++++-- less/310-contact.less | 7 +++ 6 files changed, 135 insertions(+), 5 deletions(-) create mode 100644 framework/application/forms/RequestQuote.php diff --git a/framework/application/forms/RequestQuote.php b/framework/application/forms/RequestQuote.php new file mode 100644 index 0000000..bb1b23e --- /dev/null +++ b/framework/application/forms/RequestQuote.php @@ -0,0 +1,60 @@ +setLabel(__('Votre nom')); + $last_name->setRequired(true); + $last_name->addErrorMessage(__('Votre nom est obligatoire')); + $this->addElement($last_name); + + $first_name = new Zend_Form_Element_Text('first_name'); + $first_name->setLabel(__('Prénom')); + $first_name->setRequired(true); + $first_name->addErrorMessage(__('Votre prénom est obligatoire')); + $this->addElement($first_name); + + $company = new Zend_Form_Element_Text('company'); + $company->setLabel(__('Nom de la société')); + $company->setRequired(true); + $company->addErrorMessage(__('Champ obligatoire')); + $this->addElement($company); + + $contact_type = new Zend_Form_Element_Select('contact_type'); + $contact_type->setLabel(__('Vous êtes')); + $contact_type->setMultiOptions(array( + '' => __("???"), // Todo: set options + )); + $contact_type->setAttrib('required', 'required'); // Needed so we can style the first element when nothing selected + $contact_type->setRequired(true); + $contact_type->addErrorMessage(__('Champ obligatoire')); + $this->addElement($contact_type); + + $email = new CubeIT_Form_Element_Email('email'); + $email->setLabel(__('Email professionnel')); + $email->setRequired(true); + $email->addErrorMessage(__('E-mail invalide')); + $this->addElement($email); + + $phone = new Zend_Form_Element_Text('phone'); + $phone->setLabel(__('Téléphone')); + $phone->setRequired(false); + $phone->addErrorMessage(__('Champ obligatoire')); + $this->addElement($phone); + + $comments = new Zend_Form_Element_Textarea('comments'); + $comments->setLabel(__('Commentaires sur votre projet')); + $this->addElement($comments); + + $submit = new Zend_Form_Element_Button('submit'); + $submit->setLabel(__('Envoyer la demande')); + $submit->setAttrib('class', 'submit-button'); + $submit->setAttrib('type', 'submit'); + $this->addElement($submit); + + } + +} \ No newline at end of file diff --git a/framework/application/forms/Settings.php b/framework/application/forms/Settings.php index 57a6a78..7a8328b 100644 --- a/framework/application/forms/Settings.php +++ b/framework/application/forms/Settings.php @@ -23,6 +23,19 @@ class Fluidbook_Form_Settings extends CubeIT_Form_Settings { $adresse->setLabel('Adresse'); $this->addSubFormLocalized($adresse, 'address'); + $quote_heading = new CubeIT_Form_Element_Textarea('quote_heading'); + $quote_heading->setAttrib('rows', 3); + $quote_heading->setLabel('"Demander un Devis" titre'); + $this->addElementLocalized($quote_heading); + + $quote_description = new CubeIT_Form_Element_Markitup('quote_description'); + $quote_description->setLabel('"Demander un Devis" texte'); + $this->addElementLocalized($quote_description); + + $quote_form_tips = new CubeIT_Form_Element_Markitup('quote_form_tips'); + $quote_form_tips->setLabel('Conseils de forme "Demander un Devis"'); + $this->addElementLocalized($quote_form_tips); + $footer_menu_main = new Fluidbook_Form_CMS_Element_PagesTagList('footer_menu_main'); $footer_menu_main->setLabel('Pages for menu "Plan du site"'); $footer_menu_main->setAttrib('placeholder', 'Tapez un titre de la page'); diff --git a/framework/application/views/scripts/templates/contact.phtml b/framework/application/views/scripts/templates/contact.phtml index 90fc73a..236bfce 100644 --- a/framework/application/views/scripts/templates/contact.phtml +++ b/framework/application/views/scripts/templates/contact.phtml @@ -8,10 +8,13 @@ $intro_image_path = CubeIT_View_Helper_ImageCms::getPath($this->intro_bg_image); CubeIT_Image::getDimensions($intro_image_path, $intro_image_width, $intro_image_height); $intro_ratio = $intro_image_height / $intro_image_width; -$res .= '
'; +$res .= '
'; +$res .= '
'; + $res .= '

'. nl2br($this->intro_title) .'

'; $res .= $this->markupDotclear($this->intro_content); @@ -30,6 +33,23 @@ $res .= '
'; $res .= __('email :') . ' ' . $this->linkEmail($address['email']); $res .= ''; +$res .= '
'; // .col-2 +$res .= '
'; // .grid $res .= '
'; // .contact-intro +// Request Quote form +$res .= '
'; +$res .= '
'; +$res .= '

'. nl2br($this->option('quote_heading')) .'

'; +$res .= $this->markupDotclear($this->option('quote_description')); +$res .= '
'; // .col-2 +$res .= '
'; +$form = new Fluidbook_Form_RequestQuote(); +$res .= $form; +$res .= $this->markupDotclear($this->option('quote_form_tips')); +$res .= '
'; // .col-4 +$res .= '
'; // .request-quote + +// Resellers + echo $res; \ No newline at end of file diff --git a/less/001-variables.less b/less/001-variables.less index a22a4ac..40d9237 100644 --- a/less/001-variables.less +++ b/less/001-variables.less @@ -18,4 +18,5 @@ //-- Content and breakpoints @mobile-breakpoint: 1024px; +@desktop-min-width: 1200px; @content-max-width: 1680px; \ No newline at end of file diff --git a/less/002-common.less b/less/002-common.less index d1db1d8..c45c5c4 100644 --- a/less/002-common.less +++ b/less/002-common.less @@ -1,8 +1,11 @@ @import "000-imports"; -*{ +html { box-sizing: border-box; } +*, *:before, *:after { + box-sizing: inherit; +} body { background-color: @color-body-bg; @@ -11,7 +14,7 @@ body { line-height: 26/14; } -main{ +main { background-color: #fff; max-width: @content-max-width; margin: 0 auto; @@ -34,10 +37,36 @@ a { .content-wrapper { width: 100%; - padding: 0 5%; + padding-top: 5%; + padding-bottom: 5%; + + &:first-of-type { + padding-top: 152px; // Minimum clearance and top for fixed menu + } +} + +.no-shrink { + min-width: @desktop-min-width; } .cubeit-content{ width: 90%; margin:0 auto; -} \ No newline at end of file +} + +// Simple Flexbox Grid +.grid { + display: flex; + padding-left: 5%; + padding-right: 5%; +} +.col { + flex: 1 0 auto; +} +// Grid contains 6 columns without gutters +.col-1 { flex-basis: percentage(1/6); } +.col-2 { flex-basis: percentage(2/6); } +.col-3 { flex-basis: percentage(3/6); } +.col-4 { flex-basis: percentage(4/6); } +.col-5 { flex-basis: percentage(5/6); } +.col-6 { flex-basis: percentage(6/6); } diff --git a/less/310-contact.less b/less/310-contact.less index 6551b48..502d50d 100644 --- a/less/310-contact.less +++ b/less/310-contact.less @@ -33,4 +33,11 @@ } } +} + +// Request a quote section +.request-quote { + .text { + padding-right: 30px; + } } \ No newline at end of file -- 2.39.5