FEATURE: use more route model binding
This commit is contained in:
@@ -27,12 +27,12 @@ class WidgetAreas
|
||||
|
||||
protected static function loadWidgetArea($uniqueCode)
|
||||
{
|
||||
dd($uniqueCode);
|
||||
WidgetArea::where('code', $uniqueCode)
|
||||
->increment('viewed');
|
||||
|
||||
$widgets = Cache::remember('widget-area-' . $uniqueCode, setting('widgetCacheLifetime', 5), function () use ($uniqueCode) {
|
||||
$widgetArea = new WidgetArea();
|
||||
$widgetArea = app(\App\CMS\Repositories\Widgets\WidgetArea::class);
|
||||
|
||||
return $widgetArea->getWidgets($uniqueCode)
|
||||
->get();
|
||||
});
|
||||
@@ -69,6 +69,8 @@ class WidgetAreas
|
||||
self::initWidgetAreas();
|
||||
}
|
||||
|
||||
// dd($uniqueCode);
|
||||
|
||||
if (!isset(self::$widgetAreas[$uniqueCode])) {
|
||||
self::loadWidgetArea($uniqueCode);
|
||||
}
|
||||
|
||||
@@ -7,6 +7,8 @@ use App\CMS\Interactions\Admin\Content\ChangeStatus;
|
||||
use App\CMS\Interactions\Admin\Content\DeletePage;
|
||||
use App\CMS\Interactions\Admin\Content\SetHomepage;
|
||||
use App\Http\Controllers\Admin\Controller;
|
||||
use App\Models\Content\Content;
|
||||
use App\Models\Content\ContentHistory;
|
||||
|
||||
class ContentActions extends Controller
|
||||
{
|
||||
@@ -25,15 +27,13 @@ class ContentActions extends Controller
|
||||
* This method is called in static page overview from quick actions. It checks if status is valid, if page exists
|
||||
* and updates status.
|
||||
*
|
||||
* @param $id
|
||||
* @param Content $page
|
||||
* @param $status
|
||||
*
|
||||
* @return \Illuminate\Http\RedirectResponse
|
||||
*/
|
||||
public function changeStatus($id, $status)
|
||||
public function changeStatus(Content $page, $status)
|
||||
{
|
||||
$page = $this->content->getOne($id);
|
||||
|
||||
Interaction::handle(ChangeStatus::class, ['status' => $status], $page);
|
||||
|
||||
// redirect back to overview with info for user
|
||||
@@ -45,14 +45,12 @@ class ContentActions extends Controller
|
||||
/**
|
||||
* Delete page
|
||||
*
|
||||
* @param $id
|
||||
* @param Content $page
|
||||
*
|
||||
* @return \Illuminate\Http\RedirectResponse
|
||||
*/
|
||||
public function delete($id)
|
||||
public function delete(Content $page)
|
||||
{
|
||||
$page = $this->content->getOne($id);
|
||||
|
||||
Interaction::handle(DeletePage::class, [], $page);
|
||||
|
||||
// redirect back to overview with info for user
|
||||
@@ -66,14 +64,12 @@ class ContentActions extends Controller
|
||||
/**
|
||||
* Sets page as homepage
|
||||
*
|
||||
* @param $id
|
||||
* @param Content $page
|
||||
*
|
||||
* @return \Illuminate\Http\RedirectResponse
|
||||
*/
|
||||
public function setHomepage($id)
|
||||
public function setHomepage(Content $page)
|
||||
{
|
||||
$page = $this->content->getOne($id);
|
||||
|
||||
Interaction::handle(SetHomepage::class, [], $page);
|
||||
|
||||
// redirect back to overview with info for user
|
||||
|
||||
@@ -5,6 +5,7 @@ use App\CMS\Contracts\Repositories\Content as IContent;
|
||||
use App\CMS\Contracts\Repositories\Module as IModule;
|
||||
use App\CMS\Enumerations\ContentStatuses;
|
||||
use App\Http\Controllers\Admin\Controller;
|
||||
use App\Models\Module;
|
||||
|
||||
class ContentOverview extends Controller
|
||||
{
|
||||
@@ -26,19 +27,19 @@ class ContentOverview extends Controller
|
||||
/**
|
||||
* Overview for all content pages.
|
||||
*
|
||||
* @param null|int $moduleId
|
||||
* @param Module|null $module
|
||||
* @param null $status
|
||||
*
|
||||
* @return \Illuminate\Contracts\View\Factory|\Illuminate\View\View
|
||||
* @internal param int|null $moduleId
|
||||
*/
|
||||
public function index($moduleId = null, $status = null)
|
||||
public function index(Module $module = null, $status = null)
|
||||
{
|
||||
// get module settings
|
||||
$module = $this->module->getOne($moduleId);
|
||||
$pageHeading = $this->module->getOverviewTitle($module);
|
||||
|
||||
// get pages for overview
|
||||
$handler = $module !== null ? $module->handler : null;
|
||||
$handler = $module->exists ? $module->handler : null;
|
||||
$pages = $this->content->getOverview($handler, [$status])
|
||||
->paginate(setting('paginatedResults', 20));
|
||||
|
||||
|
||||
@@ -10,6 +10,7 @@ use App\Cms\Interactions\Admin\Content\NewContent;
|
||||
use App\Http\Controllers\Admin\Controller;
|
||||
use App\Http\Requests\CreateNewContentRequest;
|
||||
use App\Http\Requests\Request;
|
||||
use App\Models\Module;
|
||||
use Modules\Categories\Contracts\Repositories\Category as ICategory;
|
||||
|
||||
/**
|
||||
@@ -67,9 +68,8 @@ class CreateNewContent extends Controller
|
||||
*
|
||||
* @return \Illuminate\Contracts\View\Factory|\Illuminate\View\View
|
||||
*/
|
||||
public function create($module)
|
||||
public function create(Module $module)
|
||||
{
|
||||
$module = $this->module->getOne($module);
|
||||
$statuses = ContentStatuses::getWithTranslations();
|
||||
$pageHeading = $this->module->getCreateContentTitle($module);
|
||||
$templates = $this->template->getForModule($module);
|
||||
@@ -95,15 +95,14 @@ class CreateNewContent extends Controller
|
||||
/**
|
||||
* Save new content page
|
||||
*
|
||||
* @param CreateNewContentRequest $request
|
||||
* @param $moduleId
|
||||
* @param CreateNewContentRequest|Request $request
|
||||
* @param Module $module
|
||||
*
|
||||
* @return \Illuminate\Http\RedirectResponse
|
||||
* @internal param $moduleId
|
||||
*/
|
||||
public function store(Request $request, $moduleId)
|
||||
public function store(Request $request, Module $module)
|
||||
{
|
||||
$module = $this->module->getOne($moduleId);
|
||||
|
||||
// create new page
|
||||
Interaction::handle(NewContent::class, $request->all(), $module->handler);
|
||||
|
||||
|
||||
@@ -72,14 +72,13 @@ class EditContent extends Controller
|
||||
/**
|
||||
* Display form for editing static page
|
||||
*
|
||||
* @param $id
|
||||
* @param Content $page
|
||||
*
|
||||
* @return \Illuminate\Contracts\View\Factory|\Illuminate\View\View
|
||||
*/
|
||||
public function edit($id)
|
||||
public function edit(Content $page)
|
||||
{
|
||||
$statuses = ContentStatuses::getWithTranslations();
|
||||
$page = $this->content->getOne($id);
|
||||
|
||||
// get module ID
|
||||
$module = $this->module->getByHandler($page->moduleHandler);
|
||||
@@ -106,29 +105,14 @@ class EditContent extends Controller
|
||||
/**
|
||||
* Edit static page and save changes into history.
|
||||
*
|
||||
* @param EditContentRequest $request
|
||||
* @param $id
|
||||
* @param EditContentRequest|Request $request
|
||||
* @param Content $page
|
||||
*
|
||||
* @return \Illuminate\Http\RedirectResponse
|
||||
* @internal param $id
|
||||
*/
|
||||
public function update(Request $request, $id)
|
||||
public function update(Request $request, Content $page)
|
||||
{
|
||||
try {
|
||||
/**
|
||||
* @var $page Content
|
||||
*/
|
||||
$page = $this->content->getOne($id);
|
||||
} catch (NotFoundHttpException $e) {
|
||||
|
||||
// log attempt of invalid edit
|
||||
Event::fire(new AttemptToEditInvalidContent($id));
|
||||
|
||||
// page for editing not found
|
||||
return redirect()
|
||||
->route('content.overview')
|
||||
->with('error', trans('admin/contents.invalidPage'));
|
||||
}
|
||||
|
||||
// edit page
|
||||
Interaction::handle(EditContentInteraction::class, $request->all(), $page);
|
||||
|
||||
|
||||
@@ -19,30 +19,31 @@ class History extends Controller
|
||||
}
|
||||
|
||||
/**
|
||||
* @param $id
|
||||
* @param Content $page
|
||||
*
|
||||
* @return \Illuminate\Contracts\View\Factory|\Illuminate\View\View
|
||||
*/
|
||||
public function getOverview($id)
|
||||
public function getOverview(Content $page)
|
||||
{
|
||||
// test if given content id is static page and if exists
|
||||
$content = Content::findOrFail($id);
|
||||
|
||||
$history = $this->history->getStructuredHistoryOf($content);
|
||||
$history = $this->history->getStructuredHistoryOf($page);
|
||||
|
||||
return view('admin/history.overview', [
|
||||
'history' => $history,
|
||||
'page' => $content
|
||||
'page' => $page
|
||||
]);
|
||||
}
|
||||
|
||||
public function getDiff($revision, $id)
|
||||
/**
|
||||
* @param ContentHistory $revision
|
||||
*
|
||||
* @return \Illuminate\Contracts\View\Factory|\Illuminate\View\View
|
||||
*/
|
||||
public function getDiff(ContentHistory $revision)
|
||||
{
|
||||
$change = $this->history->findOrFail($id);
|
||||
$diff = $this->history->getDiff($change);
|
||||
$diff = $this->history->getDiff($revision);
|
||||
|
||||
return view('admin/history.diff', [
|
||||
'change' => $change,
|
||||
'change' => $revision,
|
||||
'diff' => $diff
|
||||
]);
|
||||
}
|
||||
|
||||
@@ -32,12 +32,12 @@ class UploadedFilesOverview extends Controller
|
||||
*/
|
||||
public function index(Directory $directory = null)
|
||||
{
|
||||
// include hidden directories?
|
||||
$includeHidden = Input::get('hidden');
|
||||
// dd($directory);
|
||||
|
||||
// include hidden directories?
|
||||
$subdirectories = $this->directoryRepository->getAllSubdirectories($directory);
|
||||
|
||||
if (!$includeHidden) {
|
||||
if (!Input::get('hidden', true)) {
|
||||
$subdirectories = $subdirectories->where('hidden', false);
|
||||
}
|
||||
|
||||
|
||||
@@ -3,6 +3,7 @@
|
||||
namespace App\Http\Controllers\Admin\Widgets\Areas;
|
||||
|
||||
use App\CMS\Repositories\Widgets\WidgetArea as WidgetAreaRepository;
|
||||
use App\Events\DeleteWidgetArea;
|
||||
use App\Http\Controllers\Admin\Controller;
|
||||
use App\Http\Requests\EditWidgetAreaRequest;
|
||||
use App\Models\Widgets\Widget;
|
||||
@@ -39,6 +40,7 @@ class EditWidgetArea extends Controller
|
||||
*/
|
||||
public function edit(WidgetArea $widgetArea)
|
||||
{
|
||||
return view("test");
|
||||
$associatedWidgetIds = WidgetInWidgetArea::getWidgetIdsFromArea($widgetArea->id);
|
||||
$widgets = Widget::where('language', LaravelLocalization::getCurrentLocale())
|
||||
->paginate(25);
|
||||
@@ -83,26 +85,14 @@ class EditWidgetArea extends Controller
|
||||
}
|
||||
|
||||
// delete area
|
||||
$area->delete();
|
||||
$widgetArea->delete();
|
||||
|
||||
// fire event with new widget area
|
||||
Event::fire(new \App\Events\DeleteWidgetArea($area));
|
||||
Event::fire(new DeleteWidgetArea($widgetArea));
|
||||
|
||||
// redirect and inform user
|
||||
return redirect()
|
||||
->route('widgetareas.overview')
|
||||
->with('success', trans('admin/widgetAreas.successfullyDeleted'));
|
||||
}
|
||||
|
||||
/**
|
||||
* Redirect user to overview with message about invalid widget area
|
||||
*
|
||||
* @return \Illuminate\Http\RedirectResponse
|
||||
*/
|
||||
private function invalidArea()
|
||||
{
|
||||
return redirect()
|
||||
->route('widgetareas.overview')
|
||||
->with('error', trans('admin/widgetAreas.invalidArea'));
|
||||
}
|
||||
}
|
||||
|
||||
+2
-6
@@ -18,9 +18,7 @@ class Kernel extends HttpKernel
|
||||
{
|
||||
/**
|
||||
* The application's global HTTP middleware stack.
|
||||
*
|
||||
* These middleware are run during every request to your application.
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
protected $middleware = [
|
||||
@@ -33,7 +31,6 @@ class Kernel extends HttpKernel
|
||||
];
|
||||
/**
|
||||
* The application's route middleware groups.
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
protected $middlewareGroups = [
|
||||
@@ -53,9 +50,7 @@ class Kernel extends HttpKernel
|
||||
];
|
||||
/**
|
||||
* The application's route middleware.
|
||||
*
|
||||
* These middleware may be assigned to groups or used individually.
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
protected $routeMiddleware = [
|
||||
@@ -66,6 +61,7 @@ class Kernel extends HttpKernel
|
||||
'throttle' => ThrottleRequests::class,
|
||||
'localize' => LaravelLocalizationRoutes::class,
|
||||
'localizationRedirect' => LaravelLocalizationRedirectFilter::class,
|
||||
'localeSessionRedirect' => LocaleSessionRedirect::class
|
||||
'localeSessionRedirect' => LocaleSessionRedirect::class,
|
||||
'bindings' => \Illuminate\Routing\Middleware\SubstituteBindings::class,
|
||||
];
|
||||
}
|
||||
|
||||
+1
-1
@@ -11,7 +11,7 @@ Route::pattern('url', '[0-9\-a-z]+');
|
||||
|
||||
/*******************************************************************************/
|
||||
|
||||
Route::group(['prefix' => LaravelLocalization::setLocale()], function () {
|
||||
Route::group(['prefix' => LaravelLocalization::setLocale(), 'middleware' => ['bindings']], function () {
|
||||
/**
|
||||
* This route group serves to handle request in admin
|
||||
*/
|
||||
|
||||
@@ -9,34 +9,34 @@ Route::group(['namespace' => 'Contents'], function () {
|
||||
->name('content.new');
|
||||
|
||||
// form for editing existing static page
|
||||
Route::get('content/edit/{id}', 'EditContent@edit')
|
||||
Route::get('content/edit/{page}', 'EditContent@edit')
|
||||
->name('content.edit');
|
||||
|
||||
// post method for creating new static page
|
||||
Route::post('content/new/{moduleId}', 'CreateNewContent@store')
|
||||
Route::post('content/new/{module}', 'CreateNewContent@store')
|
||||
->name('content.newPost');
|
||||
|
||||
// post method for creating new static page
|
||||
Route::post('content/edit/{id}', 'EditContent@update')
|
||||
Route::post('content/edit/{page}', 'EditContent@update')
|
||||
->name('content.editPost');
|
||||
|
||||
// change status of page (protected, public or draft)
|
||||
Route::get('content/status/{id}/{status}', 'ContentActions@changeStatus')
|
||||
Route::get('content/status/{page}/{status}', 'ContentActions@changeStatus')
|
||||
->name('content.changeStatus');
|
||||
|
||||
// set homepage
|
||||
Route::get('content/homepage/{id}', 'ContentActions@setHomepage')
|
||||
Route::get('content/homepage/{page}', 'ContentActions@setHomepage')
|
||||
->name('content.setHomepage');
|
||||
|
||||
// delete page
|
||||
Route::get('content/delete/{id}', 'ContentActions@delete')
|
||||
Route::get('content/delete/{page}', 'ContentActions@delete')
|
||||
->name('content.delete');
|
||||
|
||||
// history of changes for specified page
|
||||
Route::get('history/{id}', 'History@getOverview')
|
||||
Route::get('history/{page}', 'History@getOverview')
|
||||
->name('content.history');
|
||||
|
||||
// history of changes for specified page
|
||||
Route::get('history/{revision}/{id}', 'History@getDiff')
|
||||
Route::get('history/{revision}', 'History@getDiff')
|
||||
->name('history.diff');
|
||||
});
|
||||
@@ -27,4 +27,9 @@ class Module extends Model
|
||||
'is_template' => 'boolean',
|
||||
'has_submodules' => 'boolean'
|
||||
];
|
||||
|
||||
public function getRouteKeyName()
|
||||
{
|
||||
return 'alias';
|
||||
}
|
||||
}
|
||||
@@ -2,30 +2,45 @@
|
||||
|
||||
namespace App\Providers;
|
||||
|
||||
use Illuminate\Routing\Router;
|
||||
use Illuminate\Foundation\Support\Providers\RouteServiceProvider as ServiceProvider;
|
||||
use Illuminate\Support\Facades\Route;
|
||||
|
||||
class RouteServiceProvider extends ServiceProvider
|
||||
{
|
||||
/**
|
||||
* This namespace is applied to the controller routes in your routes file.
|
||||
*
|
||||
* This namespace is applied to your controller routes.
|
||||
* In addition, it is set as the URL generator's root namespace.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $namespace = 'App\Http\Controllers';
|
||||
|
||||
/**
|
||||
* Define the routes for the application.
|
||||
*
|
||||
* @param \Illuminate\Routing\Router $router
|
||||
* Define your route model bindings, pattern filters, etc.
|
||||
* @return void
|
||||
*/
|
||||
public function map(Router $router)
|
||||
public function boot()
|
||||
{
|
||||
$router->group(['namespace' => $this->namespace], function ($router) {
|
||||
require app_path('Http/routes.php');
|
||||
});
|
||||
parent::boot();
|
||||
}
|
||||
|
||||
/**
|
||||
* Define the routes for the application.
|
||||
* @return void
|
||||
*/
|
||||
public function map()
|
||||
{
|
||||
$this->mapWebRoutes();
|
||||
}
|
||||
|
||||
/**
|
||||
* Define the "web" routes for the application.
|
||||
* These routes all receive session state, CSRF protection, etc.
|
||||
* @return void
|
||||
*/
|
||||
protected function mapWebRoutes()
|
||||
{
|
||||
Route::namespace($this->namespace)
|
||||
->middleware('web')
|
||||
->group(app_path('Http/routes.php'));
|
||||
}
|
||||
}
|
||||
@@ -1,9 +1,8 @@
|
||||
<?php namespace Modules\Categories\Http\Controllers;
|
||||
|
||||
use App\CMS\Enumerations\ModuleNamesWithIds;
|
||||
use App\Models\Module;
|
||||
use App\Http\Controllers\Admin\Controller;
|
||||
use Modules\Categories\Entities\Category;
|
||||
use Pingpong\Modules\Routing\Controller;
|
||||
|
||||
class CategoriesOverview extends Controller
|
||||
{
|
||||
|
||||
@@ -1,17 +1,16 @@
|
||||
<?php namespace Modules\Categories\Http\Controllers;
|
||||
|
||||
use App\Http\Controllers\Admin\Controller;
|
||||
use App\Http\Requests\Request;
|
||||
use App\Models\Module;
|
||||
use Illuminate\Support\Facades\Auth;
|
||||
use Illuminate\Support\Str;
|
||||
use Modules\Categories\Entities\Category;
|
||||
use Pingpong\Modules\Routing\Controller;
|
||||
|
||||
class CreateNewCategory extends Controller
|
||||
{
|
||||
/**
|
||||
* Display form for new category
|
||||
*
|
||||
* @return \Illuminate\Contracts\View\Factory|\Illuminate\View\View
|
||||
*/
|
||||
public function getNew()
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
<?php namespace Modules\Categories\Http\Controllers;
|
||||
|
||||
use App\Http\Controllers\Admin\Controller;
|
||||
use App\Http\Requests\Request;
|
||||
use App\Models\Module;
|
||||
use Illuminate\Support\Str;
|
||||
use Modules\Categories\Entities\Category;
|
||||
use Pingpong\Modules\Routing\Controller;
|
||||
|
||||
class EditCategory extends Controller
|
||||
{
|
||||
|
||||
@@ -3,7 +3,13 @@
|
||||
@section('pageHeading', trans('categories::categories.overview'))
|
||||
|
||||
@section('content')
|
||||
|
||||
<div class="card items">
|
||||
<div class="card-block">
|
||||
|
||||
@if(count($categories))
|
||||
<div class="item-list striped rows-striped">
|
||||
|
||||
<table class="table table-striped">
|
||||
<thead>
|
||||
<tr>
|
||||
@@ -18,9 +24,12 @@
|
||||
@endforeach
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
@else
|
||||
<div class="alert alert-info">
|
||||
@lang('categories::categories.noCategories')
|
||||
</div>
|
||||
@endif
|
||||
</div>
|
||||
</div>
|
||||
@stop
|
||||
@@ -1,11 +1,33 @@
|
||||
<tr>
|
||||
<td>
|
||||
{{str_repeat('-', $level)}} {{$currentCategory['name']}}
|
||||
{{str_repeat('-', $level)}} <a href="{{route('categories.edit', ['id' => $currentCategory['id']])}}">{{$currentCategory['name']}}</a>
|
||||
</td>
|
||||
<td>@lang($modules[$currentCategory['module_id']])</td>
|
||||
<td>
|
||||
<a href="{{route('categories.edit', ['id' => $currentCategory['id']])}}"><i class="fa fa-fw fa-edit"></i></a>
|
||||
<a class="confirm" href="{{route('categories.delete', ['id' => $currentCategory['id']])}}"><i class="fa fa-fw fa-remove"></i></a>
|
||||
<div class="item-actions-dropdown">
|
||||
<a class="item-actions-toggle-btn">
|
||||
<span class="inactive">
|
||||
<i class="fa fa-cog"></i>
|
||||
</span>
|
||||
<span class="active">
|
||||
<i class="fa fa-chevron-circle-right"></i>
|
||||
</span>
|
||||
</a>
|
||||
<div class="item-actions-block">
|
||||
<ul class="item-actions-list">
|
||||
|
||||
<li>
|
||||
<a href="{{route('categories.edit', ['id' => $currentCategory['id']])}}"><i
|
||||
class="fa fa-fw fa-pencil"></i></a>
|
||||
</li>
|
||||
<li>
|
||||
<a class="confirm remove"
|
||||
href="{{route('categories.delete', ['id' => $currentCategory['id']])}}"><i
|
||||
class="fa fa-fw fa-trash"></i></a>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
|
||||
@@ -1,15 +0,0 @@
|
||||
{
|
||||
"name": "pingpong-modules/categories",
|
||||
"description": "",
|
||||
"authors": [
|
||||
{
|
||||
"name": "Pingpong Labs",
|
||||
"email": "pingpong.labs@gmail.com"
|
||||
}
|
||||
],
|
||||
"autoload": {
|
||||
"psr-4": {
|
||||
"Modules\\Categories\\": ""
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -187,9 +187,8 @@ class Gallery implements AppHandler
|
||||
$menu = \Menu::instance('mainMenu');
|
||||
$submenu = $menu->whereTitle(trans('admin/mainMenu.contentPages'));
|
||||
$submenu->dropdown(trans('gallery::module.name'), function ($submenu) use ($user) {
|
||||
$submenu->route('content.new', trans('gallery::admin/adminMenu.new'), ['moduleId' => self::getModuleId()], 10, ['icon' => 'fa fa-plus']);
|
||||
$submenu->route('content.overview', trans('gallery::admin/adminMenu.overview'), ['moduleId' => self::getModuleId()], 20, ['icon' => 'fa fa-list']);
|
||||
// $submenu->route('emails.sent', trans('contactform::admin/adminMenu.sentMessages'), [], 30, ['icon' => 'fa fa-send']);
|
||||
$submenu->route('content.new', trans('gallery::admin/adminMenu.new'), ['module' => 'gallery'], 10, ['icon' => 'fa fa-plus']);
|
||||
$submenu->route('content.overview', trans('gallery::admin/adminMenu.overview'), ['module' => 'gallery'], 20, ['icon' => 'fa fa-list']);
|
||||
}, 25, ['icon' => 'fa fa-camera']);
|
||||
}
|
||||
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
@section('headerButtons')
|
||||
|
||||
@if($module->exists === true)
|
||||
<a href="{{route('content.new', ['moduleId' => $module->id])}}" class="btn btn-primary btn-sm rounded">
|
||||
<a href="{{route('content.new', ['module' => $module])}}" class="btn btn-primary btn-sm rounded">
|
||||
<i class="fa fa-plus"></i>
|
||||
</a>
|
||||
@endif
|
||||
@@ -36,7 +36,7 @@
|
||||
@foreach($pages as $page)
|
||||
<div class="row p-tb-15">
|
||||
<div class="col-md-1 hidden-sm-down text-center with-placeholder">
|
||||
<a href="{{route('content.edit', ['id' => $page->id])}}">
|
||||
<a href="{{route('content.edit', ['page' => $page])}}">
|
||||
@if(!view()->exists(template_name($page->template, false)))
|
||||
<i class="fa fa-2x text-warning fa-warning" data-toggle="tooltip"
|
||||
title="@lang('admin/contents.invalidTemplateSelected')"></i>
|
||||
@@ -53,7 +53,7 @@
|
||||
</a>
|
||||
</div>
|
||||
<div class="col-xs-10 col-md-3 col-lg-4">
|
||||
<a href="{{route('content.edit', ['id' => $page->id])}}">
|
||||
<a href="{{route('content.edit', ['page' => $page])}}">
|
||||
{{$page->title}}
|
||||
</a>
|
||||
|
||||
@@ -66,7 +66,7 @@
|
||||
@else tag-warning @endif">{{$statuses[$page->status]}}</span>
|
||||
</div>
|
||||
<div class="col-lg-2 col-md-3 hidden-sm-down">
|
||||
<a href="{{route('content.overview', ['moduleId' => $page->module_id])}}">
|
||||
<a href="{{route('content.overview', ['module' => $page->module->alias])}}">
|
||||
{{trans($page->module_name)}}
|
||||
</a>
|
||||
</div>
|
||||
@@ -87,7 +87,7 @@
|
||||
@if(!$page->isHomepage)
|
||||
<li>
|
||||
|
||||
<a href="{{route('content.setHomepage', ['id' => $page->id])}}"
|
||||
<a href="{{route('content.setHomepage', ['page' => $page])}}"
|
||||
data-toggle="tooltip"
|
||||
title="@lang('admin/contents.setHomepage')">
|
||||
<i class="fa fa-home"></i>
|
||||
@@ -96,7 +96,7 @@
|
||||
@endif
|
||||
|
||||
<li>
|
||||
<a class="edit" href="{{route('content.edit', ['id' => $page->id])}}"
|
||||
<a class="edit" href="{{route('content.edit', ['page' => $page])}}"
|
||||
data-toggle="tooltip" title="@lang('admin/contents.editPlain')">
|
||||
<i class="fa fa-pencil"></i>
|
||||
</a>
|
||||
@@ -104,14 +104,14 @@
|
||||
|
||||
@if($page->isDraft())
|
||||
<li>
|
||||
<a href="{{route('content.changeStatus', ['id' => $page->id, 'status' => 'public'])}}"
|
||||
<a href="{{route('content.changeStatus', ['page' => $page, 'status' => 'public'])}}"
|
||||
class="confirm" data-toggle="tooltip"
|
||||
title="@lang('admin/contents.makePublic')">
|
||||
<i class="fa fa-eye"></i>
|
||||
</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="{{route('content.changeStatus', ['id' => $page->id, 'status' => 'protected'])}}"
|
||||
<a href="{{route('content.changeStatus', ['page' => $page, 'status' => 'protected'])}}"
|
||||
class="confirm" data-toggle="tooltip"
|
||||
title="@lang('admin/contents.makeProtected')">
|
||||
<i class="fa fa-lock"></i>
|
||||
@@ -126,7 +126,7 @@
|
||||
</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="{{route('content.changeStatus', ['id' => $page->id, 'status' => 'draft'])}}"
|
||||
<a href="{{route('content.changeStatus', ['page' => $page, 'status' => 'draft'])}}"
|
||||
class="button tiny warning confirm" data-toggle="tooltip"
|
||||
title="@lang('admin/contents.makeDraft')">
|
||||
<i class="fa fa-eye-slash"></i>
|
||||
@@ -135,7 +135,7 @@
|
||||
@endif
|
||||
|
||||
<li>
|
||||
<a href="{{route('content.delete', ['id' => $page->id])}}"
|
||||
<a href="{{route('content.delete', ['page' => $page])}}"
|
||||
class="button tiny alert remove confirm" data-toggle="tooltip"
|
||||
title="@lang('admin/contents.deletePage')"><i
|
||||
class="fa fa-trash-o"></i>
|
||||
|
||||
@@ -14,6 +14,8 @@
|
||||
<div class="col-lg-4">
|
||||
<h3>@lang('admin/widgets.preview')</h3>
|
||||
|
||||
{{-- {{dd($area)}}--}}
|
||||
|
||||
@widgetArea($area->code)
|
||||
</div>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user