diff --git a/app/Enums/ContactFormCivility.php b/app/Enums/ContactFormCivility.php new file mode 100644 index 00000000..c5a9099e --- /dev/null +++ b/app/Enums/ContactFormCivility.php @@ -0,0 +1,47 @@ + 1, + 'mme' => 2, + 'mlle' => 3, + ]; + } + + protected static function labels(): array + { + return [ + 'm' => __('M'), + 'mme' => __('Mme'), + 'mlle' => __('Mlle') + ]; + } + + public function __toString(): string + { + return (string) $this->label; + } + + public static function make($value): BaseEnum + { + foreach (static::toArray() as $toValue => $labels) { + if ($value == $toValue) { + return parent::make(strtolower($labels)); + } + } + $classname = static::class; + throw new BadMethodCallException("There's no value {$value} defined for enum {$classname}, consider adding it in the docblock definition."); + } +} diff --git a/app/Enums/ContactFormType.php b/app/Enums/ContactFormType.php new file mode 100644 index 00000000..82c128b9 --- /dev/null +++ b/app/Enums/ContactFormType.php @@ -0,0 +1,28 @@ + __('Les Recettes'), + 'abuse' => __('Le Club des Gaulois et Les Départ’aimants'), + 'complain' => __('Réclamation Produit'), + 'games' => __('Les Jeux') + ]; + } + + public function __toString(): string + { + return (string) $this->label; + } +} diff --git a/app/Exceptions/AbortContactMailer.php b/app/Exceptions/AbortContactMailer.php new file mode 100644 index 00000000..482d64ea --- /dev/null +++ b/app/Exceptions/AbortContactMailer.php @@ -0,0 +1,14 @@ + 2020) + * @author Jérémy Munsch + */ +class AbortContactMailer extends Exception +{ +} diff --git a/app/Facades/ContactFormCivility.php b/app/Facades/ContactFormCivility.php new file mode 100644 index 00000000..754f6452 --- /dev/null +++ b/app/Facades/ContactFormCivility.php @@ -0,0 +1,14 @@ +status; + $user = null; + $type = $type ?? ContactFormType::none(); + return view('front.contact.contact', compact('type', 'user', 'status')); + } + + public function contactSubmit(ContactFormRequest $request) + { + try { + $data = new MailContactData(); + $data->fill($request->all()); + + Mail::to(config('mail.contactsList.contact')) + ->send( + new MailsContact( + $data, + realpath($this->getContactFilePathArchadia()) . + DIRECTORY_SEPARATOR . + sprintf('contact_le_gaulois_%d_%d.csv', time(), rand(1000, 9999)) + ) + ); + + ModelsContact::incrementStat($data->type); + + return response()->redirectToRoute('contact-us', ['status' => true]); + } catch (AbortContactMailer $e) { + Log::error('Fail to build mail from contact page ', ['exception' => $e]); + } + return back()->withInput()->with('status', false); + } + + public function complain(Request $request) + { + return $this->contact($request, ContactFormType::complain()); + } + + public function complainSubmit(ContactFormRequest $request) + { + try { + $data = new MailContactData(); + $data->fill($request->all()); + + Mail::to(config('mail.contactsList.passerelle')) + ->send(new MailsContactComplain( + $data, + realpath($this->getContactFilePathPasserelle()) . + DIRECTORY_SEPARATOR . + sprintf('LEGAULOIS_PASS_MESSAGE-%s.xml', date("YmdHis")) + )); + + ModelsContact::incrementStat($data->type); + + return response()->redirectToRoute('product-request', ['status' => true]); + } catch (AbortContactMailer $e) { + Log::error('Fail to build mail from complain page ', ['exception' => $e]); + } + return back()->withInput()->with('status', false); + } + + private function getContactFilePathArchadia($passerelle = false): string + { + $path = !$passerelle ? + config('contactfiles.dossierFichiersArchadia') : + config('contactfiles.dossierFichiersPasserelle'); + + if (!File::isDirectory($path)) { + if (!File::makeDirectory($path, 0007, true, true)) { + throw new AbortContactMailer(sprintf('Could not create %s', $path)); + } + } + return $path; + } + + private function getContactFilePathPasserelle(): string + { + return $this->getContactFilePathArchadia(true); + } +} diff --git a/app/Http/Requests/ComplainFormRequest.php b/app/Http/Requests/ComplainFormRequest.php new file mode 100644 index 00000000..74933e71 --- /dev/null +++ b/app/Http/Requests/ComplainFormRequest.php @@ -0,0 +1,37 @@ + 'required|min:2|max:100', + 'productCode' => 'required|digits_between:8,13|min:1|max:9999999999999', + 'buyPlace' => 'required|min:2|max:100', + 'lotNumberName' => 'required|min:2|max:50', + 'limitDateDay' => 'required|numeric|min:1|max:31', + 'limitDateMonth' => 'required|numeric|min:1|max:31', + 'limitDateYear' => 'required|numeric|min:2010|max:2050', + 'consumptionDateDay' => 'required|numeric|min:1|max:31', + 'consumptionDateMonth' => 'required|numeric|min:1|max:31', + 'consumptionDateYear' => 'required|numeric|min:2010|max:2050', + ]); + } +} diff --git a/app/Http/Requests/ContactFormRequest.php b/app/Http/Requests/ContactFormRequest.php new file mode 100644 index 00000000..6fc616bd --- /dev/null +++ b/app/Http/Requests/ContactFormRequest.php @@ -0,0 +1,61 @@ + [ + 'required', + function ($attribute, $value, $fail) { + if (!in_array($value, ContactFormCivility::toValues())) { + $fail(__('Veuillez choisir entre :values', [ + 'value' => implode(',', ContactFormCivility::toLabels()) + ])); + } + } + ], + 'type' => [ + 'required', + function ($attribute, $value, $fail) { + if (!in_array($value, ContactFormType::toValues())) { + $fail(__('Veuillez choisir entre :values', [ + 'value' => implode(',', ContactFormType::toLabels()) + ])); + } + } + ], + 'lastname' => 'required|min:2', + 'firstname' => 'required|min:2', + 'address' => 'required|min:4', + // TODO: The dns and spoof validators require the PHP intl extension. (présent sur prod ?) + 'email' => 'required|email:rfc,dns,spoof', + 'postal' => 'required|min:3|max:12', + 'town' => 'required|min:3|max:90', + 'phone' => 'required|min:8|max:14', + 'message' => 'required|min:20|max:1900', + 'joinFile' => 'nullable|mimes:jpg,jpeg,png,pdf|max:3145728' + ]; + } +} diff --git a/app/Mail/Contact.php b/app/Mail/Contact.php new file mode 100644 index 00000000..e6033636 --- /dev/null +++ b/app/Mail/Contact.php @@ -0,0 +1,112 @@ +data = $data; + $this->csvFilePath = $csvFilePath; + } + + /** + * Build the message. + * + * @return $this + */ + public function build() + { + $this->joinFileIfProvided(); + $this->makeCsvFile(); + return $this + ->subject(sprintf('Nouveau message consommateur Le Gaulois (%s)', $this->data->type->label)) + ->view('emails.contact') + ->text('emails.contact-plain') + ->with('data', $this->data) + ->attach($this->csvFilePath, [ + 'as' => sprintf('contact_le_gaulois_%d.csv', time()), + 'mime' => 'text/csv', + ]); + } + + /** + * Attach a joined file if given in data + * + * @return void + */ + protected function joinFileIfProvided() + { + if ($this->data->joinFile) { + $this->joinedFileName = sprintf( + 'LEGAULOIS_PASS_MESSAGE-PJ-%s.%s', + date("YmdHis"), + $this->data->joinFile->extension() + ); + $this->attach($this->data->joinFile, [ + 'as' => $this->joinedFileName, + 'mime' => $this->data->joinFile->getMimeType() + ]); + $this->data->joinFile = $this->joinedFileName; + } + } + + protected function makeCsvFile() + { + //we create the CSV into memory + // FILENAME + $csv = Writer::createFromFileObject(new SplTempFileObject()); + $csv->setDelimiter(';'); + + //we insert the CSV header + $csv->insertOne([ + 'EMETTEUR_DATE', 'EMETTEUR_HEURE', 'EMETTEUR_CIVILITE', 'EMETTEUR_NOM', 'EMETTEUR_PRENOM', + 'EMETTEUR_ADRESSE', 'EMETTEUR_CP', 'EMETTEUR_VILLE', 'EMETTEUR_EMAIL', 'EMETTEUR_OBJETDEMANDE', + 'EMETTEUR_MESSAGE', 'EMETTEUR_CATEGORIE', 'EMETTEUR_ACTIVITE', 'REPONSE_ETAT', 'TYPE_REPONSE' + ]); + + $csv->insertOne($this->data->exportToArcadiaDataArray()); + + if (!File::put($this->csvFilePath, $csv->getContent())) { + throw new AbortContactMailer(sprintf('Could save create %s', $this->csvFilePath)); + } + } +} diff --git a/app/Mail/ContactComplain.php b/app/Mail/ContactComplain.php new file mode 100644 index 00000000..7a34dd81 --- /dev/null +++ b/app/Mail/ContactComplain.php @@ -0,0 +1,70 @@ +data = $data; + $this->xmlFilePath = $xmlFilePath; + } + + /** + * Build the message. + * + * @return $this + */ + public function build() + { + $this->joinFileIfProvided(); + $this->makeXmlFile(); + return $this->view('emails.contact') + ->subject(sprintf('Nouveau message consommateur Le Gaulois (%s)', $this->data->type->label)) + ->text('emails.contact-plain') + ->with('data', $this->data) + ->attach($this->xmlFilePath, [ + 'as' => sprintf('LEGAULOIS_PASS_MESSAGE_%d.xml', date("YmdHis")), + 'mime' => 'application/xml', + ]); + } + + private function makeXmlFile() + { + $d = $this->data->exportToPasserelleDataArray(); + if (!File::put($this->xmlFilePath, view('emails.passerelle-xml', ['data' => $d])->render())) { + throw new AbortContactMailer(sprintf('Could save create %s', $this->xmlFilePath)); + } + } +} diff --git a/app/Models/MailContactData.php b/app/Models/MailContactData.php new file mode 100644 index 00000000..ec376da9 --- /dev/null +++ b/app/Models/MailContactData.php @@ -0,0 +1,140 @@ + ContactFormType::class, + 'civility' => ContactFormCivility::class + ]; + + /** + * The database connection that should be used by the model. + * + * @var string + */ + protected $connection = null; + + /** + * The attributes that are mass assignable. + * + * @var array + */ + protected $fillable = [ + 'civility', + 'lastname', + 'firstname', + 'address', + 'email', + 'postal', + 'town', + 'phone', + 'type', + 'message', + 'joinFile', + 'productName', + 'productCode', + 'buyPlace', + 'lotNumberName', + 'limitDateDay', + 'limitDateMonth', + 'limitDateYear', + 'consumptionDateDay', + 'consumptionDateMonth', + 'consumptionDateYear' + ]; + + protected $attributes = [ + 'productName' => '', + 'productCode' => '', + 'buyPlace' => '', + 'lotNumberName' => 0, + 'limitDateDay' => '00', + 'limitDateMonth' => '00', + 'limitDateYear' => '0000', + 'consumptionDateDay' => '00', + 'consumptionDateMonth' => '00', + 'consumptionDateYear' => '0000', + ]; + + /** + * Export the model data to a Formatted Arcadia Data array + * + * @return array + */ + public function exportToArcadiaDataArray(): array + { + return [ + date("Ymd"), + date("Gis"), + $this->civility->label, + $this->lastname, + $this->firstname, + $this->address, + $this->postal, + $this->town, + $this->email, + $this->type->label, + $this->message, + '0', '0', '0', '0' + ]; + } + + /** + * Export the model data to a Formatted Arcadia Data array + * + * @return array + */ + public function exportToPasserelleDataArray(): array + { + // CF PAsserrelle fields .csv + return [ + 'EMETTEUR_MARQUE' => 1, // Marque le Gaulois (Obligatoire) + 'EMETTEUR_DATE' => date("Ymd"), // (Obligatoire) + 'EMETTEUR_HEURE' => date("Gis"), // (Obligatoire) + 'EMETTEUR_CIVILITE' => $this->civility, + 'EMETTEUR_NOM' => $this->lastname, // (Obligatoire) + 'EMETTEUR_PRENOM' => $this->firstname, // (Obligatoire) + 'EMETTEUR_ADRESSE1' => $this->address, + 'EMETTEUR_ADRESSE2' => '', + 'EMETTEUR_CP' => $this->postal, + 'EMETTEUR_VILLE' => $this->town, // (Obligatoire) + 'EMETTEUR_EMAIL' => $this->email, + 'EMETTEUR_TELEPHONE' => $this->phone, + 'EMETTEUR_PAYS' => 'France', + 'EMETTEUR_NOM_PRODUIT' => $this->productName, + 'EMETTEUR_EAN13' => $this->productCode, // (Obligatoire) + 'EMETTEUR_DATE_LIMITE_CONSO' => sprintf( + '%s/%s/%s', + $this->limitDateDay ?? '00', + $this->limitDateMonth ?? '00', + $this->limitDateYear ?? '0000' + ), + 'EMETTEUR_NUM_LOT' => $this->lotNumberName, + 'EMETTEUR_MESSAGE' => $this->message, + 'EMETTEUR_PJ' => $this->joinFile, + // 'EMETTEUR_OBJETDEMANDE' => "objet de la reclamation string", + // 'EMETTEUR_OPT_IN' => '', + // 'REPONSE_ETAT' => 0, + // 'TYPE_REPONSE' => 'mail', + 'DATE_CONSO' => sprintf( + '%s/%s/%s', + $this->consumptionDateDay ?? '00', + $this->consumptionDateMonth ?? '00', + $this->consumptionDateYear ?? '0000' + ), + 'LIEU_ACHAT' => $this->buyPlace + ]; + } +} diff --git a/config/app.php b/config/app.php index c4991e06..0add4195 100644 --- a/config/app.php +++ b/config/app.php @@ -235,7 +235,8 @@ return [ 'URL' => Illuminate\Support\Facades\URL::class, 'Validator' => Illuminate\Support\Facades\Validator::class, 'View' => Illuminate\Support\Facades\View::class, - + 'ContactFormCivility' => App\Enums\ContactFormCivility::class, + 'ContactFormType' => App\Enums\ContactFormType::class ], ]; diff --git a/config/contactfiles.php b/config/contactfiles.php new file mode 100644 index 00000000..78875ddd --- /dev/null +++ b/config/contactfiles.php @@ -0,0 +1,6 @@ + storage_path('msg_conso/arch_message_arcadia'), + 'dossierFichiersPasserelle' => storage_path('msg_conso/arch_message_passerelle') +]; diff --git a/config/mail.php b/config/mail.php index 54299aab..3a52f59e 100644 --- a/config/mail.php +++ b/config/mail.php @@ -84,8 +84,15 @@ return [ */ 'from' => [ - 'address' => env('MAIL_FROM_ADDRESS', 'hello@example.com'), - 'name' => env('MAIL_FROM_NAME', 'Example'), + 'address' => env('MAIL_FROM_ADDRESS', 'contact@legaulois.fr'), + 'name' => env('MAIL_FROM_NAME', 'Contact Le Gaulois (legaulois.fr)') + ], + + // Contacts List + + 'contactsList' => [ + 'contact' => 'contact@legaulois.fr', + 'passerelle' => 'passerelle.ldc@ldc.fr' ], /* diff --git a/public/images/commun/entete-contact.svg b/public/images/commun/entete-contact.svg new file mode 100644 index 00000000..13897bdb --- /dev/null +++ b/public/images/commun/entete-contact.svg @@ -0,0 +1 @@ +entete-contact \ No newline at end of file diff --git a/public/images/faq/faq_background.jpg b/public/images/faq/faq_background.jpg new file mode 100644 index 00000000..e44fbdce Binary files /dev/null and b/public/images/faq/faq_background.jpg differ diff --git a/resources/documents/DTD XML Passerelle.xlsx b/resources/documents/DTD XML Passerelle.xlsx new file mode 100644 index 00000000..12a6727b Binary files /dev/null and b/resources/documents/DTD XML Passerelle.xlsx differ diff --git a/resources/images/commun/entete-contact.svg b/resources/images/commun/entete-contact.svg new file mode 100644 index 00000000..13897bdb --- /dev/null +++ b/resources/images/commun/entete-contact.svg @@ -0,0 +1 @@ +entete-contact \ No newline at end of file diff --git a/resources/images/entete-contact.svg b/resources/images/entete-contact.svg new file mode 100644 index 00000000..13897bdb --- /dev/null +++ b/resources/images/entete-contact.svg @@ -0,0 +1 @@ +entete-contact \ No newline at end of file diff --git a/resources/sass/_variables.scss b/resources/sass/_variables.scss index fc7a2f45..e0ca8268 100644 --- a/resources/sass/_variables.scss +++ b/resources/sass/_variables.scss @@ -1,5 +1,26 @@ // Body -$body-bg: #f8fafc; +$body-bg: #f3ebe4; + +// Breaking Points +$large_screen : 1366px; +$big_screen : 1200px; +$desktop : 1024px; +$tablet : 768px; +$mobile : 500px; +$xmobile : 320px; + +$minLscreen : only screen and (min-width: $large_screen); +$minBscreen : only screen and (min-width: $big_screen); +$minDesktop : only screen and (min-width: $desktop); +$minTablet : only screen and (min-width: $tablet); +$minMobile : only screen and (min-width: $mobile); +$minxMobile : only screen and (min-width: $xmobile); + +$max499 : only screen and (max-width: 499px); +$max767 : only screen and (max-width: 767px); +$max1023 : only screen and (max-width: 1023px); +$max1199 : only screen and (max-width: 1199px); +$max1365 : only screen and (max-width: 1365px); // Typography $font-family-sans-serif: 'Nunito', sans-serif; @@ -23,3 +44,16 @@ $theme-colors: ( "primary": #3176C4, "secondary": #E7374B ); + +$color10: #999595; +$color11: #ab9d8e; +$color9: #c6bcb3; +$color1: #f3ebe4; +$color2: #07386a; +$color3: #0f437e; +$color4: #1e5ba1; +$color5: #4e3238; +$color6: #f79e15; +$color8: #ffb504; +$color7: #e02125; +$orange: #ffb400; diff --git a/resources/sass/front/_body.scss b/resources/sass/front/_body.scss index 65b1d990..6fa4a4cc 100644 --- a/resources/sass/front/_body.scss +++ b/resources/sass/front/_body.scss @@ -3,13 +3,36 @@ } body { - background-color: #f3ebe4; + background-color: $body-bg; & p { - color: #4e3238; + color: $color5; font-size: 1.5em; font-family: 'Catamaran-Regular'; line-height: 125%; } + & h1, h2, h3, h4, h5, h6 { + color: $color5; + font-family: 'Veneer'; + } + & h1 { + font-size: 7.5em; + } + & h2 { + font-size: 6em; + } + & h3 { + font-size: 4.2em; + } + & h4 { + font-size: 4em; + } + & h5 { + font-size: 3.2em; + } + & h6 { + font-size: 1.5em; + } + } diff --git a/resources/sass/front/_sub_header.scss b/resources/sass/front/_sub_header.scss index c77cc0cc..473336c4 100644 --- a/resources/sass/front/_sub_header.scss +++ b/resources/sass/front/_sub_header.scss @@ -378,6 +378,34 @@ } } +.sub_header_contact { + background-image: url(../images/faq/faq_background.jpg); + background-repeat: no-repeat; + background-position: center 94%; + background-size: 102% auto; + height: 50em; + width: 100%; + margin-top: 1.15em; + + .title { + background-image: url(../images/commun/entete-contact.svg); + background-repeat: no-repeat; + background-position: center 100%; + background-size: 102% auto; + height: 42em; + z-index: 11; + position: relative; + + h1 { + margin-top: 81px; + color: white; + text-align: center; + font-size: 7em; + font-family: 'Veneer'; + } + } +} + .sub_header_ocb { width: 100%; height: 370px; diff --git a/resources/sass/front/modules/_buttons.scss b/resources/sass/front/modules/_buttons.scss new file mode 100644 index 00000000..d6543b4f --- /dev/null +++ b/resources/sass/front/modules/_buttons.scss @@ -0,0 +1,92 @@ +/******** BUTTONS *********/ +.btn { + border: none; + color: #fff; + cursor: pointer; + display: inline-block; + font-family: 'Catamaran-Black'; + font-size: 15px; + height: 40px; + line-height: 1.25; + margin-bottom: 0; + padding: 10px 25px; + text-align: center; + touch-action: manipulation; + vertical-align: middle; + white-space: nowrap; + } + + .btn-red { + background-color: #e43b4e; + + &:hover { + background-color: #d8293a; + } + } + + .btn-white { + background-color: #fff; + border: 2px solid #2965a1; + color: #1e5ba1; + + &:hover { + background-color: #2965a1; + color: #fff; + } + } + + .btn-yellow { + background-color: #ffb400; + } + + .btn-orange { + background-color: #e77b32; + } + + .btn-blue { + background-color: #1e5ba1; + } + + .btn-d0c2b3 { + background-color: #d0c2b3; + } + + .btn-violet { + background-color: #974c99; + } + + .btn-gris { + background-color: #91b0d4; + } + + .btn-d5cbc1 { + background-color: #d5cbc1; + } + + .btn-arronded-20 { + border-radius: 20px; + } + + .btn-arronded-14 { + border-radius: 14px; + } + + .btn-arronded-2 { + border-radius: 2px; + } + + .btn-arronded-3 { + border-radius: 3px; + } + + .btn-creamy-txt { + font-family: 'CreamyScriptRegular'; + font-size: 2.2em; + text-transform: none; + } + + .btn-veneer-txt { + font-family: 'Veneer'; + font-size: 2.2em; + text-transform: none; + } \ No newline at end of file diff --git a/resources/sass/front/modules/_magic-check.scss b/resources/sass/front/modules/_magic-check.scss new file mode 100644 index 00000000..5375a3cb --- /dev/null +++ b/resources/sass/front/modules/_magic-check.scss @@ -0,0 +1,380 @@ +/******** Customize Checkbox *********/ +@keyframes default-effect { + 0% { + opacity : 0; + } + to { + opacity : 1; + } +} +.checkbox-wrap { + display: table; + &:hover { + .magic-checkbox { + + label { + &:after { + //display: block; + } + } + } + } + .check { + display: table-cell; + position: relative; + vertical-align: text-top; + height: 20px; width: 20px; + &:hover { + .magic-checkbox { + + label { + &:after { + display: block; + } + } + } + } + } + label { + color: #4e3238; + cursor: pointer; + font-family: 'Catamaran-Regular'; + font-size: 12px; + -webkit-tap-highlight-color: rgba(255, 255, 255, 0); + } + > label { + display: table-cell; + vertical-align: middle; + } + &.blue-checkbox { + .magic-checkbox { + &:checked { + + label { + &:before { + border: #1e5ba1; + background: #1e5ba1; + } + } + } + } + } + &.dark-checkbox { + .magic-checkbox { + &:checked { + + label { + &:before { + border: #4e3238; + background: #4e3238; + } + } + } + } + } + &.big-checkbox { + .check { + height: 46px; + width: 46px; + &:hover { + + label { + &:before { + border-color: #fff; + } + } + } + } + .magic-checkbox { + + label:hover:before { border-color: #fff; } + } + .magic-checkbox, .magic-radio { + + label { + padding-left: 60px; + &:before { + border-color: #fff; + height: 46px; + width: 46px; + } + &:after { + font-size: 21px; + left: 9px; + top: 12px; + // @media #{$minMobile} { + // left: 17px; + // top: 23px; + // } + } + &:hover { + &:before { + border-color: #fff; + } + } + } + } + } + &.checkbox-right { + .check { + padding-left: 15px; + } + .magic-checkbox { + + label { + padding-left: 0; + } + } + } + &.check-2 { + line-height: 24px; + > label { + line-height: 125%; + text-align: left; + } + .magic-checkbox { + + label { + line-height: 125%; + &:before { + border-color: #fff; + } + &:after { + color: #ffb400; + content: "\e903"; + font-size: 24px; + left: 3px; + top: -3px; + } + } + &:checked { + +label { + &:before { + background: #fff; + border-color: #fff; + } + &:after { + + } + } + } + } + } + &.check-3 { + line-height: 24px; + > label { + line-height: 125%; + } + .magic-checkbox { + + label { + &:before { + border-color: #e5dace; + } + &:after { + color: #ffb400; + content: "\e903"; + font-size: 24px; + left: 3px; + top: -6px; + } + } + &:checked { + + label { + &:before { + background: #fff; + border-color: #e5dace; + } + } + } + } + } + &.check-4 { + > label { + line-height: 125%; + } + .magic-checkbox { + + label { + &:before { + background-color: transparent; + border-color: #fff; + } + &:after { + color: #ffb400; + content: "\e903"; + font-size: 24px; + left: 3px; + top: -3px; + } + } + &:checked { + + +label { + &:before { + border-color: #fff; + border-width: 5px; + } + } + } + } + } +} +.dark-bgcolor { + .checkbox-wrap { + label { + color: #fff; + } + } + .magic-checkbox, .magic-radio { + + label { + &:before { + border-color: #fff; + } + } + } +} +.magic-checkbox, .magic-radio { + position: absolute; + display: none; + + label { + cursor: pointer; + display: block; + font-family: 'Catamaran-Regular'; + padding-left: 30px; + position: relative; + vertical-align: middle; + &:before { + content: ''; + display: inline-block; + position: absolute; + left: 0; + top: 0; + height: 20px; + width: 20px; + } + &:after { + content: ''; + display: none; + position: absolute; + } + &:hover { + &:after { + animation-duration: .5s; + animation-fill-mode: both; + animation-name: default-effect; + } + } + } + &[disabled] { + cursor: not-allowed; + + label { + color: #e4e4e4; + cursor: not-allowed; + &:after, &:before, &:hover { cursor: not-allowed; } + &:hover { + &:before { + animation-name: none; + border-color: #e4e4e4; + border-style: solid; + border-width: 1px; + } + } + &:before { border-color: #e4e4e4; } + } + } + &:checked { + + label { + &:before { animation-name: none; } + } + } +} +.magic-checkbox { + + label { + font-size: 12px; + &:before { + background-color: #fff; + border-color: #e5dace; + border-radius: 3px; + border-style: solid; + border-width: 2px; + } + &:after { + border-left: 0; + border-top: 0; + box-sizing: border-box; + color: #e5dace; + content: "\e902"; + font-family: 'icomoon'; + font-size: 9px; + left: 4px; + top: 4px; + } + &:hover { + &:after { + display: block; + } + } + } + &:checked { + &[disabled] { + + label { + &:before { + background: #c9e2f9; + border-color: #c9e2f9; + } + } + } + + label { + &:before { + border: #ffb400; + background: #ffb400; + } + &:after { + color: #fff; + display: block; + } + } + } +} +.magic-radio { + + label { + color: #999595; + font-size: 14px; + line-height: 20px; + &:before { + background-color: #fff; + border-radius: 50%; + } + &:after { + background: #ffb400; + border-radius: 50%; + left: 6px; + top: 6px; + height: 8px; + width: 8px; + } + } + &:checked { + &[disabled] { + + label { + &:before { border-color: #c9e2f9; } + &:after { background: #c9e2f9; } + } + } + + label { + &:before { + + } + &:after { display: block; } + } + } + &.bordered { + + label { + color: #999595; + &:before { + border: 1px solid #999595; + } + &:after {} + } + } + &.bordered-2 { + + label { + color: #e8ded5; + &:before { + border: 1px solid #e8ded5; + } + &:after {} + } + } + +} diff --git a/resources/sass/front/pages/_contact.scss b/resources/sass/front/pages/_contact.scss new file mode 100644 index 00000000..3d80e3ee --- /dev/null +++ b/resources/sass/front/pages/_contact.scss @@ -0,0 +1,346 @@ +.content.contact { + + aside { + float: left; + padding-top: 75px; + padding-bottom: 50px; + width: 36.9%; + + div { + margin-right: 35px; + max-width: 350px; + float: right; + margin-left: 10px; + + p:nth-of-type(1) { + display: block; + font-family: "Veneer"; + font-size: 4.3em; + margin-bottom: 15px; + } + + p:nth-of-type(2) { + font-family: "CreamyScriptRegular"; + font-size: 3.2em; + line-height: 28px; + margin-bottom: 30px; + } + + p:nth-of-type(3) { + color: #ab9d8e; + margin-bottom: 15px; + } + + p:nth-of-type(4) { + font-family: "Catamaran-Bold"; + color: #ab9d8e; + } + } + } + + section { + float: left; + padding-top: 75px; + width: 63.1%; + background-color: #07386a; + padding-left: 100px; + padding-bottom: 85px; + + .text-white { + color: $color1; + } + + h4 { + color: $orange; + font-family: 'CreamyScriptRegular'; + font-size: 4em; + } + + hr { + border: none; + background-color: #1e5ba1; + height: 1px; + margin-bottom: 30px; + } + + label { + color: #fff; + font-family: "Catamaran-Bold"; + font-size: 1.07em; + } + + span { + color: #fff; + } + + .statusMsg { + height: 745px; + + p { + color: #fff; + font-family: "Catamaran-Bold"; + font-size: 2em; + margin-bottom: 25px; + } + } + + .form-contact { + width: 85%; + max-width: 593px; + + .text-danger { + color: $color7; + padding: 1em; + font-size: 1em; + display: block; + } + + .cvc { + input, + label, + span { + display: inline; + color: #fff; + font-family: "Catamaran-Bold"; + margin-right: 10px; + } + + margin-bottom: 20px; + } + + .countries { + display: inline-block; + + select { + font-size: 1em !important; + } + } + + #contactFormError { + display: none; + color: white; + padding: 20px 25px; + background-color: #d8293a; + margin-bottom: 30px; + + i { + margin-right: 10px; + } + } + + .infoLot { + color: white; + font-style: italic; + margin-bottom: 10px; + } + + .error { + background-color: #fcc9c9; + } + + input[type="text"], + input[type="number"], + input[type="tel"], + input[type="email"] { + border: medium none; + border-radius: 2px; + color: #999595; + font-family: "Catamaran-Regular"; + font-size: 1.1em; + margin: 0 13px 20px 0; + padding: 11px 10px; + width: 46.5%; + + &::placeholder { + color: #999595; + } + } + + input[type="number"] { + -moz-appearance: textfield; + } + + input[type="number"]::-webkit-outer-spin-button, + input[type="number"]::-webkit-inner-spin-button { + -webkit-appearance: none; + margin: 0; + } + + .styled-select { + overflow: hidden; + width: 100%; + margin-bottom: 20px; + position: relative; + border-radius: 2px; + + &:before { + color: #ffb504; + font-size: 2em; + display: inline-block; + position: absolute; + right: 15px; + top: 15px; + content: "\f078"; + font-family: "FontAwesome"; + pointer-events: none; + cursor: pointer; + } + + &.countries { + width: 46.5%; + } + + select { + border: medium none; + border-radius: 2px; + color: #999595; + font-family: "Catamaran-Regular"; + font-size: 1.7em; + padding: 11px 10px; + width: 110%; + + &::placeholder { + color: #999595; + } + } + } + + textarea { + border: medium none; + border-radius: 2px; + color: #999595; + font-family: "Catamaran-Regular"; + font-size: 1.1em; + margin: 0px 0 20px 0; + padding: 11px 10px; + width: 100%; + height: 160px; + resize: none; + + &::placeholder { + color: #999595; + } + } + + .formDateQualite { + display: inline-block; + width: 49.5%; + + label { + display: block; + margin-bottom: 10px; + width: 100%; + } + + input { + width: 26%; + } + } + + .champPj { + font-size: 1.5em; + display: flex; + flex-wrap: wrap; + margin-bottom: 35px; + + label { + width: 100px; + display: inline-block; + } + + span.returnFile { + font-family: "CreamyScriptRegular"; + font-size: 1.7em; + margin-left: 15px; + + &.valid::after { + color: #ffb400; + content: "\e902"; + font-family: "icomoon"; + font-size: 0.8em; + margin-left: 5px; + } + + &.unValid::after { + color: #e02125; + content: "\e90a"; + font-family: "icomoon"; + font-size: 0.8em; + margin-left: 5px; + } + } + + .fileUpload { + cursor: pointer; + position: relative; + width: 225px; + height: 79px; + + input[type="file"] { + border: medium none; + box-shadow: none; + cursor: pointer; + height: 100%; + left: 0; + opacity: 0; + padding: 0; + position: absolute; + top: 0; + width: 100%; + z-index: 2; + } + + #btnup { + border: none; + color: #fff; + cursor: pointer; + display: inline-block; + font-family: "Catamaran-Black"; + height: 30px; + margin-bottom: 0; + padding: 3px 10px; + background-color: #ffb400; + border-radius: 2px; + text-transform: uppercase; + width: 100%; + text-align: center; + + i { + font-size: 1.3em; + margin-right: 8px; + vertical-align: sub; + } + } + + span:nth-of-type(2) { + display: block; + font-size: 0.9em; + margin-top: 7px; + } + } + } + + .envoyer { + align-items: center; + display: flex; + justify-content: flex-end; + + span { + margin-right: 2em; + + sup { + color: $orange; + line-height: 2em; + font-family: "Catamaran-Bold"; + font-size: 1.1em; + } + } + + .btn { + width: 200px; + text-transform: uppercase; + } + } + } + } +} diff --git a/resources/sass/main.scss b/resources/sass/main.scss index 7657eb93..b73b03b2 100644 --- a/resources/sass/main.scss +++ b/resources/sass/main.scss @@ -1,11 +1,14 @@ @import "~normalize.css/normalize.css"; @import "~@fortawesome/fontawesome-free/css/all.min.css"; +@import "variables"; @import "front/reset"; @import "front/fonts"; @import "front/body"; @import "front/header"; @import "front/sub_header"; @import "front/footer"; +@import "front/modules/magic-check"; +@import "front/modules/buttons"; .pattern { background-repeat: repeat; @@ -61,8 +64,15 @@ background-color: #64ab4b !important; } +.display { + display: block !important; +} +.display-none { + display: none !important; +} @import "front/pages/home"; +@import "front/pages/contact"; @import "front/pages/products"; @import "front/pages/product"; @import "front/pages/legals"; diff --git a/resources/views/emails/contact-plain.blade.php b/resources/views/emails/contact-plain.blade.php new file mode 100644 index 00000000..ba6d6a56 --- /dev/null +++ b/resources/views/emails/contact-plain.blade.php @@ -0,0 +1,21 @@ +Cette personne à utilisé le formulaire de contact du site legaulois.fr + +Personne : +{{ $data->type->label }} {{ $data->lastname }} {{ $data->firstname }} + +Adresse : +{{ $data->address }} +{{ $data->town }} {{ $data->postal }} + +Contact : +{{ $data->phone }} +{{ $data->email }} + +Sujet : +{{ $data->type->label }} + +Message : +{{ $data->message }} + +Fichier en pièce jointe. + diff --git a/resources/views/emails/contact.blade.php b/resources/views/emails/contact.blade.php new file mode 100644 index 00000000..691ebb16 --- /dev/null +++ b/resources/views/emails/contact.blade.php @@ -0,0 +1,24 @@ + + + + Nouveau Contact Le Gaulois + + + +

