]> _ Git - pmi.git/commitdiff
wip #2609 1
authorVincent Vanwaelscappel <vincent@cubedesigners.com>
Mon, 25 Feb 2019 18:01:40 +0000 (19:01 +0100)
committerVincent Vanwaelscappel <vincent@cubedesigners.com>
Mon, 25 Feb 2019 18:01:40 +0000 (19:01 +0100)
app/Http/Controllers/PageController.php
app/PageTemplates.php
composer.json
composer.lock
config/googletagmanager.php
resources/views/pages/home.blade.php [new file with mode: 0644]
resources/views/vendor/backpack/crud/fields/list_model.blade.php [new file with mode: 0644]
routes/web.php

index 42943dd3dab24b64bef95bb9f7945daee6429286..1f7adbc65ffb79004edc44caae73a03d27374657 100644 (file)
@@ -7,18 +7,17 @@ use App\Http\Controllers\Controller;
 
 class PageController extends Controller
 {
-    public function index($slug)
+    public function index($slug = 'home')
     {
         $page = Page::findBySlug($slug);
 
-        if (!$page)
-        {
-            abort(404, 'Please go back to our <a href="'.url('').'">homepage</a>.');
+        if (!$page) {
+            abort(404, 'Please go back to our <a href="' . url('') . '">homepage</a>.');
         }
 
         $this->data['title'] = $page->title;
         $this->data['page'] = $page->withFakes();
 
-        return view('pages.'.$page->template, $this->data);
+        return view('pages.' . $page->template, $this->data);
     }
 }
index 2a91539ac4c7d6095d52011718e786b469692d21..0bf392cdd14bfb0a0f10bf4175feeece4161edb4 100644 (file)
@@ -20,12 +20,28 @@ trait PageTemplates
     | - page slug
     */
 
-    private function _seo()
+    protected function _common()
+    {
+        $this->crud->addField([
+            'name' => 'status',
+            'type' => 'select_from_array',
+            'default' => '0',
+            'label' => __('Status'),
+            'options' => ['0' => __('Offline'),'1' => __('Published')],
+            'fake' => true,
+            'store_in' => 'extras',
+
+        ]);
+        $this->_seo();
+    }
+
+    protected function _seo()
     {
         $this->crud->addField([   // CustomHTML
             'name' => 'metas_separator',
             'type' => 'custom_html',
             'value' => '<br><h2>' . trans('SEO') . '</h2><hr>',
+            'tab' => 'Meta // SEO'
         ]);
         $this->crud->addField([
             'name' => 'meta_title',
@@ -34,6 +50,7 @@ trait PageTemplates
             'fake' => true,
             'hint' => trans('If empty, page title is used.') . ' ' . __('Recommended length: 60 chars'),
             'store_in' => 'extras',
+            'tab' => 'Meta // SEO',
         ]);
         $this->crud->addField([
             'name' => 'meta_description',
@@ -42,6 +59,7 @@ trait PageTemplates
             'fake' => true,
             'store_in' => 'extras',
             'hint' => __('Recommended length: 160 chars'),
+            'tab' => 'Meta // SEO',
         ]);
         $this->crud->addField([
             'name' => 'robots',
@@ -50,12 +68,27 @@ trait PageTemplates
             'default' => true,
             'fake' => true,
             'store_in' => 'extras',
+            'tab' => 'Meta // SEO',
+        ]);
+    }
+
+    private function home()
+    {
+        $this->_common();
+
+        $this->crud->addField([
+            'name' => 'slideshow',
+            'type' => 'list_model',
+            'model' => 'slideshow',
+            'label' => __('Slideshow'),
+            'fake' => true,
+            'store_in' => 'extras',
         ]);
     }
 
     private function services()
     {
-        $this->_seo();
+        $this->_common();
         $this->crud->addField([   // CustomHTML
             'name' => 'content_separator',
             'type' => 'custom_html',
@@ -71,7 +104,7 @@ trait PageTemplates
 
     private function about_us()
     {
-        $this->_seo();
+        $this->_common();
         $this->crud->addField([
             'name' => 'content',
             'label' => trans('backpack::pagemanager.content'),
index c6139c39cc3bb80d9311e8af8aa3c39798e2f79e..76e14311507e45910a2847df9252e70b170b21c2 100644 (file)
@@ -15,6 +15,7 @@
     "license": "proprietary",
     "require": {
         "cubist/cms-front": "dev-master",
+        "cubist/gtag": "dev-master",
         "cubist/laravel-backpack-bundle": "dev-master"
     },
     "config": {
index fa931ff7fb7f37c8e7b62700c54dae5db8259bcc..3345eacf5f9d2c11ae28c8145207fbf734f3aad3 100644 (file)
@@ -4,7 +4,7 @@
         "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
         "This file is @generated automatically"
     ],
-    "content-hash": "9e32b5e26f854885353e45547b29ab5f",
+    "content-hash": "7e2c66d6444a70f5099e77ad765596e3",
     "packages": [
         {
             "name": "almasaeed2010/adminlte",
             "source": {
                 "type": "git",
                 "url": "git://git.cubedesigners.com/cubist_cms-front.git",
-                "reference": "37d2b3ed3af202574ef2a8cb981490c4fbef2c5e"
+                "reference": "84d1fbacc18f028b361eb5e1989591e852695560"
             },
             "dist": {
                 "type": "tar",
-                "url": "https://composer.cubedesigners.com/dist/cubist/cms-front/cubist-cms-front-dev-master-576f27.tar",
-                "reference": "37d2b3ed3af202574ef2a8cb981490c4fbef2c5e",
-                "shasum": "57e8d5a9638d846490aca6ddce030a9c5b95fc28"
+                "url": "https://composer.cubedesigners.com/dist/cubist/cms-front/cubist-cms-front-dev-master-0537d3.tar",
+                "reference": "84d1fbacc18f028b361eb5e1989591e852695560",
+                "shasum": "3682974fb34898a0924c8b1c9838c149ef3e1665"
             },
             "require": {
+                "cubist/gtag": "dev-master",
                 "laravel/framework": "5.7.*",
                 "php": ">=7.1.3",
                 "spatie/laravel-googletagmanager": "^2.6",
                 }
             ],
             "description": "Cubist CMS Front",
-            "time": "2019-02-22T14:18:18+00:00"
+            "time": "2019-02-25T16:10:11+00:00"
+        },
+        {
+            "name": "cubist/gtag",
+            "version": "dev-master",
+            "source": {
+                "type": "git",
+                "url": "git://git.cubedesigners.com/cubist_gtag.git",
+                "reference": "d7d3245892e01fc7f8c7676bab6391f34f6207db"
+            },
+            "dist": {
+                "type": "tar",
+                "url": "https://composer.cubedesigners.com/dist/cubist/gtag/cubist-gtag-dev-master-d31d9c.tar",
+                "reference": "d7d3245892e01fc7f8c7676bab6391f34f6207db",
+                "shasum": "b5000e4f86ab4aa6b0c5b60a944fd7e4a2156944"
+            },
+            "require": {
+                "laravel/framework": "5.7.*",
+                "php": ">=5.5.0"
+            },
+            "type": "library",
+            "extra": {
+                "laravel": {
+                    "providers": [
+                        "Cubist\\Gtag\\GtagServiceProvider"
+                    ]
+                }
+            },
+            "autoload": {
+                "psr-4": {
+                    "Cubist\\Gtag\\": "src"
+                }
+            },
+            "license": [
+                "proprietary"
+            ],
+            "authors": [
+                {
+                    "name": "Vincent Vanwaelscappel",
+                    "email": "vincent@cubedesigners.com"
+                }
+            ],
+            "description": "Google analytics tracking code for Laravel",
+            "keywords": [
+                "cubist",
+                "google analytics",
+                "gtag"
+            ],
+            "time": "2019-02-25T15:06:11+00:00"
         },
         {
             "name": "cubist/laravel-backpack-bundle",
         },
         {
             "name": "cviebrock/eloquent-sluggable",
-            "version": "4.6.0",
+            "version": "4.7.0",
             "source": {
                 "type": "git",
                 "url": "https://github.com/cviebrock/eloquent-sluggable.git",
-                "reference": "d8a6982d32a7fe92f42b1c33a34e89d33516c2fd"
+                "reference": "e05e778d3ff87a010b0dd73aab00a7c72761ff81"
             },
             "dist": {
                 "type": "zip",
-                "url": "https://api.github.com/repos/cviebrock/eloquent-sluggable/zipball/d8a6982d32a7fe92f42b1c33a34e89d33516c2fd",
-                "reference": "d8a6982d32a7fe92f42b1c33a34e89d33516c2fd",
+                "url": "https://api.github.com/repos/cviebrock/eloquent-sluggable/zipball/e05e778d3ff87a010b0dd73aab00a7c72761ff81",
+                "reference": "e05e778d3ff87a010b0dd73aab00a7c72761ff81",
                 "shasum": ""
             },
             "require": {
                 "slug",
                 "sluggable"
             ],
-            "time": "2018-09-05T02:03:48+00:00"
+            "time": "2019-02-24T19:36:12+00:00"
         },
         {
             "name": "dnoegel/php-xdg-base-dir",
         },
         {
             "name": "studio-42/elfinder",
-            "version": "2.1.46",
+            "version": "2.1.47",
             "source": {
                 "type": "git",
                 "url": "https://github.com/Studio-42/elFinder.git",
-                "reference": "67799d42e7ee0afd3ed13e95f935694a8b3820d1"
+                "reference": "6884c4f0b742bd343cb2c873321fc9bb0cbde3fa"
             },
             "dist": {
                 "type": "zip",
-                "url": "https://api.github.com/repos/Studio-42/elFinder/zipball/67799d42e7ee0afd3ed13e95f935694a8b3820d1",
-                "reference": "67799d42e7ee0afd3ed13e95f935694a8b3820d1",
+                "url": "https://api.github.com/repos/Studio-42/elFinder/zipball/6884c4f0b742bd343cb2c873321fc9bb0cbde3fa",
+                "reference": "6884c4f0b742bd343cb2c873321fc9bb0cbde3fa",
                 "shasum": ""
             },
             "require": {
             ],
             "description": "File manager for web",
             "homepage": "http://elfinder.org",
-            "time": "2019-01-14T03:59:31+00:00"
+            "time": "2019-02-25T00:08:43+00:00"
         },
         {
             "name": "swiftmailer/swiftmailer",
     "minimum-stability": "dev",
     "stability-flags": {
         "cubist/cms-front": 20,
+        "cubist/gtag": 20,
         "cubist/laravel-backpack-bundle": 20
     },
     "prefer-stable": true,
index 980dc0ce9b3e8aef444aaaf533fd57575ae37d4e..eeb26cd0d796d4369ca275749e870b84d53bfa27 100644 (file)
@@ -4,12 +4,12 @@ return [
     /*
      * The Google Tag Manager id, should be a code that looks something like "gtm-xxxx".
      */
-    'id' => env('GOOGLE_ANALYTICS_ID', ''),
+    'id' => env('GOOGLE_TAGMANAGER_ID', ''),
 
     /*
      * Enable or disable script rendering. Useful for local development.
      */
-    'enabled' => env('GOOGLE_ANALYTICS_ID', '') != '',
+    'enabled' => env('GOOGLE_TAGMANAGER_ID', '') != '',
 
     /*
      * If you want to use some macro's you 'll probably store them
diff --git a/resources/views/pages/home.blade.php b/resources/views/pages/home.blade.php
new file mode 100644 (file)
index 0000000..f16b07f
--- /dev/null
@@ -0,0 +1 @@
+@extends('layouts.app')
diff --git a/resources/views/vendor/backpack/crud/fields/list_model.blade.php b/resources/views/vendor/backpack/crud/fields/list_model.blade.php
new file mode 100644 (file)
index 0000000..bf1fd71
--- /dev/null
@@ -0,0 +1,33 @@
+<!-- field_type_name -->
+<div @include('crud::inc.field_wrapper_attributes') >
+    <label>{!! $field['label'] !!}</label>
+    <input
+        type="text"
+        name="{{ $field['name'] }}"
+        value="{{ old($field['name']) ? old($field['name']) : (isset($field['value']) ? $field['value'] : (isset($field['default']) ? $field['default'] : '' )) }}"
+        @include('crud::inc.field_attributes')
+    >
+
+    {{-- HINT --}}
+    @if (isset($field['hint']))
+        <p class="help-block">{!! $field['hint'] !!}</p>
+    @endif
+</div>
+
+@if ($crud->checkIfFieldIsFirstOfItsType($field))
+    {{-- FIELD EXTRA CSS  --}}
+    {{-- push things in the after_styles section --}}
+
+    @push('crud_fields_styles')
+        <!-- no styles -->
+    @endpush
+
+    {{-- FIELD EXTRA JS --}}
+    {{-- push things in the after_scripts section --}}
+
+    @push('crud_fields_scripts')
+        <!-- no scripts -->
+    @endpush
+@endif
+
+{{--// Note: most of the times you'll want to use @if ($crud->checkIfFieldIsFirstOfItsType($field, $fields)) to only load CSS/JS once, even though there are multiple instances of it.--}}
index ff7354b5ba5694dfd724ea025cdc7d03d5150064..b09f239b8602989d55b3d07e6d4f33bfa0c923c3 100644 (file)
 |
 */
 
-Route::get('/', function () {
-    return view('welcome');
-});
-
 /** CATCH-ALL ROUTE for Backpack/PageManager - needs to be at the end of your routes.php file  **/
 Route::get('{page}/{subs?}', ['uses' => 'PageController@index'])
     ->where(['page' => '^((?!admin).)*$', 'subs' => '.*']);