add breadcrumbs
This commit is contained in:
parent
de9cb50084
commit
8dd6567ccc
|
@ -1,5 +1,5 @@
|
|||
<?php
|
||||
namespace App\Http\Controllers\Settings;
|
||||
namespace App\Http\Controllers\Settings\Access;
|
||||
|
||||
use App\Models\Role;
|
||||
use App\Models\Permission;
|
||||
|
@ -16,7 +16,7 @@ class RoleController extends Controller
|
|||
public function index()
|
||||
{
|
||||
$roles = Role::all();
|
||||
return view('settings.role.role', compact('roles'));
|
||||
return view('settings.access.role.role', compact('roles'));
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -27,7 +27,7 @@ class RoleController extends Controller
|
|||
public function create()
|
||||
{
|
||||
$permissions = Permission::all('id', 'name');
|
||||
return view('settings.role.create', compact('permissions'));
|
||||
return view('settings.access.role.create', compact('permissions'));
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -58,7 +58,7 @@ class RoleController extends Controller
|
|||
}
|
||||
|
||||
return redirect()
|
||||
->route('role.index')
|
||||
->route('access.role.index')
|
||||
->with('success', 'Role has been created successfully');
|
||||
}
|
||||
|
||||
|
@ -86,7 +86,7 @@ class RoleController extends Controller
|
|||
|
||||
//$userRoles = $user->roles->pluck('name','name')->all();
|
||||
$checkeds = $role->perms->pluck('id')->toArray();
|
||||
return view('settings.role.edit', compact('role', 'permissions', 'checkeds'));
|
||||
return view('settings.access.role.edit', compact('role', 'permissions', 'checkeds'));
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -114,7 +114,7 @@ class RoleController extends Controller
|
|||
$role->perms()->detach(); //If no role is selected remove exisiting role associated to a user
|
||||
}
|
||||
|
||||
return redirect()->route('role.index')
|
||||
return redirect()->route('access.role.index')
|
||||
->with('flash_message', 'Role successfully edited.');
|
||||
}
|
||||
|
|
@ -1,5 +1,5 @@
|
|||
<?php
|
||||
namespace App\Http\Controllers\Settings;
|
||||
namespace App\Http\Controllers\Settings\Access;
|
||||
|
||||
use App\Http\Controllers\Controller;
|
||||
use App\Models\Role;
|
||||
|
@ -28,7 +28,7 @@ class UserController extends Controller
|
|||
$users = User::with('roles')
|
||||
->orderBy('id', 'DESC')
|
||||
->paginate(5);
|
||||
return view('settings.user.user', compact('users'))
|
||||
return view('settings.access.user.user', compact('users'))
|
||||
->with('i', ($request->input('page', 1) - 1) * 5);
|
||||
}
|
||||
|
||||
|
@ -41,7 +41,7 @@ class UserController extends Controller
|
|||
{
|
||||
//$roles = Role::pluck('name','name')->all();
|
||||
$roles = Role::all('id', 'name');
|
||||
return view('settings.user.create', compact('roles'));
|
||||
return view('settings.access.user.create', compact('roles'));
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -80,7 +80,7 @@ class UserController extends Controller
|
|||
}
|
||||
|
||||
return redirect()
|
||||
->route('settings.user.index')
|
||||
->route('access.user.index')
|
||||
->with('success', 'User has been created successfully');
|
||||
}
|
||||
|
||||
|
@ -93,7 +93,7 @@ class UserController extends Controller
|
|||
public function show($id)
|
||||
{
|
||||
$user = User::find($id);
|
||||
return view('settings.user.show', compact('user'));
|
||||
return view('settings.access.user.show', compact('user'));
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -110,7 +110,7 @@ class UserController extends Controller
|
|||
//$userRoles = $user->roles->pluck('name','name')->all();
|
||||
$checkeds = $user->roles->pluck('id')->toArray();
|
||||
|
||||
return view('settings.user.edit', compact('user', 'roles', 'checkeds'));
|
||||
return view('settings.access.user.edit', compact('user', 'roles', 'checkeds'));
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -150,7 +150,7 @@ class UserController extends Controller
|
|||
|
||||
//return back()->with('flash_message', 'user successfully updated.');
|
||||
return redirect()
|
||||
->route('settings.user.index')
|
||||
->route('access.user.index')
|
||||
->with('flash_message', 'User successfully edited.');
|
||||
}
|
||||
|
||||
|
@ -167,7 +167,7 @@ class UserController extends Controller
|
|||
$user->delete();
|
||||
|
||||
return redirect()
|
||||
->route('settings.user.index')
|
||||
->route('access.user.index')
|
||||
->with('flash_message', 'User successfully deleted.');
|
||||
}
|
||||
}
|
87
app/Http/Controllers/Settings/PageController.php
Normal file
87
app/Http/Controllers/Settings/PageController.php
Normal file
|
@ -0,0 +1,87 @@
|
|||
<?php
|
||||
|
||||
namespace App\Http\Controllers\Settings;
|
||||
|
||||
use App\Models\Page;
|
||||
use Illuminate\Http\Request;
|
||||
use App\Http\Controllers\Controller;
|
||||
use App\Http\Requests\Pages\IndexPageRequest;
|
||||
|
||||
class PageController extends Controller
|
||||
{
|
||||
/**
|
||||
* Display a listing of the resource.
|
||||
*
|
||||
* @return \Illuminate\Http\Response
|
||||
*/
|
||||
public function index(IndexPageRequest $request)
|
||||
{
|
||||
return new view('settings.pages.index');
|
||||
}
|
||||
|
||||
/**
|
||||
* Show the form for creating a new resource.
|
||||
*
|
||||
* @return \Illuminate\Http\Response
|
||||
*/
|
||||
public function create()
|
||||
{
|
||||
//
|
||||
}
|
||||
|
||||
/**
|
||||
* Store a newly created resource in storage.
|
||||
*
|
||||
* @param \Illuminate\Http\Request $request
|
||||
* @return \Illuminate\Http\Response
|
||||
*/
|
||||
public function store(Request $request)
|
||||
{
|
||||
//
|
||||
}
|
||||
|
||||
/**
|
||||
* Display the specified resource.
|
||||
*
|
||||
* @param \App\Models\Page $page
|
||||
* @return \Illuminate\Http\Response
|
||||
*/
|
||||
public function show(Page $page)
|
||||
{
|
||||
//
|
||||
}
|
||||
|
||||
/**
|
||||
* Show the form for editing the specified resource.
|
||||
*
|
||||
* @param \App\Models\Page $page
|
||||
* @return \Illuminate\Http\Response
|
||||
*/
|
||||
public function edit(Page $page)
|
||||
{
|
||||
//
|
||||
}
|
||||
|
||||
/**
|
||||
* Update the specified resource in storage.
|
||||
*
|
||||
* @param \Illuminate\Http\Request $request
|
||||
* @param \App\Models\Page $page
|
||||
* @return \Illuminate\Http\Response
|
||||
*/
|
||||
public function update(Request $request, Page $page)
|
||||
{
|
||||
//
|
||||
}
|
||||
|
||||
/**
|
||||
* Remove the specified resource from storage.
|
||||
*
|
||||
* @param \App\Models\Page $page
|
||||
* @return \Illuminate\Http\Response
|
||||
*/
|
||||
public function destroy(Page $page)
|
||||
{
|
||||
//
|
||||
}
|
||||
}
|
34
app/Http/Requests/Pages/IndexPageRequest.php
Normal file
34
app/Http/Requests/Pages/IndexPageRequest.php
Normal file
|
@ -0,0 +1,34 @@
|
|||
<?php
|
||||
|
||||
namespace App\Http\Requests\Pages;
|
||||
|
||||
use App\Http\Requests\Request;
|
||||
|
||||
/**
|
||||
* Class IndexPageRequest.
|
||||
*/
|
||||
class IndexPageRequest extends Request
|
||||
{
|
||||
/**
|
||||
* Determine if the user is authorized to make this request.
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function authorize()
|
||||
{
|
||||
//return access()->allow('view-page');
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the validation rules that apply to the request.
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function rules()
|
||||
{
|
||||
return [
|
||||
//
|
||||
];
|
||||
}
|
||||
}
|
34
app/Models/ModelTrait.php
Normal file
34
app/Models/ModelTrait.php
Normal file
|
@ -0,0 +1,34 @@
|
|||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
trait ModelTrait
|
||||
{
|
||||
/**
|
||||
* @return string
|
||||
*/
|
||||
public function getEditButtonAttribute($permission, $route)
|
||||
{
|
||||
if (access()->allow($permission)) {
|
||||
return '<a href="'.route($route, $this).'" class="btn btn-flat btn-default">
|
||||
<i data-toggle="tooltip" data-placement="top" title="Edit" class="fa fa-pencil"></i>
|
||||
</a>';
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @return string
|
||||
*/
|
||||
public function getDeleteButtonAttribute($permission, $route)
|
||||
{
|
||||
if (access()->allow($permission)) {
|
||||
return '<a href="'.route($route, $this).'"
|
||||
class="btn btn-flat btn-default" data-method="delete"
|
||||
data-trans-button-cancel="'.trans('buttons.general.cancel').'"
|
||||
data-trans-button-confirm="'.trans('buttons.general.crud.delete').'"
|
||||
data-trans-title="'.trans('strings.backend.general.are_you_sure').'">
|
||||
<i data-toggle="tooltip" data-placement="top" title="Delete" class="fa fa-trash"></i>
|
||||
</a>';
|
||||
}
|
||||
}
|
||||
}
|
53
app/Models/Page.php
Normal file
53
app/Models/Page.php
Normal file
|
@ -0,0 +1,53 @@
|
|||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use App\User;
|
||||
|
||||
class Page extends Model
|
||||
{
|
||||
/**
|
||||
* The database table used by the model.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $table;
|
||||
|
||||
/**
|
||||
* The guarded field which are not mass assignable.
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
protected $guarded = ['id'];
|
||||
|
||||
/**
|
||||
* The default values for attributes.
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
protected $attributes = [
|
||||
'created_by' => 1,
|
||||
];
|
||||
|
||||
protected $with = ['owner'];
|
||||
|
||||
public function __construct(array $attributes = [])
|
||||
{
|
||||
parent::__construct($attributes);
|
||||
$this->table = 'pages';//config('module.pages.table');
|
||||
}
|
||||
|
||||
public function owner()
|
||||
{
|
||||
return $this->belongsTo(User::class, 'created_by');
|
||||
}
|
||||
|
||||
/**
|
||||
* @return bool
|
||||
*/
|
||||
public function isActive()
|
||||
{
|
||||
return $this->status == 1;
|
||||
}
|
||||
}
|
|
@ -11,6 +11,7 @@
|
|||
"php": ">=7.0.0",
|
||||
"davejamesmiller/laravel-breadcrumbs": "4.x",
|
||||
"fideloper/proxy": "~3.3",
|
||||
"hieu-le/active": "^3.5",
|
||||
"laravel/framework": "5.5.*",
|
||||
"laravel/tinker": "~1.0",
|
||||
"laravelcollective/html": "^5.5.0",
|
||||
|
|
65
composer.lock
generated
65
composer.lock
generated
|
@ -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": "00e98bda68b015c9576d1e622624cb55",
|
||||
"content-hash": "12d5d5d5edbaf033404b80e81076f7fb",
|
||||
"packages": [
|
||||
{
|
||||
"name": "davejamesmiller/laravel-breadcrumbs",
|
||||
|
@ -379,6 +379,69 @@
|
|||
],
|
||||
"time": "2017-06-15T17:19:42+00:00"
|
||||
},
|
||||
{
|
||||
"name": "hieu-le/active",
|
||||
"version": "3.5.1",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/letrunghieu/active.git",
|
||||
"reference": "42d0f50be74b89d730bb4c0ee8c32447630506c6"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/letrunghieu/active/zipball/42d0f50be74b89d730bb4c0ee8c32447630506c6",
|
||||
"reference": "42d0f50be74b89d730bb4c0ee8c32447630506c6",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
"laravel/framework": "^5.5",
|
||||
"php": ">=7.0"
|
||||
},
|
||||
"require-dev": {
|
||||
"codeclimate/php-test-reporter": "dev-master",
|
||||
"orchestra/testbench": "^3.1",
|
||||
"phpunit/phpunit": "~6.0"
|
||||
},
|
||||
"type": "library",
|
||||
"extra": {
|
||||
"laravel": {
|
||||
"providers": [
|
||||
"HieuLe\\Active\\ActiveServiceProvider"
|
||||
],
|
||||
"aliases": {
|
||||
"Active": "HieuLe\\Active\\Facades\\Active"
|
||||
}
|
||||
}
|
||||
},
|
||||
"autoload": {
|
||||
"psr-4": {
|
||||
"HieuLe\\Active\\": "src/",
|
||||
"HieuLe\\ActiveTest\\": "tests/"
|
||||
},
|
||||
"files": [
|
||||
"src/helpers.php"
|
||||
]
|
||||
},
|
||||
"notification-url": "https://packagist.org/downloads/",
|
||||
"license": [
|
||||
"MIT"
|
||||
],
|
||||
"authors": [
|
||||
{
|
||||
"name": "Hieu Le",
|
||||
"email": "letrunghieu.cse09@gmail.com",
|
||||
"homepage": "https://www.hieule.info"
|
||||
}
|
||||
],
|
||||
"description": "The helper class for Laravel (4/5) applications to get active class base on current route",
|
||||
"homepage": "https://www.hieule.info/tag/laravel-active/",
|
||||
"keywords": [
|
||||
"active",
|
||||
"laravel",
|
||||
"routing"
|
||||
],
|
||||
"time": "2017-09-07T02:36:51+00:00"
|
||||
},
|
||||
{
|
||||
"name": "jakub-onderka/php-console-color",
|
||||
"version": "0.1",
|
||||
|
|
|
@ -32,4 +32,49 @@
|
|||
toggleClass(menuLink, active);
|
||||
};
|
||||
|
||||
var animationSpeed = 500;
|
||||
$('li h2', $(menu)).on('click', function(e) {
|
||||
//Get the clicked link and the next element
|
||||
var $this = $(this);
|
||||
var checkElement = $this.next();
|
||||
|
||||
//Check if the next element is a menu and is visible
|
||||
if ((checkElement.is('.treeview-menu')) && (checkElement.is(':visible'))) {
|
||||
//Close the menu
|
||||
checkElement.slideUp(animationSpeed, function() {
|
||||
checkElement.removeClass('menu-open');
|
||||
//Fix the layout in case the sidebar stretches over the height of the window
|
||||
//_this.layout.fix();
|
||||
});
|
||||
// checkElement.parent('li').removeClass('active');
|
||||
}
|
||||
//If the menu is not visible
|
||||
else if ((checkElement.is('.treeview-menu')) && (!checkElement.is(':visible'))) {
|
||||
//Get the parent menu
|
||||
var parent = $this.parents('ul').first();
|
||||
//Close all open menus within the parent
|
||||
var ul = parent.find('ul.treeview-menu:visible').slideUp(animationSpeed);
|
||||
//Remove the menu-open class from the parent
|
||||
ul.removeClass('menu-open');
|
||||
//Get the parent li
|
||||
var liParent = $this.parent('li');
|
||||
|
||||
//Open the target menu and add the menu-open class
|
||||
checkElement.slideDown(animationSpeed, function() {
|
||||
//Add the class active to the parent li
|
||||
checkElement.addClass('menu-open');
|
||||
// parent.find('li.active').removeClass('active');
|
||||
// liParent.addClass('active');
|
||||
//Fix the layout in case the sidebar stretches over the height of the window
|
||||
// _this.layout.fix();
|
||||
});
|
||||
}
|
||||
//if this isn't a link, prevent the page from being redirected
|
||||
if (checkElement.is('.treeview-menu')) {
|
||||
e.preventDefault();
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
|
||||
}(this, this.document));
|
|
@ -83,8 +83,8 @@
|
|||
<nav class="pure-menu pure-menu-horizontal custom-menu-right">
|
||||
<ul class="pure-menu-list">
|
||||
@if (Auth::guest())
|
||||
<li class="pure-menu-item {{ Route::currentRouteName() == 'login' ? 'active' : '' }}">
|
||||
<a class="pure-menu-link" href="{{ route('login') }}">LOGIN</a>
|
||||
<li class="pure-menu-item {{ Route::currentRouteName() == 'access.login' ? 'active' : '' }}">
|
||||
<a class="pure-menu-link" href="{{ route('access.login') }}">LOGIN</a>
|
||||
</li>
|
||||
<!--<li class="pure-menu-item"><a class="pure-menu-link" href="{{ url('register') }}">REGISTER</a></li>-->
|
||||
@else
|
||||
|
|
|
@ -241,7 +241,7 @@
|
|||
|
||||
@stop
|
||||
|
||||
@section('scripts')
|
||||
@section('after-scripts')
|
||||
{{-- <script type="text/javascript" src="{{ asset('js/lib.js') }}"></script> --}}
|
||||
|
||||
<script src="https://unpkg.com/axios/dist/axios.min.js"></script>
|
||||
|
|
|
@ -8,13 +8,13 @@
|
|||
</div>
|
||||
<div class="box-content">
|
||||
<div>
|
||||
<a href="{{ route('role.index') }}" class="pure-button button-small">
|
||||
<a href="{{ route('access.role.index') }}" class="pure-button button-small">
|
||||
<i class="fa fa-chevron-left"></i>
|
||||
<span>BACK</span>
|
||||
</a>
|
||||
</div>
|
||||
|
||||
{!! Form::open(['route' => 'role.store', 'method'=>'POST', 'class' => 'pure-form pure-form-aligned']) !!}
|
||||
{!! Form::open(['route' => 'access.role.store', 'method'=>'POST', 'class' => 'pure-form pure-form-aligned']) !!}
|
||||
|
||||
<div class="pure-control-group @if ($errors->has('name')) field-validation-error @endif">
|
||||
{!! Form::label('name', 'Name:', ['class' => 'control-label']) !!}
|
|
@ -11,7 +11,7 @@
|
|||
|
||||
<div class="pure-u-1 pure-u-md-2-3">
|
||||
<div>
|
||||
<a href="{{ route('role.index') }}" class="pure-button button-small">
|
||||
<a href="{{ route('access.role.index') }}" class="pure-button button-small">
|
||||
<i class="fa fa-chevron-left"></i>
|
||||
<span>BACK</span>
|
||||
</a>
|
||||
|
@ -29,7 +29,7 @@
|
|||
@endif
|
||||
|
||||
<div>
|
||||
{!! Form::model($role, ['method' => 'PATCH','route' => ['role.update', $role->id], 'class' => 'pure-form pure-form-aligned']) !!}
|
||||
{!! Form::model($role, ['method' => 'PATCH','route' => ['access.role.update', $role->id], 'class' => 'pure-form pure-form-aligned']) !!}
|
||||
|
||||
<fieldset>
|
||||
<div class="pure-control-group @if ($errors->has('name')) field-validation-error @endif">
|
|
@ -10,7 +10,7 @@
|
|||
|
||||
<div class="pure-g box-content">
|
||||
<div class="pure-u-1 pure-u-md-2-3">
|
||||
<a class="pure-button button-small is-primary" href="{{ route('role.create') }}">
|
||||
<a class="pure-button button-small is-primary" href="{{ route('access.role.create') }}">
|
||||
<i class="fa fa-plus-circle"></i>
|
||||
<span>Create New Role</span>
|
||||
</a>
|
||||
|
@ -34,7 +34,7 @@
|
|||
@endforeach
|
||||
</td>
|
||||
<td>
|
||||
<a class="edit" href="{{ route('role.edit', $role->id) }}"> Edit Role</a>
|
||||
<a class="edit" href="{{ route('access.role.edit', $role->id) }}"> Edit Role</a>
|
||||
</td>
|
||||
|
||||
</tr>
|
|
@ -20,12 +20,12 @@
|
|||
|
||||
<div class="box-content">
|
||||
<div>
|
||||
<a href="{{ route('settings.user.index') }}" class="pure-button button-small">
|
||||
<a href="{{ route('access.user.index') }}" class="pure-button button-small">
|
||||
<i class="fa fa-chevron-left"></i>
|
||||
<span>BACK</span>
|
||||
</a>
|
||||
</div>
|
||||
{!! Form::open(['route' => 'settings.user.store', 'method'=>'POST', 'class' => 'pure-form pure-form-aligned']) !!}
|
||||
{!! Form::open(['route' => 'access.user.store', 'method'=>'POST', 'class' => 'pure-form pure-form-aligned']) !!}
|
||||
|
||||
<div class="pure-control-group @if ($errors->has('login')) field-validation-error @endif">
|
||||
<label>Login:</label>
|
|
@ -11,7 +11,7 @@
|
|||
<div class="pure-g box-content">
|
||||
<div class="pure-u-1 pure-u-md-2-3">
|
||||
<div>
|
||||
<a href="{{ route('settings.user.index') }}" class="pure-button button-small">
|
||||
<a href="{{ route('access.user.index') }}" class="pure-button button-small">
|
||||
<i class="fa fa-chevron-left"></i>
|
||||
<span>BACK</span>
|
||||
</a>
|
||||
|
@ -29,7 +29,7 @@
|
|||
@endif
|
||||
|
||||
<div>
|
||||
{!! Form::model($user, ['method' => 'PATCH','route' => ['settings.user.update', $user->id], 'class' => 'pure-form pure-form-aligned']) !!}
|
||||
{!! Form::model($user, ['method' => 'PATCH','route' => ['access.user.update', $user->id], 'class' => 'pure-form pure-form-aligned']) !!}
|
||||
|
||||
<fieldset>
|
||||
<div class="pure-control-group @if ($errors->has('login')) field-validation-error @endif">
|
|
@ -11,7 +11,7 @@
|
|||
<div class="pure-g box-content">
|
||||
|
||||
<div class="pure-u-1 pure-u-md-2-3">
|
||||
<a class="pure-button button-small is-primary" href="{{ route('settings.user.create') }}">
|
||||
<a class="pure-button button-small is-primary" href="{{ route('access.user.create') }}">
|
||||
<i class="fa fa-plus-circle"></i>
|
||||
<span>Create New User</span>
|
||||
</a>
|
||||
|
@ -47,9 +47,9 @@
|
|||
@endif
|
||||
</td>
|
||||
<td>
|
||||
<a class="edit" href="{{ route('settings.user.edit', $user->id) }}"> Edit</a>
|
||||
<a class="edit" href="{{ route('access.user.edit', $user->id) }}"> Edit</a>
|
||||
<span> </span>
|
||||
<a class="delete" href="{{ route('settings.user.destroy', $user->id) }}"><span> Delete</span></a>
|
||||
<a class="delete" href="{{ route('access.user.destroy', $user->id) }}"><span> Delete</span></a>
|
||||
</td>
|
||||
</tr>
|
||||
@endforeach
|
|
@ -41,7 +41,7 @@
|
|||
</div> --}}
|
||||
@endsection
|
||||
|
||||
@section('scripts')
|
||||
@section('after-scripts')
|
||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/Chart.js/2.2.1/Chart.min.js"></script>
|
||||
<script>
|
||||
var ctx = document.getElementById("myChart");
|
||||
|
|
|
@ -29,74 +29,105 @@
|
|||
</a>
|
||||
|
||||
<div id="menu">
|
||||
<nav class="pure-menu">
|
||||
<nav class="pure-menu sidebar-menu">
|
||||
<h1 class="site-logo">Admin<strong>Rdr</strong></h1>
|
||||
<div class="menu-item-divided"></div>
|
||||
|
||||
<h2 class="pure-menu-heading">Home</h2>
|
||||
<ul class="pure-menu-list">
|
||||
<li class="pure-menu-item {{ Route::is('settings.dashboard') ? 'active' : '' }}">
|
||||
{{-- <h2 class="pure-menu-heading">Home</h2> --}}
|
||||
<ul class=" pure-menu-list sidebar-menu">
|
||||
<h2 class="pure-menu-heading">Home</h2>
|
||||
|
||||
{{-- <li class="pure-menu-item {{ Route::is('settings.dashboard') ? 'active' : '' }}">
|
||||
<a href="{{ route('settings.dashboard') }}" class="pure-menu-link">Reports</a>
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
@permission('settings')
|
||||
<h2 class="pure-menu-heading">Settings</h2>
|
||||
<ul class="pure-menu-list">
|
||||
<li class="pure-menu-item {{ Route::is('settings.document*') ? 'active' : '' }}">
|
||||
<a class="pure-menu-link" href="{{ route('settings.document') }}"><i class="fa fa-database"></i> Datasets</a>
|
||||
</li>
|
||||
<li class="pure-menu-item {{ Route::is('settings.collection*') ? 'active' : '' }}">
|
||||
<a class="pure-menu-link" href="{{ route('settings.collection') }}"><i class="fa fa-archive"></i> Collections</a>
|
||||
</li>
|
||||
<li class="pure-menu-item {{ Route::is('settings.license*') ? 'active' : '' }}">
|
||||
<a href="{{ route('settings.license') }}" class="pure-menu-link"><i class="fa fa-file"></i> Licenses</a>
|
||||
</li>
|
||||
<li class="pure-menu-item {{ Route::is('settings.person*') ? 'active' : '' }}">
|
||||
<a href="{{ route('settings.person') }}" class="pure-menu-link"><i class="fa fa-edit"></i> Persons</a>
|
||||
</li>
|
||||
<li class="pure-menu-item {{ Route::is('settings.project*') ? 'active' : '' }}">
|
||||
<a class="pure-menu-link" href="{{ route('settings.project') }}"><i class="fa fa-tasks"></i> Projects</a>
|
||||
</li>
|
||||
</li> --}}
|
||||
|
||||
|
||||
</ul>
|
||||
@endpermission
|
||||
|
||||
@permission('review')
|
||||
<h2 class="pure-menu-heading">Publish</h2>
|
||||
<ul class="pure-menu-list">
|
||||
<li class="pure-menu-item {{ Route::is('publish.dataset.*') ? 'active' : '' }}">
|
||||
<a class="pure-menu-link" href="{{ URL::route('publish.dataset.create') }}"><i class="fa fa-upload"></i> Publish</a>
|
||||
</li>
|
||||
</ul>
|
||||
@endpermission
|
||||
|
||||
<h2 class="pure-menu-heading">Access Management</h2>
|
||||
<ul class="pure-menu-list">
|
||||
@if (Auth::guest())
|
||||
<li class="pure-menu-item {{ Route::currentRouteName() == 'login' ? 'active' : '' }}">
|
||||
<a class="pure-menu-link" href="{{ route('login') }}">LOGIN</a>
|
||||
<li class="{{ active_class(Route::is('settings.dashboard')) }}">
|
||||
<a href="{{ route('settings.dashboard') }}">
|
||||
<i class="fa fa-dashboard"></i>
|
||||
<span>Reports</span>
|
||||
</a>
|
||||
</li>
|
||||
@else
|
||||
|
||||
@permission('settings')
|
||||
<li class="pure-menu-item {{ Route::is('settings.user.*') ? 'active' : '' }}">
|
||||
<a class="pure-menu-link" href="{{route('settings.user.index') }}"><i class="fa fa-users"></i> User Management</a>
|
||||
</li>
|
||||
<li class="pure-menu-item {{ Route::is('role.*') ? 'active' : '' }}">
|
||||
<a class="pure-menu-link" href="{{route('role.index') }}"><i class="fa fa-key"></i> Role Management</a>
|
||||
</li>
|
||||
<li class="pure-menu-item">
|
||||
<a class="pure-menu-link" href="{{ route('settings.user.edit',['id'=>Auth::user()->id]) }}"><i class="fa fa-user"></i> EDIT</a>
|
||||
</li>
|
||||
@endpermission
|
||||
<li class="pure-menu-item"><a class="pure-menu-link" href="{{ route('logout') }}"><i class="fa fa-sign-out"></i>Logout</a></li>
|
||||
@endif
|
||||
<li class="treeview">
|
||||
<h2 class="pure-menu-heading">Settings <span class="fa fa-angle-down"></h2>
|
||||
<ul class="pure-menu-list treeview-menu {{ active_class(Route::is('settings.*'), 'menu-open') }}" style="display: none; {{ active_class(Route::is('settings.*'), 'display: block;') }}">
|
||||
<li class="pure-menu-item {{ Route::is('settings.document*') ? 'active' : '' }}">
|
||||
<a class="pure-menu-link" href="{{ route('settings.document') }}"><i class="fa fa-database"></i> Datasets</a>
|
||||
</li>
|
||||
<li class="pure-menu-item {{ Route::is('settings.collection*') ? 'active' : '' }}">
|
||||
<a class="pure-menu-link" href="{{ route('settings.collection') }}"><i class="fa fa-archive"></i> Collections</a>
|
||||
</li>
|
||||
<li class="pure-menu-item {{ Route::is('settings.license*') ? 'active' : '' }}">
|
||||
<a href="{{ route('settings.license') }}" class="pure-menu-link"><i class="fa fa-file"></i> Licenses</a>
|
||||
</li>
|
||||
<li class="pure-menu-item {{ Route::is('settings.person*') ? 'active' : '' }}">
|
||||
<a href="{{ route('settings.person') }}" class="pure-menu-link"><i class="fa fa-edit"></i> Persons</a>
|
||||
</li>
|
||||
<li class="pure-menu-item {{ Route::is('settings.project*') ? 'active' : '' }}">
|
||||
<a class="pure-menu-link" href="{{ route('settings.project') }}"><i class="fa fa-tasks"></i> Projects</a>
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
</li>
|
||||
@endpermission
|
||||
|
||||
@permission('review')
|
||||
<li class="{{ active_class(Active::checkUriPattern('publish/dataset/*')) }}">
|
||||
<h2 class="pure-menu-heading">Publish</h2>
|
||||
<ul class="pure-menu-list">
|
||||
<li class="pure-menu-item {{ Route::is('publish.dataset.*') ? 'active' : '' }}">
|
||||
<a class="pure-menu-link" href="{{ URL::route('publish.dataset.create') }}"><i class="fa fa-upload"></i> Publish</a>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
@endpermission
|
||||
|
||||
|
||||
<li class="treeview">
|
||||
<h2 class="pure-menu-heading">Access Management <span class="fa fa-angle-down"></h2>
|
||||
<ul class="pure-menu-list treeview-menu {{ active_class(Route::is('access.*'), 'menu-open') }}" style="display: none; {{ active_class(Route::is('access.*'), 'display: block;') }}">
|
||||
@if (Auth::guest())
|
||||
<li class="pure-menu-item {{ Route::currentRouteName() == 'access.login' ? 'active' : '' }}">
|
||||
<a class="pure-menu-link" href="{{ route('access.login') }}">LOGIN</a>
|
||||
</li>
|
||||
@else
|
||||
@permission('settings')
|
||||
<li class="pure-menu-item {{ Route::is('access.user.*') ? 'active' : '' }}">
|
||||
<a class="pure-menu-link" href="{{route('access.user.index') }}"><i class="fa fa-users"></i> User Management</a>
|
||||
</li>
|
||||
<li class="pure-menu-item {{ Route::is('access.role.*') ? 'active' : '' }}">
|
||||
<a class="pure-menu-link" href="{{route('access.role.index') }}"><i class="fa fa-key"></i> Role Management</a>
|
||||
</li>
|
||||
<li class="pure-menu-item">
|
||||
<a class="pure-menu-link" href="{{ route('access.user.edit',['id'=>Auth::user()->id]) }}"><i class="fa fa-user"></i> EDIT</a>
|
||||
</li>
|
||||
@endpermission
|
||||
<li class="pure-menu-item">
|
||||
<a class="pure-menu-link" href="{{ route('logout') }}"><i class="fa fa-sign-out"></i>Logout</a>
|
||||
</li>
|
||||
@endif
|
||||
|
||||
|
||||
|
||||
{{-- @if (Auth::guest())
|
||||
<li class="pure-menu-item {{ Route::currentRouteName() == 'login' ? 'active' : '' }}">
|
||||
<a class="pure-menu-link" href="{{ route('login') }}">LOGIN</a>
|
||||
</li>
|
||||
@else
|
||||
<li class="pure-menu-item"><a class="pure-menu-link" href="{{ route('logout') }}"><i class="fa fa-sign-out"></i>Logout</a></li>
|
||||
@endif --}}
|
||||
</ul>
|
||||
</li>
|
||||
|
||||
|
||||
</ul>
|
||||
</nav>
|
||||
|
||||
</div>
|
||||
|
||||
<div id="main">
|
||||
|
||||
<div class="header">
|
||||
<div class="pure-g">
|
||||
<div class="pure-u-1-2"><h1>Dashboard</h1></div>
|
||||
|
@ -121,100 +152,22 @@
|
|||
@if(Breadcrumbs::exists())
|
||||
{!! Breadcrumbs::render() !!}
|
||||
@endif
|
||||
{{-- <div class="pure-g"> --}}
|
||||
<div class="box">
|
||||
<div class="l-box">
|
||||
@include('partials.flash')
|
||||
@yield('content')
|
||||
</div>
|
||||
<div class="l-box">
|
||||
@include('partials.flash')
|
||||
@yield('content')
|
||||
</div>
|
||||
</div>
|
||||
{{-- <div class="pure-u-1-2 box">
|
||||
<div class="l-box">
|
||||
<div class="header">
|
||||
<h3 class="header-title">Message</h3>
|
||||
</div>
|
||||
<div class="box-content">
|
||||
|
||||
<form class="pure-form pure-form-stacked">
|
||||
<div class="pure-g">
|
||||
<div class="pure-u-1-1">
|
||||
<label for="title">Title</label>
|
||||
<input id="title" type="text" class="pure-u-1-1">
|
||||
|
||||
<label for="post">Post Content</label>
|
||||
<textarea id="post" rows="10" class="pure-u-1-1"></textarea>
|
||||
|
||||
<hr>
|
||||
|
||||
<button class="pure-button pure-button-primary">Save</button>
|
||||
<button class="pure-button">Save in Draft</button>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div> --}}
|
||||
{{-- </div> --}}
|
||||
|
||||
{{-- <div class="pure-g">
|
||||
<div class="pure-u-1-2 box">
|
||||
<div class="l-box">
|
||||
<div class="header">
|
||||
<h3 class="header-title">Messages</h3>
|
||||
</div>
|
||||
<div class="box-content">
|
||||
<span class="msg success"><i class="fa fa-check"></i>Message sending success!</span>
|
||||
<span class="msg error"><i class="fa fa-ban"></i>Message NOT sending verify errors!</span>
|
||||
<span class="msg alert"><i class="fa fa-exclamation-triangle"></i>Your permit geolocalization?</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="pure-u-1-2 box">
|
||||
<div class="l-box">
|
||||
<div class="header">
|
||||
<h3 class="header-title">Lists Content</h3>
|
||||
</div>
|
||||
<div class="box-content">
|
||||
<p>adfas</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div> --}}
|
||||
|
||||
{{-- <div class="pure-g">
|
||||
<div class="pure-u-4-5">
|
||||
<div class="l-box">
|
||||
<div class="header">
|
||||
<h3 class="header-title">Edit Item</h3>
|
||||
</div>
|
||||
<div class="box-content">
|
||||
<p>Content</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="pure-u-1-5">
|
||||
<div class="l-box">
|
||||
<div class="header">
|
||||
<h3 class="header-title">Sidebar</h3>
|
||||
</div>
|
||||
<div class="box-content">
|
||||
<p>Sidebar content</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div> --}}
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<!-- JavaScripts -->
|
||||
@yield('before-scripts')
|
||||
<script type="text/javascript" src="{{ asset('js/lib.js') }}"></script>
|
||||
<script type="text/javascript">
|
||||
$('div.alert').not('alert-important');//.delay(3000).slideUp(300);
|
||||
</script>
|
||||
<script type="text/javascript" src="{{ asset('assets/functions.js') }}"></script>
|
||||
@yield('scripts')
|
||||
@yield('after-scripts')
|
||||
</div>
|
||||
|
||||
</body>
|
||||
|
|
|
@ -10,17 +10,44 @@ Breadcrumbs::register('publish.dataset.create', function ($breadcrumbs) {
|
|||
$breadcrumbs->push('Publish', route('publish.dataset.create'));
|
||||
});
|
||||
|
||||
Breadcrumbs::register('settings.user.index', function ($breadcrumbs) {
|
||||
|
||||
Breadcrumbs::register('access.user.index', function ($breadcrumbs) {
|
||||
$breadcrumbs->parent('settings.dashboard');
|
||||
$breadcrumbs->push('Users Management', route('settings.user.index'));
|
||||
$breadcrumbs->push('User Management', route('access.user.index'));
|
||||
});
|
||||
|
||||
Breadcrumbs::register('settings.user.edit', function ($breadcrumbs, $id) {
|
||||
$breadcrumbs->parent('settings.user.index');
|
||||
$breadcrumbs->push("users.edit", route('settings.user.edit', $id));
|
||||
Breadcrumbs::register('access.user.edit', function ($breadcrumbs, $id) {
|
||||
$breadcrumbs->parent('access.user.index');
|
||||
$breadcrumbs->push("edit" . $id, route('access.user.edit', $id));
|
||||
});
|
||||
|
||||
Breadcrumbs::register('settings.user.create', function ($breadcrumbs) {
|
||||
$breadcrumbs->parent('settings.user.index');
|
||||
$breadcrumbs->push('users.create', route('settings.user.create'));
|
||||
Breadcrumbs::register('access.user.create', function ($breadcrumbs) {
|
||||
$breadcrumbs->parent('access.user.index');
|
||||
$breadcrumbs->push('users.create', route('access.user.create'));
|
||||
});
|
||||
|
||||
Breadcrumbs::register('access.role.index', function ($breadcrumbs) {
|
||||
$breadcrumbs->parent('settings.dashboard');
|
||||
$breadcrumbs->push('Role Management', route('access.role.index'));
|
||||
});
|
||||
Breadcrumbs::register('access.role.edit', function ($breadcrumbs, $id) {
|
||||
$breadcrumbs->parent('access.role.index');
|
||||
$breadcrumbs->push('edit ' . $id, route('access.role.edit', $id));
|
||||
});
|
||||
|
||||
|
||||
|
||||
Breadcrumbs::register('settings.document', function ($breadcrumbs) {
|
||||
$breadcrumbs->parent('settings.dashboard');
|
||||
$breadcrumbs->push('Dataset Management', route('settings.document'));
|
||||
});
|
||||
|
||||
Breadcrumbs::register('settings.document.edit', function ($breadcrumbs, $id) {
|
||||
$breadcrumbs->parent('settings.document');
|
||||
$breadcrumbs->push('edit ' . $id, route('settings.document.edit', $id));
|
||||
});
|
||||
|
||||
Breadcrumbs::register('settings.document.show', function ($breadcrumbs, $id) {
|
||||
$breadcrumbs->parent('settings.document');
|
||||
$breadcrumbs->push('show ' . $id, route('settings.document.show', $id));
|
||||
});
|
||||
|
|
|
@ -36,47 +36,59 @@ Route::group(
|
|||
);
|
||||
|
||||
//=================================================setting users====================================================
|
||||
Route::group(
|
||||
[
|
||||
'namespace' => 'Settings\Access',
|
||||
'middleware' => ['permission:settings'],
|
||||
'prefix' => 'settings/access',
|
||||
'as' => 'access.'
|
||||
],
|
||||
function () {
|
||||
//Route::resource('users','UserController');
|
||||
Route::get('user', [
|
||||
'as' => 'user.index', 'uses' => 'UserController@index',
|
||||
]);
|
||||
Route::get('user/create', [
|
||||
'as' => 'user.create', 'uses' => 'UserController@create',
|
||||
]);
|
||||
Route::post('user/store', [
|
||||
'as' => 'user.store', 'uses' => 'UserController@store',
|
||||
]);
|
||||
Route::get('user/edit/{id}', [
|
||||
'as' => 'user.edit', 'uses' => 'UserController@edit',
|
||||
]);
|
||||
Route::patch('user/update/{id}', [
|
||||
'as' => 'user.update', 'uses' => 'UserController@update',
|
||||
]);
|
||||
Route::get('user/destroy/{id}', [
|
||||
'as' => 'user.destroy', 'uses' => 'UserController@destroy',
|
||||
]);
|
||||
|
||||
//Route::resource('users','RoleController');
|
||||
Route::get('role', [
|
||||
'as' => 'role.index', 'uses' => 'RoleController@index',
|
||||
]);
|
||||
Route::get('role/create', [
|
||||
'as' => 'role.create', 'uses' => 'RoleController@create',
|
||||
]);
|
||||
Route::post('role/store', [
|
||||
'as' => 'role.store', 'uses' => 'RoleController@store',
|
||||
]);
|
||||
Route::get('role/edit/{id}', [
|
||||
'as' => 'role.edit', 'uses' => 'RoleController@edit',
|
||||
]);
|
||||
Route::patch('role/update/{id}', [
|
||||
'as' => 'role.update', 'uses' => 'RoleController@update',
|
||||
]);
|
||||
}
|
||||
);
|
||||
|
||||
//=================================================setting dashboard====================================================
|
||||
Route::get('settings/', [
|
||||
'as' => 'settings.dashboard', 'uses' => 'Settings\DashboardController@index',
|
||||
]);
|
||||
|
||||
Route::group(['middleware' => ['permission:settings']], function () {
|
||||
//Route::resource('users','UserController');
|
||||
Route::get('settings/user', [
|
||||
'as' => 'settings.user.index', 'uses' => 'Settings\UserController@index',
|
||||
]);
|
||||
Route::get('settings/user/create', [
|
||||
'as' => 'settings.user.create', 'uses' => 'Settings\UserController@create',
|
||||
]);
|
||||
Route::post('settings/user/store', [
|
||||
'as' => 'settings.user.store', 'uses' => 'Settings\UserController@store',
|
||||
]);
|
||||
Route::get('settings/user/edit/{id}', [
|
||||
'as' => 'settings.user.edit', 'uses' => 'Settings\UserController@edit',
|
||||
]);
|
||||
Route::patch('settings/user/update/{id}', [
|
||||
'as' => 'settings.user.update', 'uses' => 'Settings\UserController@update',
|
||||
]);
|
||||
Route::get('settings/user/destroy/{id}', [
|
||||
'as' => 'settings.user.destroy', 'uses' => 'Settings\UserController@destroy',
|
||||
]);
|
||||
|
||||
//Route::resource('users','RoleController');
|
||||
Route::get('settings/role', [
|
||||
'as' => 'role.index', 'uses' => 'Settings\RoleController@index',
|
||||
]);
|
||||
Route::get('settings/role/create', [
|
||||
'as' => 'role.create', 'uses' => 'Settings\RoleController@create',
|
||||
]);
|
||||
Route::post('settings/role/store', [
|
||||
'as' => 'role.store', 'uses' => 'Settings\RoleController@store',
|
||||
]);
|
||||
Route::get('settings/role/edit/{id}', [
|
||||
'as' => 'role.edit', 'uses' => 'Settings\RoleController@edit',
|
||||
]);
|
||||
Route::patch('settings/role/update/{id}', [
|
||||
'as' => 'role.update', 'uses' => 'Settings\RoleController@update',
|
||||
]);
|
||||
|
||||
//=============================================================================================================
|
||||
//=================================================setting dataset=============================================
|
||||
|
@ -282,7 +294,7 @@ Route::get('settings/book/delete/{id}', [
|
|||
// 'password' => 'Auth\PasswordController',
|
||||
// ]);
|
||||
//Auth::routes();
|
||||
$this->get('login', 'Auth\LoginController@showLoginForm')->name('login');
|
||||
$this->get('login', 'Auth\LoginController@showLoginForm')->name('access.login');
|
||||
$this->post('login', 'Auth\LoginController@login');
|
||||
$this->get('logout', 'Auth\LoginController@logout')->name('logout');
|
||||
// Registration Routes...
|
||||
|
|
Loading…
Reference in New Issue
Block a user