FEATURE: use more route model binding
This commit is contained in:
@@ -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,24 +3,33 @@
|
||||
@section('pageHeading', trans('categories::categories.overview'))
|
||||
|
||||
@section('content')
|
||||
@if(count($categories))
|
||||
<table class="table table-striped">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>@lang('categories::categories.name')</th>
|
||||
<th>@lang('categories::categories.module')</th>
|
||||
<th>@lang('categories::categories.actions')</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@foreach($categories as $category)
|
||||
@include('categories::admin.snippets.overviewRow', ['level' => 0, 'currentCategory' => $category])
|
||||
@endforeach
|
||||
</tbody>
|
||||
</table>
|
||||
@else
|
||||
<div class="alert alert-info">
|
||||
@lang('categories::categories.noCategories')
|
||||
|
||||
<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>
|
||||
<th>@lang('categories::categories.name')</th>
|
||||
<th>@lang('categories::categories.module')</th>
|
||||
<th>@lang('categories::categories.actions')</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@foreach($categories as $category)
|
||||
@include('categories::admin.snippets.overviewRow', ['level' => 0, 'currentCategory' => $category])
|
||||
@endforeach
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
@else
|
||||
<div class="alert alert-info">
|
||||
@lang('categories::categories.noCategories')
|
||||
</div>
|
||||
@endif
|
||||
</div>
|
||||
@endif
|
||||
</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']);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user