diff --git a/core/lib/Thelia/Controller/Front/ContactController.php b/core/lib/Thelia/Controller/Front/ContactController.php index 543d65c71..da8c7efc2 100644 --- a/core/lib/Thelia/Controller/Front/ContactController.php +++ b/core/lib/Thelia/Controller/Front/ContactController.php @@ -46,7 +46,7 @@ class ContactController extends BaseFrontController $form = $this->validateForm($contactForm); $message = \Swift_Message::newInstance($form->get('subject')->getData()) - ->addFrom($form->get('email')->getData(), $form->get('firstname')->getData().' '.$form->get('lastname')->getData()) + ->addFrom($form->get('email')->getData(), $form->get('name')->getData()) ->addTo(ConfigQuery::read('contact_email'), ConfigQuery::read('company_name')) ->setBody($form->get('message')->getData()) ; diff --git a/core/lib/Thelia/Form/ContactForm.php b/core/lib/Thelia/Form/ContactForm.php index 097e651da..3cc7bc737 100644 --- a/core/lib/Thelia/Form/ContactForm.php +++ b/core/lib/Thelia/Form/ContactForm.php @@ -59,22 +59,13 @@ class ContactForm extends BaseForm protected function buildForm() { $this->formBuilder - ->add('firstname', 'text', array( + ->add('name', 'text', array( 'constraints' => array( new NotBlank() ), - 'label' => Translator::getInstance()->trans('firstname'), + 'label' => Translator::getInstance()->trans('Full Name'), 'label_attr' => array( - 'for' => 'firstname_contact' - ) - )) - ->add('lastname', 'text', array( - 'constraints' => array( - new NotBlank() - ), - 'label' => Translator::getInstance()->trans('lastname'), - 'label_attr' => array( - 'for' => 'lastname_contact' + 'for' => 'name_contact' ) )) ->add('email', 'email', array( @@ -82,7 +73,7 @@ class ContactForm extends BaseForm new NotBlank(), new Email() ), - 'label' => Translator::getInstance()->trans('email'), + 'label' => Translator::getInstance()->trans('Your Email Address'), 'label_attr' => array( 'for' => 'email_contact' ) @@ -91,7 +82,7 @@ class ContactForm extends BaseForm 'constraints' => array( new NotBlank() ), - 'label' => Translator::getInstance()->trans('subject'), + 'label' => Translator::getInstance()->trans('Subject'), 'label_attr' => array( 'for' => 'subject_contact' ) @@ -100,7 +91,7 @@ class ContactForm extends BaseForm 'constraints' => array( new NotBlank() ), - 'label' => Translator::getInstance()->trans('message'), + 'label' => Translator::getInstance()->trans('Your Message'), 'label_attr' => array( 'for' => 'message_contact' ) diff --git a/templates/default/assets/less/thelia/buttons.less b/templates/default/assets/less/thelia/buttons.less index 5a4c936d7..209426efe 100644 --- a/templates/default/assets/less/thelia/buttons.less +++ b/templates/default/assets/less/thelia/buttons.less @@ -22,6 +22,7 @@ &.btn-checkout, &.btn-checkout-next, &.btn-checkout-home, + &.btn-contact, &.btn-forgot, &.btn-login, &.btn-proceed-checkout, diff --git a/templates/default/assets/less/thelia/forms.less b/templates/default/assets/less/thelia/forms.less index d39d64ea1..637ea3a79 100755 --- a/templates/default/assets/less/thelia/forms.less +++ b/templates/default/assets/less/thelia/forms.less @@ -50,7 +50,6 @@ // Form Register #form-address, -#form-contact, #form-register { .panel-body { .control-label { .make-sm-column(3); } @@ -65,3 +64,8 @@ .control-btn { .make-sm-column-offset(3); .make-sm-column(5); } } } + +// Form Contact +#form-contact { + +} \ No newline at end of file diff --git a/templates/default/contact-success.html b/templates/default/contact-success.html index 59a79974e..29e7d7ee4 100644 --- a/templates/default/contact-success.html +++ b/templates/default/contact-success.html @@ -1,15 +1,8 @@ -{extends file="layout.tpl"} +{extends file="contact.html"} -{* Breadcrumb *} -{block name='no-return-functions' append} - {$breadcrumbs = [['title' => {intl l="Thanks !"}, 'url'=>{url path="/contact/success"}]]} -{/block} - -{block name="main-content"} -
-
-

{intl l="Thanks !"}

-

{intl l="Thanks for your message, we will contact as soon as possible"}

-
+{block name="contact-form"} +
+

{intl l="Thanks !"}

+

{intl l="Thanks for your message, we will contact as soon as possible."}

{/block} \ No newline at end of file diff --git a/templates/default/contact.html b/templates/default/contact.html index 8e761a68a..8d5d4d89e 100644 --- a/templates/default/contact.html +++ b/templates/default/contact.html @@ -10,96 +10,88 @@

{intl l="Contact us"}

- {form name="thelia.front.contact"} -
- {form_hidden_fields form=$form} -
-
- 1. {intl l="Personal Informations"} -
-
- {form_field form=$form field="firstname"} -
- -
- - {if $error } - {$message} - {assign var="error_focus" value="true"} - {elseif $value != "" && !$error} - - {/if} -
-
- {/form_field} - {form_field form=$form field="lastname"} -
- -
- - {if $error } - {$message} - {assign var="error_focus" value="true"} - {elseif $value != "" && !$error} - - {/if} -
-
- {/form_field} - {form_field form=$form field="email"} -
- -
- - {if $error } - {$message} - {assign var="error_focus" value="true"} - {elseif $value != "" && !$error} - - {/if} -
-
- {/form_field} - {form_field form=$form field="subject"} -
- -
- - {if $error } - {$message} - {assign var="error_focus" value="true"} - {elseif $value != "" && !$error} - - {/if} -
-
- {/form_field} - {form_field form=$form field="message"} -
- -
- - {if $error } - {$message} - {assign var="error_focus" value="true"} - {elseif $value != "" && !$error} - - {/if} -
-
- {/form_field} +
+ +
-
-
- + {block name="contact-form"} + {form name="thelia.front.contact"} + + {form_hidden_fields form=$form} +
+
+ {intl l="Send us a message"} +
+
+
+ {form_field form=$form field="name"} +
+ +
+ + {if $error } + {$message} + {assign var="error_focus" value="true"} + {elseif $value != "" && !$error} + + {/if} +
+
+ {/form_field} + {form_field form=$form field="email"} +
+ +
+ + {if $error } + {$message} + {assign var="error_focus" value="true"} + {elseif $value != "" && !$error} + + {/if} +
+
+ {/form_field}
-
-
-
-
- {/form} + {form_field form=$form field="subject"} +
+ +
+ + {if $error } + {$message} + {assign var="error_focus" value="true"} + {elseif $value != "" && !$error} + + {/if} +
+
+ {/form_field} + {form_field form=$form field="message"} +
+ +
+ + {if $error } + {$message} + {assign var="error_focus" value="true"} + {elseif $value != "" && !$error} + + {/if} +
+
+ {/form_field} + +
+
+ +
+
+
+ + + {/form} + {/block} -{/block} \ No newline at end of file +{/block} diff --git a/templates/default/layout.tpl b/templates/default/layout.tpl index 7f6995d7c..72e9ec4fa 100644 --- a/templates/default/layout.tpl +++ b/templates/default/layout.tpl @@ -348,9 +348,9 @@ URL: http://www.thelia.net {loop name="footer_links" type="content" folder="2"}
  • {$TITLE}
  • {/loop} -
  • Site Map
  • -
  • Terms & Conditions
  • -
  • Contact Us
  • + {*
  • Site Map
  • +
  • Terms & Conditions
  • *} +
  • Contact Us