]> _ Git - pmi.git/commitdiff
wip #2782 @6
authorVincent Vanwaelscappel <vincent@cubedesigners.com>
Fri, 12 Jul 2019 18:31:13 +0000 (20:31 +0200)
committerVincent Vanwaelscappel <vincent@cubedesigners.com>
Fri, 12 Jul 2019 18:31:13 +0000 (20:31 +0200)
25 files changed:
.editorconfig
app/Http/Controllers/AjaxController.php [new file with mode: 0644]
app/Http/Controllers/FormController.php [new file with mode: 0644]
app/Models/Product.php
app/Models/Settings.php
app/Providers/AppServiceProvider.php
app/SubForms/FormField.php [new file with mode: 0644]
app/Templates/Base.php
app/Templates/Services.php
app/Templates/Text.php
package.json
resources/js/bootstrap.js
resources/js/components/Form.vue [new file with mode: 0644]
resources/js/mailform.js [new file with mode: 0644]
resources/styles/components/form.styl [new file with mode: 0644]
resources/views/layouts/app.blade.php
resources/views/pages/product-detail.blade.php
resources/views/pages/products.blade.php
resources/views/pages/services.blade.php
resources/views/pages/text.blade.php
resources/views/partials/form.blade.php [new file with mode: 0644]
resources/views/partials/intro.blade.php
routes/web.php
webpack.mix.js
yarn.lock

index 7c5cbccb67185c0be8ad2127d005e1805a481111..7cf71f6b45205143513bb41c60da82ba475c4a08 100644 (file)
@@ -17,5 +17,5 @@ indent_size = 2
 [*.styl]
 indent_size = 2
 
-[*.js]
-indent_size = 2
+;[*.js]
+;indent_size = 5
diff --git a/app/Http/Controllers/AjaxController.php b/app/Http/Controllers/AjaxController.php
new file mode 100644 (file)
index 0000000..d875771
--- /dev/null
@@ -0,0 +1,56 @@
+<?php
+
+
+namespace App\Http\Controllers;
+
+
+use App\Models\Page;
+use Cubist\Backpack\app\Http\Controllers\CubistFrontController;
+use Cubist\Backpack\app\Magic\PageData;
+use Illuminate\Http\Request;
+use Illuminate\Support\Facades\Mail;
+
+class AjaxController extends CubistFrontController
+{
+    public function mailform(Request $request)
+    {
+        $data = $request->all();
+        /** @var PageData $page */
+        $page = Page::find($data['page'])->getPageData();
+
+        $validation = [];
+
+        foreach ($page->get('form') as $field) {
+            $v = [];
+            if ($field['mandatory']) {
+                $v[] = 'required';
+            }
+            if ($field['type'] == 'email') {
+                $v[] = 'email';
+            }
+            if (count($v)) {
+                $validation[$field['type']] = implode('|', $v);
+            }
+        }
+
+        $validatedData = $request->validate($validation);
+
+        $labels = ['firstname' => 'Prénom', 'name' => 'Nom', 'company' => 'Société', 'sku' => 'Numéro de série', 'ref' => 'Reference', 'email' => 'Adresse e-mail', 'message' => 'Message'];
+        $contents = [];
+        foreach ($labels as $key => $label) {
+
+            if (isset($validatedData[$key])) {
+                $contents[] = $label . ' : ' . $validatedData[$key];
+            }
+        }
+
+        Mail::raw(implode("\r\n", $contents), function ($message) use ($validatedData) {
+            $message->from(config('mail.from.address'), config('mail.from.name'));
+            $message->sender(config('mail.from.address'), config('mail.from.name'));
+            $message->replyTo($validatedData['email']);
+            $message->subject($validatedData['subject']);
+        });
+
+        echo 'ok :)';
+    }
+}
diff --git a/app/Http/Controllers/FormController.php b/app/Http/Controllers/FormController.php
new file mode 100644 (file)
index 0000000..a1a6083
--- /dev/null
@@ -0,0 +1,10 @@
+<?php
+
+
+namespace App\Http\Controllers;
+
+
+class FormController
+{
+
+}
index 71a71f4d1dbd1e5d6e0d024fe0da38b009855623..d8face926f11c69db803b5b0f03554abb5a5da94 100644 (file)
@@ -254,11 +254,12 @@ class Product extends CubistMagicModel
 
         foreach ($myspecs as $spec) {
             $specEntity = $allspecs[$spec];
+
             $val = Json::decodeRecursive($this->{'s_' . Str::snake($specEntity->name)}, Json::TYPE_ARRAY);
             $specValue = ' - ';
             if ($specEntity->type == 'numeric' || $specEntity->type == 'numeric_list') {
                 $specValue = $specEntity->prefix;
-                if ($specEntity->type == 'numeric_list') {
+                if ($specEntity->type == 'numeric_list' && is_array($val)) {
                     $specValue .= ' ' . implode(' ' . $specEntity->separator . ' ', $val);
                 } else {
                     $specValue = $val;
@@ -267,14 +268,15 @@ class Product extends CubistMagicModel
             } else if ($specEntity->type == 'text') {
                 $specValue = trim($val);
             } else if ($specEntity->type == 'range') {
+
                 $specValue = $val['first'] . ' ' . __('à') . ' ' . $val['second'] . ' ' . $specEntity->unit;
             } else if ($specEntity->type == 'list') {
-                $option=Json::decodeRecursive($specEntity->options, Json::TYPE_ARRAY)[$val];
-                $locale=App::getLocale();
-                if(!isset($option->$locale) || !$option->$locale){
-                    $specValue=$option->fr;
-                }else{
-                    $specValue=$option->$locale;
+                $option = Json::decodeRecursive($specEntity->options, Json::TYPE_ARRAY)[$val];
+                $locale = App::getLocale();
+                if (!isset($option[$locale]) || !$option[$locale]) {
+                    $specValue = $option['fr'];
+                } else {
+                    $specValue = $option[$locale];
                 }
             }
             $res[$specEntity->label] = $specValue;
index fa5c6f4d2092f2397762d0f520118fa97c1b2519..dd6179117683c8b8e617121d9e51760d6ac4c25e 100644 (file)
@@ -35,5 +35,13 @@ class Settings extends \Cubist\Backpack\app\Magic\Models\Settings
             'label' => __('Réseaux Sociaux'),
             'tab' => __('Réseaux Sociaux'),
         ]);
+
+        // === Forms
+        $this->addField([
+            'name' => 'form_privacy',
+            'type' => 'Markdown',
+            'label' => 'Mention légale vie privée affichée sous les formulaires',
+            'tab' => 'Formulaires',
+        ]);
     }
 }
