Skip to content
This repository was archived by the owner on Jan 3, 2023. It is now read-only.

Commit 2fd986e

Browse files
committed
v3.0.6
1 parent cfe9d16 commit 2fd986e

File tree

21 files changed

+307
-128
lines changed

21 files changed

+307
-128
lines changed

logs/v3.0.3.txt

Lines changed: 0 additions & 2 deletions
This file was deleted.

logs/v3.0.6.txt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
- fix not updating columns with empty value
2+
- add meta column to pages so you can use it with <meta name=“keywords”>
3+
- update wiki
4+
- update resources

src/Controllers/Admin/AdminController.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ public function index()
1515
{
1616
return view("{$this->adminPath}.admin")->with([
1717
'title' => 'DashBoard',
18-
'desc' => 'Admin Description',
18+
'desc' => 'Admin DashBoard',
1919
]);
2020
}
2121
}

src/Controllers/Admin/Traits/PageOps.php

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -87,12 +87,9 @@ protected function cleanEmptyTranslations($request)
8787
$result = $request->except(['roles', 'permissions', 'menus']);
8888

8989
foreach ($result as $k => $v) {
90-
if (null == $v) {
91-
unset($result[$k]);
92-
}
9390
if (is_array($v)) {
9491
if (empty(array_filter($v))) {
95-
unset($result[$k]);
92+
$result[$k] = '';
9693
} else {
9794
$result[$k] = array_filter($v);
9895
}

src/Controllers/DummyController.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,6 @@ public function handle()
1111
{
1212
extract(SimpleMenu::getRouteData(Route::currentRouteName()));
1313

14-
return view("$this->templatePath.$template", compact('title', 'body', 'desc'));
14+
return view("$this->templatePath.$template", compact('title', 'body', 'desc', 'meta'));
1515
}
1616
}

src/Models/Page.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ class Page extends Node
1919
'menus', 'pivot', 'parent_id',
2020
'lft', 'rgt', 'depth',
2121
];
22-
public $translatable = ['title', 'body', 'desc', 'prefix', 'url'];
22+
public $translatable = ['title', 'body', 'desc', 'prefix', 'url', 'meta'];
2323

2424
public function menus()
2525
{

src/Traits/RoutesTrait.php

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,7 @@ protected function pageComp($page)
5858
$title = $page->title;
5959
$body = $page->body;
6060
$desc = $page->desc;
61+
$meta = $page->meta;
6162
$template = $page->template;
6263
$breadCrumb = $page->getAncestors();
6364

@@ -72,23 +73,23 @@ protected function pageComp($page)
7273
$permissions = 'perm:' . implode(',', $page->permissions->pluck('name')->toArray());
7374

7475
// make route
75-
$this->routeGen($routeName, $url, $prefix, $action, $roles, $permissions, $template, $title, $body, $desc, $breadCrumb);
76+
$this->routeGen($routeName, $url, $prefix, $action, $roles, $permissions, $template, $title, $body, $desc, $meta, $breadCrumb);
7677

7778
// create route list
7879
if (!$this->listFileFound) {
7980
$this->createRoutesList($action, $page, $routeName);
8081
}
8182
}
8283

83-
protected function routeGen($routeName, $url, $prefix, $action, $roles, $permissions, $template, $title, $body, $desc, $breadCrumb)
84+
protected function routeGen($routeName, $url, $prefix, $action, $roles, $permissions, $template, $title, $body, $desc, $meta, $breadCrumb)
8485
{
8586
if ($this->escapeEmptyRoute($url)) {
8687
return;
8788
}
8889

8990
// cache the page so we can pass the page params to the controller@method
90-
$this->cache->tags('sm')->rememberForever($this->getCrntLocale() . "-$routeName", function () use ($template, $title, $body, $desc, $breadCrumb) {
91-
return compact('template', 'title', 'body', 'desc', 'breadCrumb');
91+
$this->cache->tags('sm')->rememberForever($this->getCrntLocale() . "-$routeName", function () use ($template, $title, $body, $desc, $meta, $breadCrumb) {
92+
return compact('template', 'title', 'body', 'desc', 'meta', 'breadCrumb');
9293
});
9394

9495
$route = $this->getRouteUrl($url, $prefix);

src/database/migrations/2017_02_28_202951_create_pages_table.php

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
<?php
22

3-
use Illuminate\Database\Migrations\Migration;
4-
use Illuminate\Database\Schema\Blueprint;
53
use Illuminate\Support\Facades\Schema;
4+
use Illuminate\Database\Schema\Blueprint;
5+
use Illuminate\Database\Migrations\Migration;
66

77
class CreatePagesTable extends Migration
88
{
@@ -22,10 +22,11 @@ public function up()
2222
$table->string('template')->nullable();
2323
$table->string('route_name')->nullable();
2424
$table->json('prefix')->nullable();
25-
$table->json('url')->nullable();
25+
$table->json('url');
2626
$table->json('title');
2727
$table->json('body')->nullable();
2828
$table->json('desc')->nullable();
29+
$table->json('meta')->nullable();
2930
$table->timestamps();
3031
});
3132
}

src/resources/assets/js/bulma/page-comp.vue

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,21 +7,36 @@ export default {
77
body: '',
88
desc: '',
99
prefix: '',
10+
meta: '',
1011
url: '',
1112
hideOther: false
1213
}
1314
},
1415
mounted() {
1516
this.title = this.SelectFirst
17+
this.meta = this.SelectFirst
1618
this.body = this.SelectFirst
1719
this.desc = this.SelectFirst
1820
this.prefix = this.SelectFirst
1921
this.url = this.SelectFirst
22+
23+
tinymce.overrideDefaults({
24+
menubar: false,
25+
branding: false,
26+
height : '120',
27+
skin_url: '/assets/vendor/voyager',
28+
skin:'voyager',
29+
plugins: 'lists link image spellchecker fullscreen media table preview contextmenu autoresize',
30+
toolbar: 'undo redo | link unlink | media image | styleselect removeformat | outdent indent | numlist bullist table | spellchecker preview fullscreen'
31+
})
2032
},
2133
methods: {
2234
showTitle(code) {
2335
return this.title == code
2436
},
37+
showMeta(code) {
38+
return this.meta == code
39+
},
2540
showBody(code) {
2641
return this.body == code
2742
},

src/resources/views/admin/bulma/menus/edit.blade.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,10 @@
44
@section('sub')
55
<h3 class="title">
66
<a href="{{ url()->previous() }}">Go Back</a>
7-
<a href="{{ route($crud_prefix.'.menus.create') }}" class="button is-success is-pulled-right">@lang('SimpleMenu::messages.app_add_new')</a>
7+
<a href="{{ route($crud_prefix.'.menus.create') }}"
8+
class="button is-success is-pulled-right">
9+
@lang('SimpleMenu::messages.app_add_new')
10+
</a>
811
</h3>
912

1013
<menu-comp inline-template

0 commit comments

Comments
 (0)