--- /dev/null
+<?php
+
+namespace App\Http\Controllers\Admin;
+
+use Cubist\Backpack\app\Magic\Controllers\CubistMagicController;
+
+class NewsCrudController extends CubistMagicController
+{
+ protected $_modelNamespace = 'App\Models\News';
+ protected $_routeURL = 'news';
+ protected $_singular = 'actualité';
+ protected $_plural = 'actualités';
+ protected $_clonable = true;
+ protected $_bulk = true;
+ protected $_oneInstance= false;
+}
+++ /dev/null
-<?php
-
-namespace App\Http\Controllers;
-
-use Illuminate\Foundation\Bus\DispatchesJobs;
-use Illuminate\Routing\Controller as BaseController;
-use Illuminate\Foundation\Validation\ValidatesRequests;
-use Illuminate\Foundation\Auth\Access\AuthorizesRequests;
-
-class Controller extends BaseController
-{
- use AuthorizesRequests, DispatchesJobs, ValidatesRequests;
-}
namespace App\Http\Controllers;
use App\Models\Page;
+use Cubist\Backpack\app\Http\Controllers\CubistFrontController;
-class PageController extends Controller
+class PageController extends CubistFrontController
{
public function index($slug = 'home')
{
$page = Page::findBySlug($slug);
if (!$page) {
- abort(404, 'Please go back to our <a href="' . url('') . '">homepage</a>.');
+ $this->_404();
}
$this->data['title'] = $page->title;
--- /dev/null
+<?php
+
+
+namespace App\Http\Controllers;
+
+use App\Models\Product;
+use Cubist\Backpack\app\Http\Controllers\CubistFrontController;
+
+class ProductController extends CubistFrontController
+{
+ public function productDetails($id)
+ {
+ $product = Product::find($id);
+
+ if (!$product) {
+ $this->_404();
+ }
+
+ $this->data['title'] = $product->title;
+ $this->data['product'] = $product->withFakes();
+
+ return view('pages.product-detail', $this->data);
+ }
+}
\Illuminate\View\Middleware\ShareErrorsFromSession::class,
\App\Http\Middleware\VerifyCsrfToken::class,
\Illuminate\Routing\Middleware\SubstituteBindings::class,
- \App\Http\Middleware\GenerateMenus::class,
],
'api' => [
+++ /dev/null
-<?php
-
-namespace App\Http\Middleware;
-
-use App\Models\Page;
-use Closure;
-
-class GenerateMenus
-{
- /**
- * Handle an incoming request.
- *
- * @param \Illuminate\Http\Request $request
- * @param \Closure $next
- * @return mixed
- */
- public function handle($request, Closure $next)
- {
- $productsSubMenus = [
-
- // Left panel
- [
- 'title' => 'Capteurs',
- 'links' => [
- 'Force' => 'products/force',
- 'Couple' => 'products/couple',
- 'Déplacement' => 'products/deplacement',
- 'Accélération' => 'products/acceleration',
- 'Inclinaison' => 'products/inclinaison',
- 'Pression' => 'products/pression',
- ],
- ],
-
- // Right panel
- [
- 'title' => 'Systèmes de mesure',
- 'links' => [
- 'Roue dynamométrique' => 'products/roue',
- 'Contrôle de fermeture d’ouvrants' => 'products/cdfdo',
- 'Contrôle de taraudage' => 'products/cdt',
- 'Collecteurs tournant' => 'products/ct',
- 'Télémétrie' => 'products/telemetrie',
- 'Acquisition de données' => 'products/add',
- ],
- ],
- ];
-
- $tree = Page::getTree();
- file_put_contents(app_path('tree.txt'), print_r($tree, true));
- $main = $tree['#main'];
-
- $nav_items = [];
- foreach ($main['children'] as $name => $item) {
-
- if ($item['element']->status !== 1) continue; // Skip offline pages
-
- $submenus = null;
- if ($name == 'products') {
- $submenus = $productsSubMenus;
- } else {
- $links = [];
-
- foreach ($item['children'] as $key => $child) {
- $links[$child['element']->title] = $child['element']->slug;
- }
-
- if (count($links) > 0) {
- $submenus = [['links' => $links]];
- }
- }
- $s = ['url' => $item['element']->slug];
- if (null !== $submenus) {
- $s['submenus'] = $submenus;
- }
-
- $nav_items[$item['element']->title] = $s;
- }
-
- // Hard coded menu structure until we have dynamic data from the CMS
-// $nav_items = [
-//
-// 'Products' => [
-// 'url' => 'products',
-// 'submenus' => [
-//
-// // Left panel
-// [
-// 'title' => 'Capteurs',
-// 'links' => [
-// 'Force' => 'products/force',
-// 'Couple' => 'products/couple',
-// 'Déplacement' => 'products/deplacement',
-// 'Accélération' => 'products/acceleration',
-// 'Inclinaison' => 'products/inclinaison',
-// 'Pression' => 'products/pression',
-// ],
-// ],
-//
-// // Right panel
-// [
-// 'title' => 'Systèmes de mesure',
-// 'links' => [
-// 'Roue dynamométrique' => 'products/roue',
-// 'Contrôle de fermeture d’ouvrants' => 'products/cdfdo',
-// 'Contrôle de taraudage' => 'products/cdt',
-// 'Collecteurs tournant' => 'products/ct',
-// 'Télémétrie' => 'products/telemetrie',
-// 'Acquisition de données' => 'products/add',
-// ],
-// ],
-// ],
-// ],
-//
-// 'Solutions' => [
-// 'url' => 'solutions',
-// 'submenus' => [
-// [
-// 'links' => [
-// 'Énergie' => 'solutions/energie',
-// 'Aéronautique' => 'solutions/aero',
-// 'Ferroviaire' => 'solutions/ferroviaire',
-// 'Automobile' => 'solutions/auto',
-// 'Génie civil' => 'solutions/civil',
-// 'Industrie' => 'solutions/industrie',
-// ]
-// ],
-// ],
-// ],
-//
-// 'Services' => [
-// 'url' => 'services',
-// 'submenus' => [
-// [
-// 'title' => null,
-// 'links' => [
-// 'Location' => 'services/location',
-// 'Calibration' => 'services/calibration',
-// 'Développement OEM' => 'services/developpement-oem',
-// 'Custom Design' => 'services/custom-design',
-// 'Formation' => 'services/formation',
-// ],
-// ],
-// ],
-// ],
-// 'Support' => ['url' => 'support'],
-// 'Société' => [
-// 'url' => 'societe',
-// 'submenus' => [
-// [
-// 'links' => [
-// 'Qui sommes nous ?' => 'societe/a-propos',
-// 'Actualités' => 'societe/actualites',
-// ]
-// ]
-// ],
-// ],
-// 'Contact' => ['url' => 'contact'],
-// ];
-
-
- \Menu::make('primary', function ($menu) use ($nav_items) {
-
- foreach ($nav_items as $nav_label => $nav_item) {
-
- $parent = $menu->add($nav_label, $nav_item['url']);
-
- // Handle items with submenus
- if (isset($nav_item['submenus'])) {
-
- foreach ($nav_item['submenus'] as $submenu_data) {
-
- // Create an empty sub-element that will serve as a wrapper for the submenu(s)
- $wrapper = $parent->raw('')->attr(['class' => 'nav-submenu-wrapper']);
-
- // Some submenus have a title element
- if (isset($submenu_data['title'])) {
- $wrapper->raw($submenu_data['title'])->attr(['class' => 'nav-submenu-title']);
- }
-
- foreach ($submenu_data['links'] as $label => $url) {
- $wrapper->add($label, $url);
- }
- }
- }
-
- }
-
- });
-
- // Also make a menu for the breadcrumbs - this one is simpler and doesn't have the submenu headings
- \Menu::make('breadcrumbs', function ($menu) use ($nav_items) {
-
- // Start with home link
- $menu = $menu->add('Home', '');
-
- foreach ($nav_items as $nav_label => $nav_item) {
-
- $parent = $menu->add($nav_label, $nav_item['url']);
-
- // Handle items with submenus
- if (isset($nav_item['submenus'])) {
-
- foreach ($nav_item['submenus'] as $submenu_data) {
- foreach ($submenu_data['links'] as $label => $url) {
- $parent->add($label, $url);
- }
- }
- }
- }
- });
-
- return $next($request);
- }
-
-
-}
namespace App\Models;
use Cubist\Backpack\app\Magic\Models\CMSPage;
+use Lavary\Menu\Menu;
class Page extends CMSPage
{
+ public static function makeMenus()
+ {
+ if (Menu::exists('primary')) {
+ return;
+ }
+ $productsSubMenus = [
+
+ // Left panel
+ [
+ 'title' => 'Capteurs',
+ 'links' => [
+ 'Force' => 'products/force',
+ 'Couple' => 'products/couple',
+ 'Déplacement' => 'products/deplacement',
+ 'Accélération' => 'products/acceleration',
+ 'Inclinaison' => 'products/inclinaison',
+ 'Pression' => 'products/pression',
+ ],
+ ],
+
+ // Right panel
+ [
+ 'title' => 'Systèmes de mesure',
+ 'links' => [
+ 'Roue dynamométrique' => 'products/roue',
+ 'Contrôle de fermeture d’ouvrants' => 'products/cdfdo',
+ 'Contrôle de taraudage' => 'products/cdt',
+ 'Collecteurs tournant' => 'products/ct',
+ 'Télémétrie' => 'products/telemetrie',
+ 'Acquisition de données' => 'products/add',
+ ],
+ ],
+ ];
+
+ $tree = Page::getTree();
+
+ $main = $tree['#main'];
+
+ $nav_items = [];
+ foreach ($main['children'] as $name => $item) {
+ $submenus = null;
+ if ($name == 'products') {
+ $submenus = $productsSubMenus;
+ } else {
+ $links = [];
+
+ foreach ($item['children'] as $key => $child) {
+ $links[$child['element']->title] = $child['element']->slug;
+ }
+
+ if (count($links) > 0) {
+ $submenus = [['links' => $links]];
+ }
+ }
+ $s = ['url' => $item['element']->slug];
+ if (null !== $submenus) {
+ $s['submenus'] = $submenus;
+ }
+
+ $nav_items[$item['element']->title] = $s;
+ }
+
+// // Hard coded menu structure until we have dynamic data from the CMS
+// $nav_items = [
+//
+// 'Products' => [
+// 'url' => 'products',
+// 'submenus' => [
+//
+// // Left panel
+// [
+// 'title' => 'Capteurs',
+// 'links' => [
+// 'Force' => 'products/force',
+// 'Couple' => 'products/couple',
+// 'Déplacement' => 'products/deplacement',
+// 'Accélération' => 'products/acceleration',
+// 'Inclinaison' => 'products/inclinaison',
+// 'Pression' => 'products/pression',
+// ],
+// ],
+//
+// // Right panel
+// [
+// 'title' => 'Systèmes de mesure',
+// 'links' => [
+// 'Roue dynamométrique' => 'products/roue',
+// 'Contrôle de fermeture d’ouvrants' => 'products/cdfdo',
+// 'Contrôle de taraudage' => 'products/cdt',
+// 'Collecteurs tournant' => 'products/ct',
+// 'Télémétrie' => 'products/telemetrie',
+// 'Acquisition de données' => 'products/add',
+// ],
+// ],
+// ],
+// ],
+//
+// 'Solutions' => [
+// 'url' => 'solutions',
+// 'submenus' => [
+// [
+// 'links' => [
+// 'Énergie' => 'solutions/energie',
+// 'Aéronautique' => 'solutions/aero',
+// 'Ferroviaire' => 'solutions/ferroviaire',
+// 'Automobile' => 'solutions/auto',
+// 'Génie civil' => 'solutions/civil',
+// 'Industrie' => 'solutions/industrie',
+// ]
+// ],
+// ],
+// ],
+//
+// 'Services' => [
+// 'url' => 'services',
+// 'submenus' => [
+// [
+// 'title' => null,
+// 'links' => [
+// 'Location' => 'services/location',
+// 'Calibration' => 'services/calibration',
+// 'Développement OEM' => 'services/developpement-oem',
+// 'Custom Design' => 'services/custom-design',
+// 'Formation' => 'services/formation',
+// ],
+// ],
+// ],
+// ],
+// 'Support' => ['url' => 'support'],
+// 'Société' => [
+// 'url' => 'societe',
+// 'submenus' => [
+// [
+// 'links' => [
+// 'Qui sommes nous ?' => 'societe/a-propos',
+// 'Actualités' => 'societe/actualites',
+// ]
+// ]
+// ],
+// ],
+// 'Contact' => ['url' => 'contact'],
+// ];
+
+
+ \Menu::make('primary', function ($menu) use ($nav_items) {
+
+ foreach ($nav_items as $nav_label => $nav_item) {
+
+ $parent = $menu->add($nav_label, $nav_item['url']);
+
+ // Handle items with submenus
+ if (isset($nav_item['submenus'])) {
+
+ foreach ($nav_item['submenus'] as $submenu_data) {
+
+ // Create an empty sub-element that will serve as a wrapper for the submenu(s)
+ $wrapper = $parent->raw('')->attr(['class' => 'nav-submenu-wrapper']);
+
+ // Some submenus have a title element
+ if (isset($submenu_data['title'])) {
+ $wrapper->raw($submenu_data['title'])->attr(['class' => 'nav-submenu-title']);
+ }
+
+ foreach ($submenu_data['links'] as $label => $url) {
+ $wrapper->add($label, $url);
+ }
+ }
+ }
+
+ }
+
+ });
+
+ // Also make a menu for the breadcrumbs - this one is simpler and doesn't have the submenu headings
+ \Menu::make('breadcrumbs', function ($menu) use ($nav_items) {
+
+ // Start with home link
+ $menu = $menu->add('Home', '');
+
+ foreach ($nav_items as $nav_label => $nav_item) {
+
+ $parent = $menu->add($nav_label, $nav_item['url']);
+
+ // Handle items with submenus
+ if (isset($nav_item['submenus'])) {
+
+ foreach ($nav_item['submenus'] as $submenu_data) {
+ foreach ($submenu_data['links'] as $label => $url) {
+ $parent->add($label, $url);
+ }
+ }
+ }
+ }
+ });
+ }
}
use Cubist\Backpack\app\Magic\Models\CubistMagicModel;
use Illuminate\Support\Str;
+use Spatie\MediaLibrary\Models\Media;
class Product extends CubistMagicModel
{
'singular' => 'produit',
'plural' => 'produits'];
+ protected $_documents = [];
+
+ public function __construct(array $attributes = [])
+ {
+ $this->_documents = ['technical_sheet' => trans('Fiche technique'), 'documentation' => trans('Documentation')];
+ parent::__construct($attributes);
+ }
+
public function setFields()
{
parent::setFields();
'maxFiles' => 6,
'tab' => 'Média']);
- $documents = ['technical_sheet' => 'Fiche technique', 'documentation' => 'Documentation'];
- foreach ($documents as $name => $label) {
+
+ foreach ($this->_documents as $name => $label) {
$this->addField(['name' => $name,
'label' => $label,
'type' => 'Files',
}
}
+
+ public function getDocuments()
+ {
+ $typedocs = ['odt', 'doc', 'docx', 'pdf'];
+ $res = [];
+ foreach ($this->_documents as $fieldName => $label) {
+ foreach ($this->getMedia($this->$fieldName) as $media) {
+ /** @var $media Media */
+
+ $res[] = ['media' => $media, 'label' => $label, 'type' => in_array($media->getExtensionAttribute(), $typedocs) ? 'document' : 'tech'];
+ }
+ }
+
+ return $res;
+ }
+
+ public function hasDocuments()
+ {
+ return count($this->getDocuments()) > 0;
+ }
+
+ public function getSpecificationsValues()
+ {
+ $res = [];
+ $allspecs = Specification::all();
+ $mytype = ProductType::find($this->productType);
+ $myspecs = $mytype->specifications;
+ foreach ($myspecs as $spec) {
+
+ }
+ return $res;
+ }
}
'type'=>'Email',
'label'=>'E-mail',
'tab'=>'Informations de contact']);
+
+ $this->addField(['name'=>'phone',
+ 'type'=>'Text',
+ 'label'=>'Téléphone',
+ 'tab'=>'Informations de contact']);
}
}
"license": "proprietary",
"require": {
"cubist/cms-back": "dev-master",
- "lavary/laravel-menu": "^1.7",
"league/csv": "^9.2",
"nothingworks/blade-svg": "^0.3.1",
"spatie/laravel-blade-x": "^2.2"
'Validator' => Illuminate\Support\Facades\Validator::class,
'View' => Illuminate\Support\Facades\View::class,
+
+
],
];
"rupture": "^0.7.1",
"stylus": "acidjazz/stylus#dev",
"stylus-loader": "^3.0.2",
- "tailwindcss": "^1.0.1",
+ "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",
+ "gsap": "^2.1.3"
}
}
+++ /dev/null
-<svg xmlns="http://www.w3.org/2000/svg" width="16.16" height="9.588" viewBox="0 0 16.16 9.588">
- <path id="Tracé_29" data-name="Tracé 29" d="M3719.6-783.348l-7.459,7.459-7.278-7.459" transform="translate(-3704.146 784.055)" fill="none" stroke="#6b7287" stroke-miterlimit="10" stroke-width="2"/>
-</svg>
+++ /dev/null
-<svg xmlns="http://www.w3.org/2000/svg" width="23.942" height="31" viewBox="0 0 23.942 31">
- <g id="Groupe_130" data-name="Groupe 130" transform="translate(-207.499 -1302.5)">
- <g id="Groupe_120" data-name="Groupe 120" transform="translate(208 1302.999)">
- <g id="Groupe_124" data-name="Groupe 124" transform="translate(0 0)">
- <path id="Tracé_202" data-name="Tracé 202" d="M4004.51-1343.333H3984.3a1.365,1.365,0,0,1-1.365-1.364v-27.271a1.365,1.365,0,0,1,1.365-1.364h14.926l6.651,6.651v21.985A1.364,1.364,0,0,1,4004.51-1343.333Z" transform="translate(-3982.933 1373.333)" fill="#0eaada" stroke="#f7f8fc" stroke-linecap="round" stroke-linejoin="round" stroke-width="1"/>
- <path id="Tracé_203" data-name="Tracé 203" d="M4057.28-1366.683h-5.286a1.364,1.364,0,0,1-1.365-1.364v-5.287Z" transform="translate(-4034.338 1373.333)" fill="#0eaada" stroke="#f7f8fc" stroke-linecap="round" stroke-linejoin="round" stroke-width="1"/>
- </g>
- <g id="Groupe_125" data-name="Groupe 125" transform="translate(5 9.167)">
- <path id="Tracé_204" data-name="Tracé 204" d="M515.025,11614.639a5.759,5.759,0,0,0-1.715.984l-1.315-.757-1.8,3.119,1.309.757a5.259,5.259,0,0,0,0,1.973l-1.31.756,1.8,3.119,1.319-.755a5.774,5.774,0,0,0,1.715.982v1.515h3.6v-1.515a5.7,5.7,0,0,0,1.7-.982l1.307.755,1.8-3.119-1.312-.756a5.541,5.541,0,0,0,.093-.986,5.465,5.465,0,0,0-.094-.986l1.311-.757-1.8-3.119-1.3.757a5.687,5.687,0,0,0-1.7-.984V11613h-3.6Z" transform="translate(-510.19 -11612.999)" fill="none" stroke="#f7f8fc" stroke-linecap="round" stroke-width="1"/>
- <circle id="Ellipse_18" data-name="Ellipse 18" cx="2.381" cy="2.381" r="2.381" transform="translate(4.239 4.348)" fill="none" stroke="#f7f8fc" stroke-linecap="round" stroke-width="1"/>
- </g>
- </g>
- </g>
-</svg>
+++ /dev/null
-<svg xmlns="http://www.w3.org/2000/svg" width="23.944" height="31" viewBox="0 0 23.944 31">
- <g id="Groupe_129" data-name="Groupe 129" transform="translate(-126.5 -1244.5)">
- <g id="Groupe_127" data-name="Groupe 127" transform="translate(127 1244.999)">
- <g id="Groupe_123" data-name="Groupe 123" transform="translate(0)">
- <path id="Tracé_199" data-name="Tracé 199" d="M3845.179-1343.333h-20.215a1.365,1.365,0,0,1-1.365-1.364v-27.272a1.365,1.365,0,0,1,1.365-1.364h14.928l6.652,6.651v21.985A1.364,1.364,0,0,1,3845.179-1343.333Z" transform="translate(-3823.6 1373.333)" fill="#0eaada" stroke="#f7f8fc" stroke-linecap="round" stroke-linejoin="round" stroke-width="1"/>
- <path id="Tracé_200" data-name="Tracé 200" d="M3897.947-1366.683h-5.287a1.364,1.364,0,0,1-1.364-1.364v-5.286Z" transform="translate(-3875.003 1373.333)" fill="#0eaada" stroke="#f7f8fc" stroke-linecap="round" stroke-linejoin="round" stroke-width="1"/>
- </g>
- <g id="Groupe_117" data-name="Groupe 117" transform="translate(3.334 8.334)">
- <g id="Rectangle_472" data-name="Rectangle 472" transform="translate(0.126 0)" fill="none" stroke="#f7f8fc" stroke-linecap="square" stroke-width="1">
- <rect width="7.008" height="7.007" stroke="none"/>
- <rect x="0.5" y="0.5" width="6.008" height="6.007" fill="none"/>
- </g>
- <line id="Ligne_136" data-name="Ligne 136" x2="5.785" transform="translate(10.181 2.666)" fill="none" stroke="#f7f8fc" stroke-linejoin="round" stroke-width="1"/>
- <line id="Ligne_137" data-name="Ligne 137" x2="15.841" transform="translate(0.126 10.031)" fill="none" stroke="#f7f8fc" stroke-linejoin="round" stroke-width="1"/>
- <path id="Tracé_201" data-name="Tracé 201" d="M0,0H10.048" transform="translate(0 13.395)" fill="#0eaada" stroke="#f7f8fc" stroke-width="1"/>
- <line id="Ligne_140" data-name="Ligne 140" x2="5.718" transform="translate(10.181 6.374)" fill="none" stroke="#f7f8fc" stroke-linejoin="round" stroke-width="1"/>
- </g>
- </g>
- </g>
-</svg>
$lightgrey = #F7F8FC
$darkblue = #152F4E
+
*
padding: 0
box-sizing: border-box !important
display flex !important
.rotate
transform: rotate(180deg)
- transition 400ms all ease
\ No newline at end of file
+ transition 400ms all ease
--- /dev/null
+<svg xmlns="http://www.w3.org/2000/svg" width="16.16" height="9.588" viewBox="0 0 16.16 9.588">
+ <path id="Tracé_29" data-name="Tracé 29" d="M3719.6-783.348l-7.459,7.459-7.278-7.459" transform="translate(-3704.146 784.055)" fill="none" stroke="#6b7287" stroke-miterlimit="10" stroke-width="2"/>
+</svg>
--- /dev/null
+<svg xmlns="http://www.w3.org/2000/svg" width="23.944" height="31" viewBox="0 0 23.944 31">
+ <g id="Groupe_129" data-name="Groupe 129" transform="translate(-126.5 -1244.5)">
+ <g id="Groupe_127" data-name="Groupe 127" transform="translate(127 1244.999)">
+ <g id="Groupe_123" data-name="Groupe 123" transform="translate(0)">
+ <path id="Tracé_199" data-name="Tracé 199" d="M3845.179-1343.333h-20.215a1.365,1.365,0,0,1-1.365-1.364v-27.272a1.365,1.365,0,0,1,1.365-1.364h14.928l6.652,6.651v21.985A1.364,1.364,0,0,1,3845.179-1343.333Z" transform="translate(-3823.6 1373.333)" fill="#0eaada" stroke="#f7f8fc" stroke-linecap="round" stroke-linejoin="round" stroke-width="1"/>
+ <path id="Tracé_200" data-name="Tracé 200" d="M3897.947-1366.683h-5.287a1.364,1.364,0,0,1-1.364-1.364v-5.286Z" transform="translate(-3875.003 1373.333)" fill="#0eaada" stroke="#f7f8fc" stroke-linecap="round" stroke-linejoin="round" stroke-width="1"/>
+ </g>
+ <g id="Groupe_117" data-name="Groupe 117" transform="translate(3.334 8.334)">
+ <g id="Rectangle_472" data-name="Rectangle 472" transform="translate(0.126 0)" fill="none" stroke="#f7f8fc" stroke-linecap="square" stroke-width="1">
+ <rect width="7.008" height="7.007" stroke="none"/>
+ <rect x="0.5" y="0.5" width="6.008" height="6.007" fill="none"/>
+ </g>
+ <line id="Ligne_136" data-name="Ligne 136" x2="5.785" transform="translate(10.181 2.666)" fill="none" stroke="#f7f8fc" stroke-linejoin="round" stroke-width="1"/>
+ <line id="Ligne_137" data-name="Ligne 137" x2="15.841" transform="translate(0.126 10.031)" fill="none" stroke="#f7f8fc" stroke-linejoin="round" stroke-width="1"/>
+ <path id="Tracé_201" data-name="Tracé 201" d="M0,0H10.048" transform="translate(0 13.395)" fill="#0eaada" stroke="#f7f8fc" stroke-width="1"/>
+ <line id="Ligne_140" data-name="Ligne 140" x2="5.718" transform="translate(10.181 6.374)" fill="none" stroke="#f7f8fc" stroke-linejoin="round" stroke-width="1"/>
+ </g>
+ </g>
+ </g>
+</svg>
--- /dev/null
+<svg xmlns="http://www.w3.org/2000/svg" width="23.942" height="31" viewBox="0 0 23.942 31">
+ <g id="Groupe_130" data-name="Groupe 130" transform="translate(-207.499 -1302.5)">
+ <g id="Groupe_120" data-name="Groupe 120" transform="translate(208 1302.999)">
+ <g id="Groupe_124" data-name="Groupe 124" transform="translate(0 0)">
+ <path id="Tracé_202" data-name="Tracé 202" d="M4004.51-1343.333H3984.3a1.365,1.365,0,0,1-1.365-1.364v-27.271a1.365,1.365,0,0,1,1.365-1.364h14.926l6.651,6.651v21.985A1.364,1.364,0,0,1,4004.51-1343.333Z" transform="translate(-3982.933 1373.333)" fill="#0eaada" stroke="#f7f8fc" stroke-linecap="round" stroke-linejoin="round" stroke-width="1"/>
+ <path id="Tracé_203" data-name="Tracé 203" d="M4057.28-1366.683h-5.286a1.364,1.364,0,0,1-1.365-1.364v-5.287Z" transform="translate(-4034.338 1373.333)" fill="#0eaada" stroke="#f7f8fc" stroke-linecap="round" stroke-linejoin="round" stroke-width="1"/>
+ </g>
+ <g id="Groupe_125" data-name="Groupe 125" transform="translate(5 9.167)">
+ <path id="Tracé_204" data-name="Tracé 204" d="M515.025,11614.639a5.759,5.759,0,0,0-1.715.984l-1.315-.757-1.8,3.119,1.309.757a5.259,5.259,0,0,0,0,1.973l-1.31.756,1.8,3.119,1.319-.755a5.774,5.774,0,0,0,1.715.982v1.515h3.6v-1.515a5.7,5.7,0,0,0,1.7-.982l1.307.755,1.8-3.119-1.312-.756a5.541,5.541,0,0,0,.093-.986,5.465,5.465,0,0,0-.094-.986l1.311-.757-1.8-3.119-1.3.757a5.687,5.687,0,0,0-1.7-.984V11613h-3.6Z" transform="translate(-510.19 -11612.999)" fill="none" stroke="#f7f8fc" stroke-linecap="round" stroke-width="1"/>
+ <circle id="Ellipse_18" data-name="Ellipse 18" cx="2.381" cy="2.381" r="2.381" transform="translate(4.239 4.348)" fill="none" stroke="#f7f8fc" stroke-linecap="round" stroke-width="1"/>
+ </g>
+ </g>
+ </g>
+</svg>
* code may be modified to fit the specific needs of your application.
*/
-// try {
-// window.Popper = require('popper.js').default;
-// window.$ = window.jQuery = require('jquery');
-//
-// require('bootstrap');
-// } catch (e) {}
+try {
+ //window.Popper = require('popper.js').default;
+ window.$ = window.jQuery = require('jquery');
+
+ //require('bootstrap');
+} catch (e) {}
+
/**
* We'll load the axios HTTP library which allows us to easily issue requests
--- /dev/null
+$(function () {
+ $(document).on('click', '#product-tabs .section-title', function () {
+ let that = $(this);
+
+ $('.content-item').each(function () {
+ if ($(this).data('content') === that.data('nav')) {
+ $(this).addClass('active-content').siblings().removeClass('active-content').addClass('hidden');
+ that.addClass('active-nav').parent().siblings().find(".section-title").removeClass('active-nav');
+ }
+ });
+
+ if ($(window).width() < 940) {
+ $('.responsive-content').each(function () {
+ if ($(this).data('content') === that.data('nav')) {
+ that.find('.product-nav-arrow').toggleClass('rotate');
+ }
+ })
+ }
+ })
+
+ $(".section-title").click(function () {
+ $(this)
+ .toggleClass('active-content')
+ .siblings(".responsive-content")
+ .slideToggle()
+ });
+
+});
--- /dev/null
+$h3 = 24px
+$barlow = 'Barlow', sans-serif
+$muli = 'Muli', sans-serif
+$dark = #6B7287
+$lightgrey = #F7F8FC
+$darkblue = #152F4E
+
+
+#product-tabs
+ max-width: 1536px
+ margin: 0 auto
+
+ .content
+ @media (max-width 940px)
+ display none
+ max-width 1536px
+ padding 55px 48px 48px 48px
+ background $lightgrey
+
+ .product-nav
+ @media (max-width 940px)
+ flex-direction column
+
+ &-item
+ //padding : 25px 50px
+ font-family $barlow
+ font-size: 18px
+ color: $darkblue
+ position: relative
+ transition 400ms all ease
+ @media (max-width 940px)
+ &:last-child::after
+ height: 0
+ &::after
+ content ''
+ background #E7E9F3
+ left 48px
+ right 48px
+ bottom 0
+ position absolute
+ height 1px
+
+ .section-title
+ font-family $barlow
+ display flex
+ padding: 25px 50px
+ cursor pointer
+
+ + div
+ padding: 0px 50px 25px 50px
+ @media (min-width 940px)
+ display none !important
+
+ .product-nav-arrow
+ display flex
+ transition 400ms all ease
+ @media (min-width 940px)
+ display none
+
+ .active-nav
+ background $lightgrey
+ @media (max-width 940px)
+ background white
+
+ .active-content
+ display flex !important
+
+ .rotate
+ transform: rotate(180deg)
+ transition 400ms all ease
@include('partials.header')
@section('breadcrumbs')
- @if(Menu::get('breadcrumbs')->active())
+ @if(CubistMenu::get('breadcrumbs')->active())
<full-width padding="pt-1v pb-1v">
<content>
- {!! Menu::get('breadcrumbs')->crumbMenu()->asDiv(['class' => 'breadcrumbs'], [], ['class' => 'breadcrumbs-item']) !!}
+ {!! CubistMenu::get('breadcrumbs')->crumbMenu()->asDiv(['class' => 'breadcrumbs'], [], ['class' => 'breadcrumbs-item']) !!}
</content>
</full-width>
@endif
@extends('layouts/app')
@section('content')
+ <content class="pt-1v">
+ <text-block title-class="h1 text-6xl" title-tag="h1">
+ <slot name="title">
+ {{$product->name}}
+ </slot>
+ </text-block>
+
+ {{-- Product details --}}
+ <div class="flex mb-2v sm:block">
+ {{-- Product images --}}
+ <div class="product-detail-images-wrapper flex-grow" style="max-width: 348px">
+ <div
+ class="product-detail-images-main border-gray-100 border-4 pb-100p w-full bg-center bg-contain bg-no-repeat mb-3"
+ style="background-image: url({{ $product->getMedia($product->images)->first()->getUrl() }});">
+ </div>
- <content class="pt-1v">
- <text-block title-class="h1 text-6xl" title-tag="h1">
- <slot name="title">
- Modèle 1200<br>
- de 1.5 kN à 900kN
- </slot>
- </text-block>
+ <grid cols="3" gap="sm">
+ @foreach ($product->getMedia($product->images) as $image)
+ <div
+ class="product-detail-images-main border-gray-100 border-4 pb-100p w-full bg-center bg-contain bg-no-repeat"
+ style="background-image: url({{ $image->getUrl() }});">
+ </div>
+ @endforeach
+ </grid>
+ </div>
- {{-- Product details --}}
- <div class="flex mb-2v sm:block">
- {{-- Product images --}}
- <div class="product-detail-images-wrapper flex-grow" style="max-width: 348px">
- <div class="product-detail-images-main border-gray-100 border-4 pb-100p w-full bg-center bg-contain bg-no-repeat mb-3"
- style="background-image: url({{ asset('storage/products/1.png') }});">
- </div>
+ {{-- Product text --}}
+ <text-block class="product-detail-text sm:mt-6">
+ {!! Markdown::parse($product->highlights) !!}
- <grid cols="3" gap="sm">
- @for ($i = 1; $i <= 3; $i++)
- <div class="product-detail-images-main border-gray-100 border-4 pb-100p w-full bg-center bg-contain bg-no-repeat"
- style="background-image: url({{ asset('storage/products/1.png') }});">
- </div>
- @endfor
- </grid>
- </div>
+ @if(count($product->getMedia($product->technical_sheet)))
+ <p class="mt-4"><a href="{{$product->getMedia($product->technical_sheet)->first()->getUrl()}}">Télécharger
+ la fiche produit</a></p>
+ @endif
- {{-- Product text --}}
- <text-block class="product-detail-text sm:mt-6">
- <ul>
- <li>Non-linéarité ± 0.03 % pleine échelle</li>
- <li>Compensation mécanique des efforts transverses.</li>
- <li>Utilise des jauges de contrainte Interface auto compensées.</li>
- <li>Compensation barométrique</li>
- <li>Sensibilité à la température < 0.0015% / °C</li>
- <li>Etendue de mesure de 1.25 kN à 450 kN</li>
- <li>Protection en surcharge : 300% de la gamme de mesure</li>
- <li>Disponible en double ponts</li>
- </ul>
+ <link-button href="#" class="align-middle">Ajouter à ma sélection</link-button>
- <p class="mt-4"><a href="#">Télécharger la fiche produit</a></p>
+ <span
+ class="font-display text-lg inline-block align-middle rounded-full border-grey-dark border-2 h-8 w-8 text-center ml-6">?</span>
- <link-button href="#" class="align-middle">Ajouter à ma sélection</link-button>
+ </text-block>
- <span class="font-display text-lg inline-block align-middle rounded-full border-grey-dark border-2 h-8 w-8 text-center ml-6">?</span>
- </text-block>
+ </div>
+ </content>
- </div>
+ @push('scripts')
+ <script src="{{mix('js/product-details.js')}}"></script>
+ @endpush
- </content>
+ <div id="product-tabs">
+ <ul class="flex product-nav">
+ @if($product->descriptions)
+ <li class="product-nav-item ">
+ <div data-nav="0" class="section-title justify-between items-center active-nav">
+ {{trans('Description')}}
+ <img class="product-nav-arrow" src="{{asset('images/product-details/arrow-down.svg')}}" alt="">
+ </div>
+
+ <div>
+ {!! Markdown::parse($product->descriptions) !!}
+ </div>
+ </li>
+ @endif
+ <li class="product-nav-item">
+ <div data-nav="1" class="section-title justify-between items-center">
+ {{trans('Spécifications')}}
+ <img class="product-nav-arrow" src="{{asset('images/product-details/arrow-down.svg')}}" alt="">
+ </div>
+ <div>
+ <ul class="specification-list">
+ <li class=" flex justify-between">
+ <div class="specification-info">Etendue de mesure (kN)</div>
+ <div class="specification-value">1.5 / 2.5 / 5 / 10</div>
+ </li>
+ <li class="flex justify-between mt-6">
+ <div class="specification-info">Précision (erreur totale)</div>
+ <div class="specification-value">± 0.04</div>
+ </li>
+
+ <li class="flex justify-between mt-6">
+ <div class="specification-info">Non-linéarité, % PE</div>
+ <div class="specification-value">± 0.04</div>
+ </li>
+ <li class="flex justify-between mt-6">
+ <div class="specification-info">Hystérésis, % PE</div>
+ <div class="specification-value">± 0.03</div>
+ </li>
+ <li class="flex justify-between mt-6">
+ <div class="specification-info">Non-répétabilité, % PE</div>
+ <div class="specification-value">± 0.01</div>
+ </li>
+ <li class="flex justify-between mt-6">
+ <div class="specification-info">Dérive sous charge (20 mins)</div>
+ <div class="specification-value">± 0.025</div>
+ </li>
+ <li class="flex justify-between mt-6">
+ <div class="specification-info">Sensibilité transverse %</div>
+ <div class="specification-value">± 0.25</div>
+ </li>
+ <li class="flex justify-between mt-6">
+ <div class="specification-info">Gamme de compensation °C</div>
+ <div class="specification-value">-10 à + 45</div>
+ </li>
+ <li class="flex justify-between mt-6">
+ <div class="specification-info">Gamme d'utilisation °C</div>
+ <div class="specification-value">-55 à 90</div>
+ </li>
+ <li class="flex justify-between mt-6">
+ <div class="specification-info">Sensibilité au Zéro (%PE/°C)</div>
+ <div class="specification-value">± 0.0015</div>
+ </li>
+ </ul>
+ </div>
+ </li>
+ @if($product->hasDocuments())
+ <li class="product-nav-item">
+ <div data-nav="2" class="section-title justify-between items-center">
+ {{trans('Documents')}}
+ <img class="product-nav-arrow" src="{{asset('images/product-details/arrow-down.svg')}}" alt="">
+ </div>
+ <div>
+ <ul class="text-grey-dark">
+ @foreach($product->getDocuments() as $document)
+ <li class="flex items-center ">
+ <a href="{{$document['media']->getUrl()}}" target="_blank">
+ <img class="mr-4 mb-2"
+ src="{{asset('images/product-details/icon-'.$document['type'].'.svg')}}"
+ alt="">
+ {{$document['label']}}
+ </a>
+ </li>
+ @endforeach
+ </ul>
+ </div>
+ </li>
+ @endif
+
+ @if($product->dimensions)
+ <li class="product-nav-item">
+ <div data-nav="3" class="section-title justify-between items-center">
+ {{trans('Dimensions')}}
+ <img class="product-nav-arrow" src="{{asset('images/product-details/arrow-down.svg')}}" alt="">
+ </div>
+ <div data-content="3" class="option">
+ {!! Markdown::parse($product->dimensions) !!}
+ </div>
+ </li>
+ @endif
+ @if($product->options)
+ <li class="product-nav-item">
+ <div class="section-title justify-between items-center">
+ {{trans('Options')}}
+ <img class="product-nav-arrow" src="{{asset('images/product-details/arrow-down.svg')}}" alt="">
+ </div>
+ <div>
+ {!! Markdown::parse($product->options) !!}
+ </div>
+ </li>
+ @endif
+ @if($product->accessories)
+ <li class="product-nav-item">
+ <div class="section-title justify-between items-center">
+ {{trans('Accessoires')}}
+ <img class="product-nav-arrow" src="{{asset('images/product-details/arrow-down.svg')}}" alt="">
+ </div>
+ <div>
+ {!! Markdown::parse($product->accessories) !!}
+ </div>
+ </li>
+ @endif
+ </ul>
+ </div>
<full-width class="bg-grey-100">
<content>
- <text-block title="Produits associés" title-class="h2" />
+ <text-block title="Produits associés" title-class="h2"/>
{{-- Product Grid --}}
<grid cols="auto" class="products-grid">
<div class="p-4">
<h3>Modèle 1200 de 1.5 kN à 900kN</h3>
<ul class="text-sm">
- <li>Étendue de mesure : 1.5 kN à 900 kN </li>
- <li>Sortie élevée : 2 ou 4 mV/V </li>
+ <li>Étendue de mesure : 1.5 kN à 900 kN</li>
+ <li>Sortie élevée : 2 ou 4 mV/V</li>
<li>Précision : 0.04% à 0.07% pleine échelle</li>
<li>Compensé pour les efforts transverses</li>
</ul>
</div>
</a>
- <a class="footer-contact-block" href="#">
+ <a class="footer-contact-block" href="mailto:{{$global->email}}">
@svg('icon-email', 'footer-contact-icon')
<div class="footer-contact-text">
<div class="footer-contact-title">{{ __('Email') }}</div>
- contact@pm-instrumentation.com
+ {{$global->email}}
</div>
</a>
-{!! Menu::get('primary')->asUl(['class' => 'nav-primary']) !!}
+{!! CubistMenu::get('#main')->asUl(['class' => 'nav-primary']) !!}
Route::match(['delete'], 'page/{id}/media/{mediaId}', 'PageCrudController@deleteMedia');
Route::match(['post'], 'page/{id}/media/reorder', 'PageCrudController@reorderMedia');
});
- CRUD::resource('product', 'ProductCrudController')->with(function () {
- Route::match(['post'], 'product/{id}/media', 'ProductCrudController@uploadMedia');
- Route::match(['delete'], 'product/{id}/media/{mediaId}', 'ProductCrudController@deleteMedia');
- Route::match(['post'], 'product/{id}/media/reorder', 'ProductCrudController@reorderMedia');
- });
CRUD::resource('producttype', 'ProductTypeCrudController')->with(function () {
Route::match(['post'], 'producttype/{id}/media', 'ProductTypeCrudController@uploadMedia');
Route::match(['delete'], 'producttype/{id}/media/{mediaId}', 'ProductTypeCrudController@deleteMedia');
|
*/
-Route::get('/', function () {
- return view('pages.home');
-});
-
Route::get('/products/{category}/{id}', function ($category, $id = null) {
return view('pages.product-detail', compact('category', 'id'));
})->where(['category' => '.*']);
// return view('pages.test', compact('name'));
//})->where(['name' => '.*']);
+Route::get('product/{id}', ['uses' => 'ProductController@productDetails']);
+
/** CATCH-ALL ROUTE for CMS Pages - needs to be at the end of your web.php file **/
Route::get('{page}/{subs?}', ['uses' => 'PageController@index'])
->where(['page' => '^(((?=(?!admin))(?=(?!\/)).))*$', 'subs' => '.*']);
+
});
mix.js('resources/js/app.js', 'public/js')
+ .js('resources/js/product-details.js','public/js')
.stylus('resources/styles/app.styl', 'public/css', {
use: [
require('rupture')()