index 54a17741b9df265b8db48ef9c3e36fefef528009..7f873af21d98f2e00e3e13f65ae40c92e0672726 100644 (file)
@@ -36,6 +36,7 @@ class AppServiceProvider extends ServiceProvider
         try {
             // Blade Include Aliases
             Blade::include('partials.intro', 'intro'); // @intro()
+            Blade::include('partials.form', 'form'); // @form()
 
             // BladeX Component Aliases
             // Ref: https://docs.spatie.be/laravel-blade-x/v2/introduction
diff --git a/app/SubForms/FormField.php b/app/SubForms/FormField.php
new file mode 100644 (file)
index 0000000..a69d631
--- /dev/null
@@ -0,0 +1,24 @@
+<?php
+
+
+namespace App\SubForms;
+
+
+use Cubist\Backpack\app\Magic\SubForm;
+
+class FormField extends SubForm
+{
+    public function init()
+    {
+        parent::init();
+
+        $this->addField(['name' => 'type',
+            'type' => 'SelectFromArray',
+            'options' => ['firstname' => 'Prénom', 'name' => 'Nom', 'company' => 'Société', 'email' => 'Email', 'ref' => 'Référence', 'sku' => 'Numéro de série', 'subject' => 'Sujet', 'message' => 'Message'],
+            'label' => 'Type de champ']);
+
+        $this->addField(['name' => 'mandatory',
+            'type' => 'Checkbox',
+            'label' => 'Obligatoire']);
+    }
+}
index 0d65d707aab6a96fd103c63ee022a2d9283f3e77..d12deb93157b27ea6c481ac782f2140b45d6f04c 100644 (file)
@@ -25,4 +25,41 @@ class Base extends TemplatePage
         return false;
     }
 
