]> _ Git - pmi.git/commitdiff
wip #2925 @1
authorVincent Vanwaelscappel <vincent@cubedesigners.com>
Fri, 19 Jul 2019 15:37:37 +0000 (17:37 +0200)
committerVincent Vanwaelscappel <vincent@cubedesigners.com>
Fri, 19 Jul 2019 15:37:37 +0000 (17:37 +0200)
app/Http/Controllers/AjaxController.php
app/SubForms/HomeProductHighlight.php [new file with mode: 0644]
resources/views/layouts/app.blade.php
resources/views/pages/home.blade.php

index 940c93f95d61e198ec4e13409d15e74240a3361c..ec7a191151cce1b70721480446f43022dd8438f2 100644 (file)
@@ -57,7 +57,7 @@ class AjaxController extends CubistFrontController
             $message->sender(config('mail.from.address'), config('mail.from.name'));
             $message->bcc('test+pmi@cubedesigners.com');
             if (null === $page->form_destination) {
-                $message->to('web@pm-instrumentation.com');
+                $message->to('contact@pm-instrumentation.com');
             } else {
                 foreach ($page->form_destination as $item) {
                     $message->to($item);
@@ -83,6 +83,5 @@ class AjaxController extends CubistFrontController
             $message->replyTo($validatedData['email'], $sender);
             $message->subject($subject . $validatedData['subject']);
         });
-
     }
 }
diff --git a/app/SubForms/HomeProductHighlight.php b/app/SubForms/HomeProductHighlight.php
new file mode 100644 (file)
index 0000000..384b06f
--- /dev/null
@@ -0,0 +1,28 @@
+<?php
+
+
+namespace App\SubForms;
+
+
+use Cubist\Backpack\app\Magic\SubForm;
+
+class HomeProductHighlight extends SubForm
+{
+    public function init()
+    {
+        parent::init();
+
+        $this->addField(['name' => 'title',
+            'label' => 'Titre',
+            'type' => 'Text']);
+
+        $this->addField(['name' => 'image',
+            'label' => 'Image',
+            'type' => 'Images']);
+
+        $this->addField(['name' => 'link',
+            'type' => 'SelectFromModel',
+            'label' => 'Cagégorie',
+            'optionsmodel' => 'App\Models\Producttype']);
+    }
+}
index 515d8e2cd3d3e6d1966979f33830e10ca0c9e400..2588ab29a40d955425324cc27124133fb369bd68 100644 (file)
@@ -26,7 +26,7 @@
             ];
         }
     } else {
-        $cart_items = new stdClass();
+        $cart_items = [];
     }
 @endphp
 
     @include('partials.header')
 
     @section('breadcrumbs')
-        @if(CubistMenu::get('breadcrumbs')->active())
-            <full-width padding="pt-1v pb-1v">
-                <content>
-                    {!! CubistMenu::get('breadcrumbs')->crumbMenu()->asDiv(['class' => 'breadcrumbs'], [], ['class' => 'breadcrumbs-item']) !!}
-                </content>
-            </full-width>
-        @endif
+        <full-width padding="pt-1v pb-1v">
+            <content>
+                {!! CubistMenu::get('breadcrumbs')->crumbMenu()->asDiv(['class' => 'breadcrumbs'], [], ['class' => 'breadcrumbs-item']) !!}
+            </content>
+        </full-width>
     @show
 
     <main class="flex-grow">
index 03e4431b0267861fcf24309c98afd3b8158a92be..bbcd549213c40685e31270d5284325112681c3fa 100644 (file)
             <columns>
                 <column>
 
-                    <h3 class="h2 simple pl-1v md:text-2xl sm:pl-0">Capteurs</h3>
+                    <h3 class="h2 simple pl-1v md:text-2xl sm:pl-0">{{__('Capteurs')}}</h3>
 
                     {{-- ToDo: refactor these blocks + handle different image sizes and title lengths --}}
 
                     <grid cols="2" gap="md" class="xs:grid-cols-1 pr-1v border-r border-grey-300 sm:pr-0 sm:border-0">
-                        @foreach ($page->get('products_capteurs') as $typeID)
+                        @foreach ($page->get('products_capteurs') as $highlight)
                             <div class="bg-white px-1v py-6 flex">
                                 <a class="animated-underline partial-underline flex flex-col justify-between w-full"
-                                   href="{{ $nav->getHrefById('product_type_'.$typeID) }}">
+                                   href="{{ $nav->getHrefById('product_type_'.$highlight['link']) }}">
                                     <div class="flex items-center justify-center flex-grow">
                                         <img class="mb-4" src="{{ asset("storage/products/1.png") }}">
                                     </div>
-                                    <p class="text-lg text-navy font-display font-medium">{{ $productTypes[$typeID]->name }}</p>
+                                    <p class="text-lg text-navy font-display font-medium">{{ $highlight['title'] }}</p>
                                 </a>
                             </div>
                         @endforeach
 
 
                 <column>
-                    <h3 class="h2 simple pl-2v md:text-2xl sm:pl-0">Systèmes de mesure</h3>
+                    <h3 class="h2 simple pl-2v md:text-2xl sm:pl-0">{{__('Systèmes de mesure')}}</h3>
 
                     <grid cols="2" gap="md" class="xs:grid-cols-1 pl-1v sm:pl-0">
-                        @foreach ($page->get('products_systems') as $typeID)
+                        @foreach ($page->get('products_systems') as $highlight)
                             <div class="bg-white px-1v py-6 flex">
                                 <a class="animated-underline partial-underline flex flex-col justify-between w-full"
-                                   href="{{ $nav->getHrefById('product_type_'.$typeID) }}">
+                                   href="{{ $nav->getHrefById('product_type_'.$highlight['link']) }}">
                                     <div class="flex items-center justify-center flex-grow">
-                                        <img class="mb-4" src="{{ asset("storage/products/1.png") }}">
+                                        <img class="mb-4" src="{{ $page->getImageURL($highlight['image']) }}">
                                     </div>
-                                    <p class="text-lg text-navy font-display font-medium">{{ $productTypes[$typeID]->name }}</p>
+                                    <p class="text-lg text-navy font-display font-medium">{{ $highlight['title'] }}</p>
                                 </a>
                             </div>
                         @endforeach