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

Commit b1c69ab

Browse files
committed
make page template fully dynamic
v3.2.0
1 parent 20bf18c commit b1c69ab

20 files changed

+106
-53
lines changed

README.md

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -90,11 +90,6 @@ return [
9090
'a' => 'is-active',
9191
],
9292

93-
/*
94-
* where to search for the template views ? (relative to "resources\views" folder)
95-
*/
96-
'templatePath' => 'pages',
97-
9893
/*
9994
* the path where we will save the routes list
10095
*/

logs/v3.1.7.txt

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

logs/v3.2.0.txt

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
- make page controller fully dynamic
2+
- make page template fully dynamic
3+
- fix menu list not taking full height
4+
- cleanup pages seeder
5+
- add search
6+
- update readme
7+
- update resources

src/Controllers/BaseController.php

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ class BaseController extends Controller
88
{
99
protected $cache;
1010
protected $adminPath;
11-
protected $templatePath;
1211
protected $crud_prefix;
1312
protected $userModel;
1413

@@ -20,7 +19,6 @@ public function __construct()
2019

2120
$this->cache = app('cache');
2221
$this->adminPath = 'SimpleMenu::admin.' . config('simpleMenu.framework');
23-
$this->templatePath = config('simpleMenu.templatePath');
2422
$this->crud_prefix = config('simpleMenu.crud_prefix');
2523
$this->userModel = app(config('simpleMenu.userModel'));
2624
}

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', 'meta', 'cover', 'breadCrumb'));
14+
return view($template, compact('title', 'body', 'desc', 'meta', 'cover', 'breadCrumb'));
1515
}
1616
}

src/config/simpleMenu.php

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,16 +11,14 @@
1111
],
1212

1313
/*
14-
* where to search for the template views ?
15-
* (relative to "resources\views" folder)
16-
* ex."resources\views\pages"
14+
* the path where we will save the routes list
1715
*/
18-
'templatePath' => 'pages',
16+
'routeListPath' => storage_path('logs/simpleMenu.php'),
1917

2018
/*
21-
* the path where we will save the routes list
19+
* dynamic pages controller namespace
2220
*/
23-
'routeListPath' => storage_path('logs/simpleMenu.php'),
21+
'pagesControllerNS' => 'App\Http\Controllers',
2422

2523
/*
2624
* where to redirect when a route is available in one locale "en" but not in another "fr" ?

src/database/seeds/PagesTableSeeder.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ public function run()
2020
$fr = $faker->unique()->city;
2121

2222
Page::create([
23-
'template' => 'hero',
23+
'template' => 'SimpleMenu::template-example',
2424
'route_name'=> str_slug($en),
2525
'title' => [
2626
'en' => title_case($en),

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
</div>
1515
<div class="field has-addons">
1616
<div class="control is-expanded">
17-
{{ Form::text('name', null, ['class' => 'input', 'placeholder'=>'name']) }}
17+
{{ Form::text('name', null, ['class' => 'input', 'placeholder' => 'name']) }}
1818
@if($errors->has('name'))
1919
<p class="help is-danger">
2020
{{ $errors->first('name') }}

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,8 @@ class="button is-success">
1919
</h3>
2020

2121
<sm-menu inline-template
22-
get-menu-pages="{{ route($crud_prefix.'.menus.getMenuPages',['id'=>$menu->id]) }}"
23-
del-page="{{ route($crud_prefix.'.menus.removePage',['id'=>$menu->id]) }}"
22+
get-menu-pages="{{ route($crud_prefix.'.menus.getMenuPages',['id' => $menu->id]) }}"
23+
del-page="{{ route($crud_prefix.'.menus.removePage',['id' => $menu->id]) }}"
2424
del-child="{{ route($crud_prefix.'.menus.removeChild') }}"
2525
locale="{{ LaravelLocalization::getCurrentLocale() }}">
2626
<div>

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -92,8 +92,8 @@ class="cbx-checkbox"
9292
{{ Form::open([
9393
'method' => 'DELETE',
9494
'route' => [$crud_prefix.'.menus.destroy', $menu->id],
95-
'data-id'=>'menu-'.$menu->id,
96-
'@submit.prevent'=>'DelItem($event,"'.$menu->name.'")'
95+
'data-id' => 'menu-'.$menu->id,
96+
'@submit.prevent' => 'DelItem($event,"'.$menu->name.'")'
9797
]) }}
9898
{{ Form::submit(trans('SimpleMenu::messages.delete'), ['class' => 'button is-danger']) }}
9999
{{ Form::close() }}

0 commit comments

Comments
 (0)