+    public function addForm()
+    {
+        $tab = 'Formulaire';
+
+        $this->addField(['name' => 'form',
+            'type' => 'Textarea',
+            'label' => 'Texte d\'introduction du formulaire',
+            'tab' => $tab]);
+
+        $this->addField([
+            'name' => 'form',
+            'type' => 'BunchOfFieldsMultiple',
+            'bunch' => 'App\SubForms\FormField',
+            'label' => 'Champs du formulaire',
+            'tab' => $tab,
+        ]);
+
+        $this->addField(['name' => 'form_confirmation',
+            'type' => 'Text',
+            'label' => 'Message de confirmation',
+            'hint' => 'Affiché au visiteur une fois le formulaire envoyé',
+            'tab' => $tab]);
+
+        $this->addField(['name' => 'form_destination',
+            'type' => 'Tags',
+            'label' => 'Destinataires du formulaire',
+            'tab' => $tab]);
+
+        $this->addField(['name' => 'form_prefix',
+            'type' => 'Text',
+            'label' => 'Prefixe',
+            'hint' => 'Apparaît au début du sujet de l\'email sous la forme : [Prefixe] Sujet de l\'email',
+            'tab' => $tab]);
+
+
+    }
+
 }
index fb95193c6d480e34eb2e8925d59e7ce43e71a1ff..93c55afa59a9bb7f5938ea7893c837996d31aa5e 100644 (file)
@@ -24,10 +24,12 @@ class Services extends Base
     public function init()
     {
         parent::init();
-        $this->addField(['name' => 'test',
-            'type' => 'Text',
-            'label' => 'Super !',
-            'tab' => 'Contenus'
-        ]);
+
+        $this->addField(['name' => 'content',
+            'type' => 'Markdown',
+            'label' => 'Texte',
+            'tab'=>'Contenus']);
+
+        $this->addForm();
     }
 }
index c17bd720cfe590389df724fce85e7318645c8d0c..27bffed6e6487913ad5ccbed254999af15b6ea50 100644 (file)
@@ -4,10 +4,23 @@
 namespace App\Templates;
 
 
-class Text extends Base
+use Cubist\Backpack\app\Template\TemplatePage;
+
+class Text extends TemplatePage
 {
     public function getName()
     {
         return 'Page de texte';
+
+    }
+
+    public function init()
+    {
+        parent::init(); // TODO: Change the autogenerated stub
+
+        $this->addField(['name' => 'content',
+            'type' => 'Markdown',
+            'label' => 'Contenus',
+            'tab'=>'Contenus']);
     }
 }
index 6310d35d9a84f4737200d15a9065fd5f79e451b0..d693e9eaca16ee4c54e3dab75ac1c94764d9ad54 100644 (file)
@@ -30,6 +30,7 @@
         "tailwindcss": "^1.0.4",
         "vue": "^2.6.10",
         "vue-slide-up-down": "^1.7.2",
-        "vue-template-compiler": "^2.6.10"
+        "vue-template-compiler": "^2.6.10",
+        "parsleyjs": "^2.9.1"
     }
 }
index 4e36bfcf9217592a2e18656fa25bb25e52e4697d..a1a15537d60777b8c289af2d84a516860bc1755c 100644 (file)
@@ -10,6 +10,7 @@ window._ = require('lodash');
 try {
     //window.Popper = require('popper.js').default;
     window.$ = window.jQuery = require('jquery');
+    require('parsleyjs');
 
     //require('bootstrap');
 } catch (e) {}