Cette personne à utilisé le formulaire de contact du site legaulois.fr

+

Personne : 

+

{{ $data->civility->label }} {{ $data->lastname }} {{ $data->firstname }}

+

Adresse : 

+

{{ $data->address }}

+

{{ $data->town }} {{ $data->postal }}

+

Contact : 

+

{{ $data->phone }}

+

{{ $data->email }}

+

Sujet : 

+

{{ $data->type->label }}

+

Message : 

+

{{ $data->message }}

+

Fichier en pièce jointe.

+ + + diff --git a/resources/views/emails/passerelle-xml.blade.php b/resources/views/emails/passerelle-xml.blade.php new file mode 100644 index 00000000..e68d3d8d --- /dev/null +++ b/resources/views/emails/passerelle-xml.blade.php @@ -0,0 +1,54 @@ + + + + {{ $data ['EMETTEUR_MARQUE'] }} + {{ $data ['EMETTEUR_DATE'] }} + {{ $data ['EMETTEUR_HEURE'] }} + {{ $data ['EMETTEUR_CIVILITE'] }} + + + + + + + + + + + + + + + + + + + {{ $data ['EMETTEUR_PAYS'] }} + {{ $data ['EMETTEUR_EMAIL'] }} + + + {{-- {{ $data ['EMETTEUR_OBJETDEMANDE'] }} --}} + + + + + + + {{ $data ['EMETTEUR_DATE_LIMITE_CONSO'] }} + + + {{-- {{ $data ['EMETTEUR_OPT_IN'] }} --}} + + + + + + {{-- {{ $data ['REPONSE_ETAT'] }} + {{ $data ['TYPE_REPONSE'] }} --}} + {{ $data ['DATE_CONSO'] }} + + + + + + diff --git a/resources/views/front/contact/contact-form.blade.php b/resources/views/front/contact/contact-form.blade.php new file mode 100644 index 00000000..2dd1c9fc --- /dev/null +++ b/resources/views/front/contact/contact-form.blade.php @@ -0,0 +1,143 @@ +
+ @csrf + +

