class AjaxController extends CubeIT_Controller_AjaxController {
+ public function requestQuote() {
+
+ $form = new Fluidbook_Form_RequestQuote();
+
+ if ($form->isValid($_POST)) {
+
+ // ToDo: process form...
+
+ } else {
+ $this->_datas->refreshForm($form); // Respond with validation errors
+ }
+
+ }
}
$first_name = new Zend_Form_Element_Text('first_name');
$first_name->setLabel(__('Prénom'));
- $first_name->setRequired(true);
+ $first_name->setRequired(false);
$first_name->addErrorMessage(__('Votre prénom est obligatoire'));
$this->addElement($first_name);
$submit->setAttrib('type', 'submit');
$this->addElement($submit);
+ $this->setId('requestQuote')
+ ->setAjax()
+ ->setAction('/ajax/requestQuote');
+
+ }
+
+ public function render(Zend_View_Interface $view = null) {
+
+ $form = parent::render($view);
+
+ // Inject tips HTML into form via placeholder
+ $tips = $this->getView()->markupDotclear($this->getView()->option('quote_form_tips'), [], ['class' => 'tips']);
+ return str_replace('<!-- TIPS -->', '<div id="wrap-tips">'. $tips .'</div>', $form);
}
+
}
\ No newline at end of file
class Fluidbook_View_Helper_QuoteForm extends CubeIT_View_Helper_Abstract {
public function quoteForm() {
-
+
+ $this->headScript()->addScriptAndStyle('315-quote');
+
$res = '<div class="request-quote content-wrapper grid">';
$res .= '<div class="text col-2">';
$res .= '<h1 class="title">'. nl2br($this->option('quote_heading')) .'</h1>';
$res .= '</div>'; // .col-2
$res .= '<div class="form col-4">';
$form = new Fluidbook_Form_RequestQuote();
- $tips = $this->markupDotclear($this->option('quote_form_tips'), [], ['class' => 'tips']);
- $res .= str_replace('<!-- TIPS -->', '<div id="wrap-tips">'. $tips .'</div>', $form); // Inject tips HTML into form via placeholder
+ $res .= $form;
$res .= '</div>'; // .col-4
$res .= '</div>'; // .request-quote
-moz-osx-font-smoothing: auto;
}
-.rounded-button() {
+.button(@line-height: 54px, @horizontal-padding: 20px) {
display: inline-block;
- padding: 13px 29px 14px;
- line-height: 9px;
+ line-height: @line-height;
+ padding-left: @horizontal-padding;
+ padding-right: @horizontal-padding;
+ border: 0;
+ font-weight: 300;
+ text-transform: uppercase;
+}
+
+.rounded-button() {
+ .button(35px, 29px);
border-radius: 19px;
border: 1px solid transparent;
}
.workshop-link {
.rounded-button();
.border-button(#fff, #fff);
+ line-height: 1;
padding: 20px 65px;
border-radius: 26px;
text-transform: uppercase;
}
}
-}
-
-// Request a quote section
-.request-quote {
- .text {
- padding-right: 30px;
- }
}
\ No newline at end of file
--- /dev/null
+@import "000-imports";
+
+// Request a quote section
+.request-quote {
+ .text {
+ padding-right: 30px;
+ }
+
+ .zend_form {
+ display: flex;
+ flex-wrap: wrap;
+ justify-content: space-between;
+ margin: 0 -14px; // Offset child padding on edges
+
+ > div {
+ flex-basis: 50%;
+ padding: 0 14px; // To create a 28px gap between cells
+ }
+ }
+
+ label {
+ display: block;
+ margin-bottom: 8px;
+ font-size: 15px;
+ }
+
+ input[type="text"], input[type="email"], textarea, select {
+ border: 1px solid @color-text;
+ line-height: 53px;
+ padding: 0 15px;
+ -webkit-appearance: none;
+ -moz-appearance: none;
+ appearance: none;
+ border-radius: 0;
+ }
+
+ textarea {
+ line-height: 1.3;
+ padding: 15px;
+ height: 170px;
+ display: block; // Removes space below element caused by inline-block
+ }
+
+ #wrap-tips {
+ align-self: center;
+ margin-bottom: 10px;
+ }
+
+ .tips {
+ margin-top: 42px;
+ padding: 20px 30px;
+ background-color: #f3f3f3;
+ min-height: 170px; // Same as textarea height
+ position: relative;
+
+ // < arrow
+ &:after {
+ right: 100%;
+ top: 50%;
+ content: '';
+ height: 0;
+ width: 0;
+ position: absolute;
+ pointer-events: none;
+ border: 16px solid transparent;
+ border-right-color: #f3f3f3;
+ margin-top: -16px;
+ }
+ }
+
+ #submit-element {
+ margin: 14px;
+
+ button {
+ .button();
+ color: #fff;
+ background-color: @color-green;
+ font-size: 14px;
+ }
+ }
+
+}
\ No newline at end of file