diff --git a/resources/js/components/Form.vue b/resources/js/components/Form.vue
new file mode 100644 (file)
index 0000000..f615714
--- /dev/null
@@ -0,0 +1,28 @@
+<template>
+
+</template>
+
+<script>
+    export default {
+        name: 'Form',
+        props:['required_fields','send','page_id','fields'],
+        methods: {
+            submit() {
+                this.errors = {};
+                axios.post('/mailform', this.fields).then(response => {
+                    alert('Message sent!');
+                }).catch(error => {
+                    if (error.response.status === 422) {
+                        this.errors = error.response.data.errors || {};
+                    }
+                });
+            },
+        }
+    }
+
+
+</script>
+
+<style scoped>
+
+</style>
diff --git a/resources/js/mailform.js b/resources/js/mailform.js
new file mode 100644 (file)
index 0000000..28b3950
--- /dev/null
@@ -0,0 +1,25 @@
+$(function () {
+    console.log('mailform.js loaded');
+    $.ajaxSetup({
+        headers: {
+            'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content')
+        }
+    });
+
+    $(document).on('submit', 'form.mailform', function () {
+        var form = $(this);
+        var button = $(this).find('button[type="submit"]');
+        button.text(button.data('sending'));
+        $.ajax({
+            url: $(this).attr('action'),
+            type: $(this).attr('method'),
+            data: $(this).serialize(),
+            success: function (response) {
+                $(form).closest('#contact-form').html('<p>' + $(form).data('confirmation') + '</p>');
+            },
+        });
+        return false;
+    });
+
+});
+
diff --git a/resources/styles/components/form.styl b/resources/styles/components/form.styl
new file mode 100644 (file)
index 0000000..4557974
--- /dev/null
@@ -0,0 +1,34 @@
+$h3 = 24px
+$h2 = 36px
+$barlow = 'Barlow', sans-serif
+$muli = 'Muli', sans-serif
+$dark = #6B7287
+$lightgrey = #F7F8FC
+$darkblue = #152F4E
+$lightblue = #0EAADA
+$verylightgrey = #E7E9F3
+
+#contact-form
+  .form
+    input, textarea
+      border-radius 3px
+      color: $dark
+      padding 12px 10px
+
+    label
+      font-family: $barlow
+
+    .textarea
+      height 144px
+
+    &-endmessage
+      font-size: 14px
+
+    .btn-custom
+      padding 1.125rem 5.375rem
+
+    .mr-form
+      margin-right: 2.5vw
+
+    *:focus
+      outline-color $verylightgrey
index 115599d40d41ef55e29c28cea29669b2d1aa8021..9e5a636e0fb13a7298f2c29fd98aa86d0b3b82dd 100644 (file)
@@ -1,17 +1,17 @@
-@include('cubist::head.htmldeclaration')
-<head>
-    {{--@include('cubist::head.head')--}}
-    <meta http-equiv="x-ua-compatible" content="ie=edge">
-    <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
-    <meta name="csrf-token" content="{{ csrf_token() }}">
-
+@prepend('stylesheets')
     <link href="{{ mix('css/app.css') }}" rel="stylesheet">
     <link href="https://fonts.googleapis.com/css?family=Barlow:500,600|Muli:400,700&display=swap" rel="stylesheet">
-</head>
+@endprepend
+
+@prepend('scripts')
+    <script src="{{ mix('/js/app.js') }}"></script>
+@endprepend
+
+@include('cubist::head.htmldeclaration')
+@include('cubist::head.head')
 <body class="template-{{ $view_name }} {{ $body_class ?? '' }} font-body text-grey-dark">
 @include('cubist::body.begin')
 
-
 @php
     //#### Generate temporary cart data
     $cart_items = [];
@@ -34,7 +34,7 @@
         @if(CubistMenu::get('breadcrumbs')->active())
             <full-width padding="pt-1v pb-1v">
                 <content>
-                        {!! CubistMenu::get('breadcrumbs')->crumbMenu()->asDiv(['class' => 'breadcrumbs'], [], ['class' => 'breadcrumbs-item']) !!}
+                    {!! CubistMenu::get('breadcrumbs')->crumbMenu()->asDiv(['class' => 'breadcrumbs'], [], ['class' => 'breadcrumbs-item']) !!}
                 </content>
             </full-width>
         @endif
 
     <div class="body-overlay" @click="closeCart"></div>
 </div>
-
-
-<script src="{{ mix('/js/app.js') }}"></script>
-
 @include('cubist::body.end')
 </body>
 </html>
index b8447bbf9fef10e12c6592f0b017f30511c3d24a..48832b5ceef1722c440c8c0b457a88a9518b0baa 100644 (file)
@@ -35,7 +35,7 @@
 
             {{-- Product text --}}
             <text-block class="product-detail-text sm:mt-6">
-                {!! Markdown::parse($product->highlights) !!}
+                @markdown($product->highlights)
 
                 <p class="mt-4">
                     <a href="{{$product->getMediaUrl('technical_sheet','#emtpy')}}">
@@ -60,7 +60,7 @@
 
             @if ($product->descriptions)
                 <tab name="{{ __('Description') }}">
-                    {!! Markdown::parse($product->descriptions) !!}
+                    @markdown($product->descriptions)
                 </tab>
             @endif
 
 
             @if ($product->dimensions)
                 <tab name="{{ __('Dimensions') }}">