+ @include('front.icons.exclamation-triangle') + {{ __('Merci de compléter correctement les champs du formulaire.') }} +

+ +

{{ __('Mes coordonnées') }}

+ +

+ {{ __('Civilité') }} + @foreach(ContactFormCivility::toArray() as $ctCivValue => $ctCivLabel) + + + @endforeach + @if($errors->default->has('civility')){{ implode('
', $errors->default->get('civility')) }}
@endif +

+ +

+ {{-- // TODO test user data from logged --}} + + @if($errors->default->has('lastname')){{ implode('
', $errors->default->get('lastname')) }}
@endif + + @if($errors->default->has('firstname')){{ implode('
', $errors->default->get('firstname')) }}
@endif + + @if($errors->default->has('address')){{ implode('
', $errors->default->get('address')) }}
@endif + + @if($errors->default->has('email')){{ implode('
', $errors->default->get('email')) }}
@endif + + @if($errors->default->has('postal')){{ implode('
', $errors->default->get('postal')) }}
@endif + + @if($errors->default->has('town')){{ implode('
', $errors->default->get('town')) }}
@endif + + @if($errors->default->has('phone')){{ implode('
', $errors->default->get('phone')) }}
@endif +

+ +
+ + @if($type->equals(ContactFormType::recipe())) +

{{ __('Proposez votre recette') }} :

+ @elseif($type->equals(ContactFormType::abuse())) +

{{ __('Signaler un abus') }} :

+ @elseif($type->equals(ContactFormType::complain())) +

{{ __('Réclamation Produit') }} :

+ @else +

{{ __('Votre question concerne')}} :

+ @endif +@if($type->equals(ContactFormType::complain())) + +@else +
+ + @if($errors->default->has('type')){{ implode('
', $errors->default->get('type')) }}
@endif +
+ @endif + + @if($type->equals(ContactFormType::complain())) +
+

+ + + + +

+ +

+ @include('front.icons.info-circle') + {{ __('Vous pouvez également trouver le n° de lot sous la dénomination "n° de tracabilité" ou "n° trac".') }} +

+ +

+ + + + +

+

+ + + + +

+
+ +
+ +
+ + + @include('front.icons.icon-upload') + {{ __('Ajouter un fichier') }} + + {{ __('Formats acceptés') }} : jpg, png, pdf
{{ __('Taille max') }} : {{ __(':datasize Mo', ['datasize' => 3]) }}
+
+ + @if($errors->default->has('joinFile')){{ implode('
', $errors->default->get('joinFile')) }}
@endif +
+ @endif + +

+ + @if($errors->default->has('message')){{ implode('
', $errors->default->get('message')) }}
@endif +

+ +

+ *{{ __('Champs obligatoires') }} + +

+
+ +@push('scripts') + +@endpush + diff --git a/resources/views/front/contact/contact.blade.php b/resources/views/front/contact/contact.blade.php new file mode 100644 index 00000000..501a8af6 --- /dev/null +++ b/resources/views/front/contact/contact.blade.php @@ -0,0 +1,44 @@ +@extends('layouts.app') +@section('title', __('Formulaire de contact')) +@section('description', __('Envie de partager une remarque, une idée avec nous, de poser une question : n\'hésitez pas à compléter le formulaire de contact.')) + +@section('sub_header') +
+
+

{{ __('Contactez-nous') }}

+
+
+@endsection + +@section('content') +
+ +
+ {{-- IF MAIL IS SENT --}} + @if(!is_null($status)) +
+ @if($status) +

{{ __('Votre message a été envoyé avec succès.') }}

+ @else +

{{ __('Une erreur est survenue durant l\'envoi de votre message. Veuillez réessayer ultèrieurement.') }}

+ @endif + {{ __('Retour à l\'accueil') }} +
+ @else + @if(!$type->equals(ContactFormType::complain())) +

{{ __('Si vous désirez plutôt envoyer une réclamation utilisez ce lien') }}
+ {{ __('Envoyer une réclamation') }}

+
+ @endif + @include('front.contact.contact-form') + @endif +
+
+@endsection + diff --git a/resources/views/front/contact/contactComplain.blade.php b/resources/views/front/contact/contactComplain.blade.php new file mode 100644 index 00000000..70282892 --- /dev/null +++ b/resources/views/front/contact/contactComplain.blade.php @@ -0,0 +1,40 @@ +@extends('layouts.app') +@section('title', __('Formulaire de contact')) +@section('description', __('Envie de partager une remarque, une idée avec nous, de poser une question : n\'hésitez pas à compléter le formulaire de contact.')) + +@section('sub_header') +
+
+

{{ __('Contactez-nous') }}

+
+
+@endsection + +@section('content') +
+ +
+ {{-- IF MAIL IS SENT --}} + @if(!is_null($status)) +
+ @if($status) +

{{ __('Votre message a été envoyé avec succès.') }}

+ @else +

{{ __('Une erreur est survenue durant l\'envoi de votre message. Veuillez réessayer ultèrieurement.') }}

+ @endif + {{ __('Retour à l\'accueil') }} +
+ @else + {{ __('Envoyer une réclamation') }} + @include('front.contact.contact-form') + @endif +
+
+@endsection + diff --git a/resources/views/front/icons/chevron-down.blade.php b/resources/views/front/icons/chevron-down.blade.php new file mode 100644 index 00000000..4c6a89c3 --- /dev/null +++ b/resources/views/front/icons/chevron-down.blade.php @@ -0,0 +1,3 @@ + diff --git a/resources/views/front/icons/exclamation-triangle.blade.php b/resources/views/front/icons/exclamation-triangle.blade.php new file mode 100644 index 00000000..7cdfd7d5 --- /dev/null +++ b/resources/views/front/icons/exclamation-triangle.blade.php @@ -0,0 +1,3 @@ + diff --git a/resources/views/front/icons/icon-upload.blade.php b/resources/views/front/icons/icon-upload.blade.php new file mode 100644 index 00000000..1bfafd27 --- /dev/null +++ b/resources/views/front/icons/icon-upload.blade.php @@ -0,0 +1,3 @@ + diff --git a/resources/views/front/icons/info-circle.blade.php b/resources/views/front/icons/info-circle.blade.php new file mode 100644 index 00000000..42442f4a --- /dev/null +++ b/resources/views/front/icons/info-circle.blade.php @@ -0,0 +1,3 @@ + diff --git a/resources/views/layouts/app.blade.php b/resources/views/layouts/app.blade.php index 54addb8f..05af02f5 100644 --- a/resources/views/layouts/app.blade.php +++ b/resources/views/layouts/app.blade.php @@ -43,7 +43,7 @@ @yield('content') @include('layouts.app-footer') -@yield('scripts') +@stack('scripts') diff --git a/routes/web.php b/routes/web.php index 101d5e2c..c70b2047 100644 --- a/routes/web.php +++ b/routes/web.php @@ -99,18 +99,15 @@ Route::get('/deconnexion', 'CustomerController@logout')->name('deconnexion')->mi Route::get('/reinitialiser-mdp', 'CustomerController@passwordReset')->name('reinit-mdp'); Route::post('/change-mdp/{token}', 'CustomerController@changePassword')->name('change-mdp'); -Route::get('/contactez-nous', function (){ - die('Nous contacter'); -})->name('contact-us'); +Route::get('/contactez-nous', 'ContactController@contact')->name('contact-us'); +Route::post('/contactez-nous', 'ContactController@contactSubmit')->name('contact-us.submit'); +Route::get('/reclamation-produit', 'ContactController@complain')->name('product-request'); +Route::post('/reclamation-produit', 'ContactController@complainSubmit')->name('product-request.submit'); Route::get('/faq', function (){ die('FAQ'); })->name('faq'); -Route::get('/reclamation-produit', function (){ - die('reclamation-produit'); -})->name('product-request'); - Route::get('/mentions-legales', function (){ return view('front.legals'); })->name('legal-notice'); diff --git a/storage/msg_conso/arch_message_arcadia/.gitignore b/storage/msg_conso/arch_message_arcadia/.gitignore new file mode 100644 index 00000000..72e8ffc0 --- /dev/null +++ b/storage/msg_conso/arch_message_arcadia/.gitignore @@ -0,0 +1 @@ +* diff --git a/storage/msg_conso/arch_message_passerelle/.gitignore b/storage/msg_conso/arch_message_passerelle/.gitignore new file mode 100644 index 00000000..72e8ffc0 --- /dev/null +++ b/storage/msg_conso/arch_message_passerelle/.gitignore @@ -0,0 +1 @@ +*