-                    {!! Markdown::parse($product->dimensions) !!}
+                    @markdown($product->dimensions)
                 </tab>
             @endif
 
             @if ($product->options)
                 <tab name="{{ __('Options') }}">
-                    {!! Markdown::parse($product->options) !!}
+                    @markdown($product->options)
                 </tab>
             @endif
 
             @if ($product->accessories)
                 <tab name="{{ __('Accessoires') }}">
-                    {!! Markdown::parse($product->accessories) !!}
+                    @markdown($product->accessories)
                 </tab>
             @endif
 
                             <div class="p-4">
                                 <h3>{{$rel->name}}</h3>
                                 <div class="text-sm">
-                                    {!! Markdown::parse($rel->highlights) !!}
+                                    @markdown($rel->highlights)
                                 </div>
                                 <p class="mt-4">
                                     <a href="{{$nav->findOneById('product/'.$rel->id)->getHref()}}">{{__('Voir la fiche produit')}}</a>
index 25e0dd1b140079ccd2a036576a257b3ab853eb42..5d63af7e015dd6e0064e9d81c5df4e95395ba71c 100644 (file)
                             <div class="p-4">
                                 <h3>{{$product->get('name')}}</h3>
                                 <div class="text-sm">
-                                    {!! Markdown::parse($product->highlights) !!}
+                                    @markdown($product->highlights)
                                 </div>
                                 <p class="mt-4">
                                     <a href="{{$nav->findOneById('product/'.$product->id)->getHref()}}">Voir la fiche
index 93ffa1beed7c8bd33310be842c591c6e7149ba62..684b2deab12515d73036fe4ab4125c6378ec595f 100644 (file)
@@ -1,2 +1,20 @@
 @extends('layouts.app')
-@section('title' ,'Services')
+@section('content')
+    @intro(['padding' => 'pb-4v'])
+
+    <full-width padding="pb-4v">
+        <content>
+            <columns>
+                <column>
+                    <text-block>
+                        @markdown($page->content)
+                    </text-block>
+
+                </column>
+                <column class="bg-grey-200 p-10">
+                    @form
+                </column>
+            </columns>
+        </content>
+    </full-width>
+@endsection
index f3c47b49ac3999548499240b17c5a996696f103e..3abde2b5e3e8455b0ff79b42fc13a1e1adcc57fd 100644 (file)
@@ -5,23 +5,7 @@
 
     <full-width padding="pb-4v">
         <content>
-            <columns>
-                <column>
-                    <img src="{{ asset('storage/uploads/images/home-wing.jpg') }}" alt="">
-                </column>
-
-                <column>
-                    <text-block class="pt-2v" title_class="h1 overlap-left" :title="isset($name) ? ucfirst($name) : 'Lorem ipsum'">
-
-                        <p>Lorem ipsum dolor sit amet, consectetur adipisicing elit. Accusamus aperiam aspernatur corporis dicta dolore, earum est et eum eveniet, harum minima non, pariatur perspiciatis possimus ratione repudiandae veniam voluptas. Aspernatur eius esse laudantium nostrum nulla?</p>
-
-                        <p>Sit amet, consectetur adipisicing elit. Aut cum dolores ratione vel. Alias exercitationem obcaecati quae! Accusantium alias, aspernatur atque autem beatae commodi delectus dolores esse, exercitationem facere illo itaque iusto libero magni natus nemo obcaecati odit officia quia quibusdam reiciendis soluta suscipit unde ut veritatis, voluptate voluptatibus.</p>
-
-                        <p><a href="#">En savoir plus</a></p>
-                    </text-block>
-
-                </column>
-            </columns>
+            @markdown($page->get('content'))
         </content>
 
     </full-width>
diff --git a/resources/views/partials/form.blade.php b/resources/views/partials/form.blade.php
new file mode 100644 (file)
index 0000000..a6e6a9a
--- /dev/null
@@ -0,0 +1,66 @@
+@push('scripts')
+    <script src="{{ mix('/js/mailform.js') }}"></script>
+@endpush
+
+<div id="contact-form">
+    <div class="form flex flex-col">
+        <p class="form-info text-navy">{{$page->get('form_intro')}}</p>
+        <form class="flex flex-col text-navy mailform" action="/ajax/mailform" method="post"
+              data-confirmation="{{$page->get('form_confirmation')??__('Votre message a bien été envoyé')}}">
+            {{ csrf_field() }}
+            <input type="hidden" value="{{$page->get('id')}}" name="page">
+            @foreach($page->get('form') as $field)
+                @php
+                    $required=$field['mandatory']?' required':'';
+                    $asx=$field['mandatory']?' *':'';
+                @endphp
+                <label class="form-input flex flex-col mr-form">
+
+                    @switch($field['type'])
+                        @case('name')
+                        {{__('Nom')}}{{$asx}} <input class="py-3 mt-3" type="text" {!! $required !!}  name="name">
+                        @break
+
+                        @case('firstname')
+                        {{__('Prénom')}}{{$asx}} <input class="py-3 mt-3" type="text" {!! $required !!}  name="firstname">
+                        @break
+
+                        @case('company')
+                        {{__('Société')}}{{$asx}} <input class="py-3 mt-3" type="text" {!! $required !!}  name="company">
+                        @break
+
+                        @case('email')
+                        {{__('E-mail')}}{{$asx}} <input class="py-3 mt-3" type="email" {!! $required !!}  name="email">
+                        @break
+
+                        @case('ref')
+                        {{__('Référence')}}{{$asx}} <input class="py-3 mt-3" type="text" {!! $required !!}  name="ref">
+                        @break
+
+                        @case('sku')
+                        {{__('Numéro de série')}}{{$asx}} <input class="py-3 mt-3" type="text" {!! $required !!}  name="sku">
+                        @break
+
+                        @case('subject')
+                        {{__('Sujet')}}{{$asx}} <input class="py-3 mt-3" type="text" {!! $required !!}  name="subject">
+                        @break
+
+                        @case('message')
+                        {{__('Message')}}{{$asx}} <textarea class="py-3 textarea mt-3" type="text"
+                                                    {!! $required !!}  name="message"></textarea>
+                        @break
+                    @endswitch
+                </label>
+            @endforeach
+
+            <div class="form-endmessage mt-5 text-grey-dark">
+                @markdown($global->get('form_privacy'))
+            </div>
+            <div class="flex justify-between items-center xs:flex-col-reverse">
+                <span class="text-grey-dark xs:self-start xs:mt-5">*{{__('Champs obligatoires')}}</span>
+                <button type="submit" class="btn btn-custom xs:w-full"
+                        data-sending="{{__('Envoi en cours')}}">{{__('Envoyer')}}</button>
+            </div>
+        </form>
+    </div>
+</div>
index 5f493454894c3117c9adad5cba3f26453621c5cd..36752353b5a6a640740bfcbb405753834f6099c2 100644 (file)
@@ -4,7 +4,7 @@
     // $name is the name of the page data to fetch. If it's not set, assume it is 'intro'
     $name = $name ?? 'intro';
 
-    $title = $page->get("$name.title", '');
+    $title = \Illuminate\Support\Str::ucfirst($page->get("$name.title", ''));
     $image = $page->getImageURL("$name.image");
     $class = $class ?? '';
     $padding = $padding ?? null; // Pass null so it doesn't override default padding
index 98309b7d07b8baac988202d4bc015e18abd32d83..b24ceec10bd557c1ccc7072e2a435cd78886669d 100644 (file)
@@ -1,4 +1,4 @@
 <?php
 
-Route::get('{page}/{subs?}', ['uses' => 'PageController@catchall'])
+Route::any('{page}/{subs?}',  'PageController@catchall')
     ->where(['page' => '^(((?=(?!admin))(?=(?!\/)).))*$', 'subs' => '.*']);
index 8ad959b132f3fb6f6500c8ccf2d331b6aa05701f..25ac50f8a12074fb1eb68d2bf1a5bbc94a370302 100644 (file)
@@ -14,34 +14,36 @@ require('laravel-mix-purgecss');
  */
 
 mix.browserSync({
-  proxy: process.env.APP_URL,
-  open: false // Don't automatically open a new tab when the watcher starts
+    proxy: process.env.APP_URL,
+    open: false // Don't automatically open a new tab when the watcher starts
 });
 
 mix.js('resources/js/app.js', 'public/js')
-   .stylus('resources/styles/app.styl', 'public/css', {
+    .stylus('resources/styles/app.styl', 'public/css', {
         use: [
             require('rupture')()
         ]
     }).options({
-        postCss: [
-            tailwindcss('tailwind.config.js'),
-            require('lost'),
-        ],
-        // autoprefixer: {
-        //   options: {
-        //     grid: true, // Enable CSS grid prefixes for IE
-        //   }
-        // }
-    })
+    postCss: [
+        tailwindcss('tailwind.config.js'),
+        require('lost'),
+    ],
+    // autoprefixer: {
+    //   options: {
+    //     grid: true, // Enable CSS grid prefixes for IE
+    //   }
+    // }
+})
     .purgeCss({
-      globs: [
-        path.join(__dirname, 'vendor/cubist/**/*.php'), // Some classes (eg. nav) might be present only here
-      ],
-      whitelistPatterns: [/grid-.*/], // Don't purge the grid-* custom classes since they can be used dynamically
+        globs: [
+            path.join(__dirname, 'vendor/cubist/**/*.php'), // Some classes (eg. nav) might be present only here
+        ],
+        whitelistPatterns: [/grid-.*/], // Don't purge the grid-* custom classes since they can be used dynamically
     });
 
+mix.js('resources/js/mailform.js', 'public/js');
+
 // Enable unique hashed filenames when in production
 if (mix.inProduction()) {
-  mix.version();
+    mix.version();
 }
index 5a1eb1ccf2941164f2a620c8fe6ec389c0ac1bc0..44c1bad3b11a8215968a18c85ffb59770bc37f09 100644 (file)
--- a/yarn.lock
+++ b/yarn.lock
@@ -1990,7 +1990,7 @@ create-hmac@^1.1.0, create-hmac@^1.1.2, create-hmac@^1.1.4:
     safe-buffer "^5.0.1"
     sha.js "^2.4.8"
 
-cross-env@^5.1:
+cross-env@^5.2.0:
   version "5.2.0"
   resolved "https://registry.yarnpkg.com/cross-env/-/cross-env-5.2.0.tgz#6ecd4c015d5773e614039ee529076669b9d126f2"
   integrity sha512-jtdNFfFW1hB7sMhr/H6rW1Z45LFqyI431m3qU6bFXcQ3Eh7LtBuG3h74o7ohHZ3crrRkkqHlo4jYHFPcjroANg==
@@ -3152,7 +3152,7 @@ glob-to-regexp@^0.3.0:
   resolved "https://registry.yarnpkg.com/glob-to-regexp/-/glob-to-regexp-0.3.0.tgz#8c5a1494d2066c570cc3bfe4496175acc4d502ab"
   integrity sha1-jFoUlNIGbFcMw7/kSWF1rMTVAqs=
 
-glob@^7.0.3, glob@^7.0.5, glob@^7.1.1, glob@^7.1.2, glob@^7.1.3, glob@~7.1.2:
+glob@^7.0.3, glob@^7.0.5, glob@^7.1.1, glob@^7.1.2, glob@^7.1.3:
   version "7.1.4"
   resolved "https://registry.yarnpkg.com/glob/-/glob-7.1.4.tgz#aa608a2f6c577ad357e1ae5a5c26d9a8d1969255"
   integrity sha512-hkLPepehmnKk41pUGm3sYxoFs/umurYfYJCerbXEyFIWcAzvpipAgVkBqqT9RBKMGjnq6kMuyYwha6csxbiM1A==
@@ -3925,7 +3925,7 @@ isobject@^3.0.0, isobject@^3.0.1:
   resolved "https://registry.yarnpkg.com/isobject/-/isobject-3.0.1.tgz#4e431e92b11a9731636aa1f9c8d1ccbcfdab78df"
   integrity sha1-TkMekrEalzFjaqH5yNHMvP2reN8=
 
-jquery@^3.2:
+jquery@>=1.8.0, jquery@^3.2:
   version "3.4.1"
   resolved "https://registry.yarnpkg.com/jquery/-/jquery-3.4.1.tgz#714f1f8d9dde4bdfa55764ba37ef214630d80ef2"
   integrity sha512-36+AdBzCL+y6qjw5Tx7HgzeGCzC81MDDgaUP8ld2zhx58HdqXGoBd+tHdrBMiyjGQs0Hxs/MLZTu/eHNJJuWPw==
@@ -5110,6 +5110,13 @@ parseurl@~1.3.2, parseurl@~1.3.3:
   resolved "https://registry.yarnpkg.com/parseurl/-/parseurl-1.3.3.tgz#9da19e7bee8d12dff0513ed5b76957793bc2e8d4"
   integrity sha512-CiyeOxFT/JZyN5m0z9PfXw4SCBJ6Sygz1Dpl0wqjlhDEGGBP1GnsUVEL0p63hoG1fcj3fHynXi9NYO4nWOL+qQ==
 
+parsleyjs@^2.9.1:
+  version "2.9.1"
+  resolved "https://registry.yarnpkg.com/parsleyjs/-/parsleyjs-2.9.1.tgz#fd79f7a1b1fe9138993b5e82f9bbc3e38fd3763d"
+  integrity sha512-2WSe+HsOZEPqXh9bFdi/vgWNQtGRRnAgS3v12qesMAabxVdLE7Oj7b+2UzcZ80eG23g1SxiMUH978Dk/wSkt+w==
+  dependencies:
+    jquery ">=1.8.0"
+
 pascalcase@^0.1.1:
   version "0.1.1"
   resolved "https://registry.yarnpkg.com/pascalcase/-/pascalcase-0.1.1.tgz#b363e55e8006ca6fe21784d2db22bd15d7917f14"
@@ -6159,7 +6166,7 @@ safe-regex@^1.1.0:
   dependencies:
     ret "~0.1.10"
 
-"safer-buffer@>= 2.1.2 < 3":
+"safer-buffer@>= 2.1.2 < 3", safer-buffer@^2.1.2:
   version "2.1.2"
   resolved "https://registry.yarnpkg.com/safer-buffer/-/safer-buffer-2.1.2.tgz#44fa161b0187b9549dd84bb91802f9bd8385cd6a"
   integrity sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==
@@ -6203,6 +6210,11 @@ selfsigned@^1.10.4:
   resolved "https://registry.yarnpkg.com/semver/-/semver-5.7.0.tgz#790a7cf6fea5459bac96110b29b60412dc8ff96b"
   integrity sha512-Ya52jSX2u7QKghxeoFGpLwCtGlt7j0oY9DYb5apt9nPlJ42ID+ulTXESnt/qAQcoSERyZ5sl3LDIOw0nAn/5DA==
 
+semver@^6.0.0:
+  version "6.2.0"
+  resolved "https://registry.yarnpkg.com/semver/-/semver-6.2.0.tgz#4d813d9590aaf8a9192693d6c85b9344de5901db"
+  integrity sha512-jdFC1VdUGT/2Scgbimf7FSx9iJLXoqfglSF+gJeuNWVpiE37OIbc1jywR/GJyFdz3mnkz2/id0L0J/cr0izR5A==
+
 semver@^6.1.0, semver@^6.1.1:
   version "6.1.1"
   resolved "https://registry.yarnpkg.com/semver/-/semver-6.1.1.tgz#53f53da9b30b2103cd4f15eab3a18ecbcb210c9b"
@@ -6535,7 +6547,7 @@ source-map@^0.6.0, source-map@^0.6.1, source-map@~0.6.0, source-map@~0.6.1:
   resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.6.1.tgz#74722af32e9614e9c287a8d0bbde48b5e2f1a263"
   integrity sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==
 
-source-map@~0.7.2:
+source-map@^0.7.3:
   version "0.7.3"
   resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.7.3.tgz#5302f8169031735226544092e64981f751750383"
   integrity sha512-CkCj6giN3S+n9qrYiBTX5gystlENnRW5jZeNLHpe6aue+SrHcG5VYwujhW9s4dY31mEGsxBDrHR6oI69fTXsaQ==
@@ -6785,16 +6797,18 @@ stylus-loader@^3.0.2:
     lodash.clonedeep "^4.5.0"
     when "~3.6.x"
 
-stylus@acidjazz/stylus#dev:
+"stylus@github:acidjazz/stylus#dev":
   version "0.54.5"
   resolved "https://codeload.github.com/acidjazz/stylus/tar.gz/f6d39f350166e15db4b662f287d1cdbdf88103e1"
   dependencies:
     css-parse "~2.0.0"
     debug "~3.1.0"
-    glob "~7.1.2"
+    glob "^7.1.3"
     mkdirp "~0.5.x"
+    safer-buffer "^2.1.2"
     sax "~1.2.4"
-    source-map "~0.7.2"
+    semver "^6.0.0"
+    source-map "^0.7.3"
 
 supports-color@^2.0.0:
   version "2.0.0"