From de9cb50084c4768bfe76884a9c9b33b10c2d5784 Mon Sep 17 00:00:00 2001 From: Arno Kaimbacher Date: Fri, 31 Aug 2018 16:47:04 +0200 Subject: [PATCH] breadcrumbs --- app/Http/Controllers/Auth/LoginController.php | 2 +- .../Controllers/Publish/IndexController.php | 11 ++- ...Controller.php => DashboardController.php} | 4 +- .../Controllers/Settings/UserController.php | 6 +- composer.json | 17 ++--- composer.lock | 61 +++++++++++++++- config/app.php | 16 +++-- config/breadcrumbs.php | 71 +++++++++++++++++++ public/js/app.js | 13 +--- resources/views/auth/login.blade.php | 3 +- resources/views/partials/nav.blade.php | 4 +- .../views/publish/create-step1.blade.php | 12 +++- .../views/publish/create-step1Old.blade.php | 2 +- .../views/publish/create-step2.blade.php | 2 +- .../views/publish/create-step3.blade.php | 2 +- .../settings/collection/collection.blade.php | 2 +- .../index.blade.php => dashboard.blade.php} | 4 +- .../settings/document/document.blade.php | 2 +- .../views/settings/document/edit.blade.php | 2 +- .../views/settings/document/show.blade.php | 2 +- .../includes/partials/breadcrumbs.blade.php | 14 ++++ .../layouts/app.blade.php} | 26 ++++--- .../views/settings/license/edit.blade.php | 2 +- .../views/settings/license/license.blade.php | 2 +- resources/views/settings/person/add.blade.php | 2 +- .../views/settings/person/edit.blade.php | 2 +- .../views/settings/person/person.blade.php | 2 +- .../views/settings/project/add.blade.php | 2 +- .../views/settings/project/category.blade.php | 2 +- .../views/settings/project/edit.blade.php | 2 +- .../views/settings/role/create.blade.php | 2 +- resources/views/settings/role/edit.blade.php | 2 +- resources/views/settings/role/role.blade.php | 2 +- .../views/settings/user/create.blade.php | 6 +- resources/views/settings/user/edit.blade.php | 6 +- resources/views/settings/user/user.blade.php | 8 +-- routes/breadcrumbs.php | 26 +++++++ routes/web.php | 38 ++++++---- 38 files changed, 290 insertions(+), 94 deletions(-) rename app/Http/Controllers/Settings/{HomeController.php => DashboardController.php} (81%) create mode 100644 config/breadcrumbs.php rename resources/views/settings/{home/index.blade.php => dashboard.blade.php} (96%) create mode 100644 resources/views/settings/includes/partials/breadcrumbs.blade.php rename resources/views/{layouts/settings/layout.blade.php => settings/layouts/app.blade.php} (90%) create mode 100644 routes/breadcrumbs.php diff --git a/app/Http/Controllers/Auth/LoginController.php b/app/Http/Controllers/Auth/LoginController.php index e98b6c0..fe02e64 100644 --- a/app/Http/Controllers/Auth/LoginController.php +++ b/app/Http/Controllers/Auth/LoginController.php @@ -46,6 +46,6 @@ class LoginController extends Controller $request->session()->regenerate(); - return redirect('/settings'); + return redirect('/'); } } diff --git a/app/Http/Controllers/Publish/IndexController.php b/app/Http/Controllers/Publish/IndexController.php index b54a064..676f1da 100644 --- a/app/Http/Controllers/Publish/IndexController.php +++ b/app/Http/Controllers/Publish/IndexController.php @@ -7,6 +7,7 @@ use App\Http\Controllers\Controller; use App\License; use App\Models\File; use App\Person; +use App\Project; use App\Models\Title; use App\Rules\RdrFiletypes; use App\Rules\RdrFilesize; @@ -44,8 +45,9 @@ class IndexController extends Controller $persons = Person::where('status', 1) ->pluck('last_name', 'id'); + $projects = Project::pluck('label', 'id'); - return view('publish.create-step1', compact('licenses', 'languages', 'persons')); + return view('publish.create-step1', compact('licenses', 'languages', 'persons', 'projects')); } /** @@ -219,6 +221,8 @@ class IndexController extends Controller 'belongs_to_bibliography' => 'required|boolean', 'title_main.value' => 'required|min:5', 'title_main.language' => 'required', + 'abstract_main.value' => 'required|min:5', + 'abstract_main.language' => 'required', ]; if (null != $request->file('files')) { $files = count($request->file('files')) - 1; @@ -288,8 +292,8 @@ class IndexController extends Controller $dataset->addMainAbstract($abstract); } - // $error = 'Always throw this error'; - // throw new \Exception($error); + $error = 'Always throw this error'; + throw new \Exception($error); // all good//commit everything DB::commit(); @@ -318,6 +322,7 @@ class IndexController extends Controller } return response()->json(array( + 'success' => true, 'redirect' => route('settings.document', ['state' => $dataset->server_state]), )); } else { diff --git a/app/Http/Controllers/Settings/HomeController.php b/app/Http/Controllers/Settings/DashboardController.php similarity index 81% rename from app/Http/Controllers/Settings/HomeController.php rename to app/Http/Controllers/Settings/DashboardController.php index b6d5a20..457102e 100644 --- a/app/Http/Controllers/Settings/HomeController.php +++ b/app/Http/Controllers/Settings/DashboardController.php @@ -4,7 +4,7 @@ namespace App\Http\Controllers\Settings; use App\Http\Controllers\Controller; use Illuminate\View\View; -class HomeController extends Controller +class DashboardController extends Controller { /** * Create a new controller instance. @@ -22,6 +22,6 @@ class HomeController extends Controller */ public function index(): View { - return view('settings.home.index'); + return view('settings.dashboard'); } } diff --git a/app/Http/Controllers/Settings/UserController.php b/app/Http/Controllers/Settings/UserController.php index cab4687..20a8c35 100644 --- a/app/Http/Controllers/Settings/UserController.php +++ b/app/Http/Controllers/Settings/UserController.php @@ -80,7 +80,7 @@ class UserController extends Controller } return redirect() - ->route('user.index') + ->route('settings.user.index') ->with('success', 'User has been created successfully'); } @@ -150,7 +150,7 @@ class UserController extends Controller //return back()->with('flash_message', 'user successfully updated.'); return redirect() - ->route('user.index') + ->route('settings.user.index') ->with('flash_message', 'User successfully edited.'); } @@ -167,7 +167,7 @@ class UserController extends Controller $user->delete(); return redirect() - ->route('user.index') + ->route('settings.user.index') ->with('flash_message', 'User successfully deleted.'); } } diff --git a/composer.json b/composer.json index 61d4ea0..103e79c 100755 --- a/composer.json +++ b/composer.json @@ -9,11 +9,12 @@ "type": "project", "require": { "php": ">=7.0.0", + "davejamesmiller/laravel-breadcrumbs": "4.x", "fideloper/proxy": "~3.3", "laravel/framework": "5.5.*", "laravel/tinker": "~1.0", "laravelcollective/html": "^5.5.0", - "solarium/solarium": "^3.8", + "solarium/solarium": "^3.8", "zizaco/entrust": "^1.9" }, "require-dev": { @@ -23,7 +24,7 @@ "autoload": { "classmap": [ "database/seeds", - "database/factories" + "database/factories" ], "psr-4": { "App\\": "app/" @@ -38,15 +39,15 @@ "post-install-cmd": [ "php artisan clear-compiled", "php artisan optimize" - ], - "post-update-cmd": [ - "php artisan clear-compiled", - "php artisan optimize" - ], + ], "post-create-project-cmd": [ "php -r \"copy('.env.example', '.env');\"", "php artisan key:generate" - ] + ], + "post-autoload-dump": [ + "Illuminate\\Foundation\\ComposerScripts::postAutoloadDump", + "@php artisan package:discover" + ] }, "config": { "preferred-install": "dist", diff --git a/composer.lock b/composer.lock index 4f60b62..12798ad 100755 --- a/composer.lock +++ b/composer.lock @@ -4,8 +4,67 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "7de5582e0d6336834f655fa43be0ed7c", + "content-hash": "00e98bda68b015c9576d1e622624cb55", "packages": [ + { + "name": "davejamesmiller/laravel-breadcrumbs", + "version": "4.2.0", + "source": { + "type": "git", + "url": "https://github.com/davejamesmiller/laravel-breadcrumbs.git", + "reference": "368d7b3a2cd21fe2e648756e5d01d3fe4fbe98e1" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/davejamesmiller/laravel-breadcrumbs/zipball/368d7b3a2cd21fe2e648756e5d01d3fe4fbe98e1", + "reference": "368d7b3a2cd21fe2e648756e5d01d3fe4fbe98e1", + "shasum": "" + }, + "require": { + "illuminate/support": "5.5.*", + "illuminate/view": "5.5.*", + "php": ">=7.0.0" + }, + "require-dev": { + "laravel/framework": "5.5.*", + "orchestra/testbench": "3.5.*", + "phpunit/phpunit": "6.*", + "satooshi/php-coveralls": "1.0.*" + }, + "type": "library", + "extra": { + "laravel": { + "providers": [ + "DaveJamesMiller\\Breadcrumbs\\BreadcrumbsServiceProvider" + ], + "aliases": { + "Breadcrumbs": "DaveJamesMiller\\Breadcrumbs\\Facades\\Breadcrumbs" + } + } + }, + "autoload": { + "psr-4": { + "DaveJamesMiller\\Breadcrumbs\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT License" + ], + "authors": [ + { + "name": "Dave James Miller", + "email": "dave@davejamesmiller.com", + "homepage": "https://davejamesmiller.com/" + } + ], + "description": "A simple Laravel-style way to create breadcrumbs.", + "homepage": "https://github.com/davejamesmiller/laravel-breadcrumbs", + "keywords": [ + "laravel" + ], + "time": "2017-09-14T08:23:50+00:00" + }, { "name": "dnoegel/php-xdg-base-dir", "version": "0.1", diff --git a/config/app.php b/config/app.php index 0062c41..73f8987 100755 --- a/config/app.php +++ b/config/app.php @@ -78,7 +78,7 @@ return [ | */ - 'locale' => 'en', + 'locale' => env('APP_LOCALE', 'en'), /* |-------------------------------------------------------------------------- @@ -91,7 +91,7 @@ return [ | */ - 'fallback_locale' => 'en', + 'fallback_locale' => env('APP_FALLBACK_LOCALE', 'en'), /* |-------------------------------------------------------------------------- @@ -140,7 +140,7 @@ return [ /* * Laravel Framework Service Providers... */ - 'Illuminate\Auth\AuthServiceProvider', + Illuminate\Auth\AuthServiceProvider::class, Illuminate\Broadcasting\BroadcastServiceProvider::class, 'Illuminate\Bus\BusServiceProvider', 'Illuminate\Cache\CacheServiceProvider', @@ -164,8 +164,12 @@ return [ 'Illuminate\Validation\ValidationServiceProvider', 'Illuminate\View\ViewServiceProvider', + /* + * Package Service Providers... + */ // 'Illuminate\Html\HtmlServiceProvider', // 'Collective\Html\HtmlServiceProvider', + Zizaco\Entrust\EntrustServiceProvider::class, /* * Application Service Providers... @@ -178,7 +182,7 @@ return [ // List off others providers... App\Providers\SolariumServiceProvider::class, - Zizaco\Entrust\EntrustServiceProvider::class, + ], @@ -228,10 +232,14 @@ return [ 'Validator' => 'Illuminate\Support\Facades\Validator', 'View' => 'Illuminate\Support\Facades\View', + /* + * Third Party Aliases + */ // 'Form' => 'Illuminate\Html\FormFacade', // 'HTML' => 'Illuminate\Html\HtmlFacade', // 'Form' => 'Collective\Html\FormFacade', // 'Html' => 'Collective\Html\HtmlFacade', + 'Breadcrumbs' => DaveJamesMiller\Breadcrumbs\Facade::class, ], diff --git a/config/breadcrumbs.php b/config/breadcrumbs.php new file mode 100644 index 0000000..18b5027 --- /dev/null +++ b/config/breadcrumbs.php @@ -0,0 +1,71 @@ + 'breadcrumbs::bootstrap4', + 'view' => 'settings.includes.partials.breadcrumbs', + + /* + |-------------------------------------------------------------------------- + | Breadcrumbs File(s) + |-------------------------------------------------------------------------- + | + | The file(s) where breadcrumbs are defined. e.g. + | + | - base_path('routes/breadcrumbs.php') + | - glob(base_path('breadcrumbs/*.php')) + | + */ + + 'files' => base_path('routes/breadcrumbs.php'), + + /* + |-------------------------------------------------------------------------- + | Exceptions + |-------------------------------------------------------------------------- + | + | Determine when to throw an exception. + | + */ + + // When route-bound breadcrumbs are used but the current route doesn't have a name (UnnamedRouteException) + 'unnamed-route-exception' => true, + + // When route-bound breadcrumbs are used and the matching breadcrumb doesn't exist (InvalidBreadcrumbException) + 'missing-route-bound-breadcrumb-exception' => true, + + // When a named breadcrumb is used but doesn't exist (InvalidBreadcrumbException) + 'invalid-named-breadcrumb-exception' => true, + + /* + |-------------------------------------------------------------------------- + | Classes + |-------------------------------------------------------------------------- + | + | Subclass the default classes for more advanced customisations. + | + */ + + // Manager + 'manager-class' => DaveJamesMiller\Breadcrumbs\BreadcrumbsManager::class, + + // Generator + 'generator-class' => DaveJamesMiller\Breadcrumbs\BreadcrumbsGenerator::class, + +]; diff --git a/public/js/app.js b/public/js/app.js index d90334b..6a1810c 100644 --- a/public/js/app.js +++ b/public/js/app.js @@ -32,6 +32,7 @@ const app = new Vue({ type: '', state: '', rights: 0, + project_id: '', creating_corporation: "GBA", embargo_date: '', @@ -107,6 +108,7 @@ const app = new Vue({ formData.append('server_state', this.dataset.state); formData.append('rights', this.dataset.rights); formData.append('creating_corporation', this.dataset.creating_corporation); + formData.append('project_id', this.dataset.project_id); formData.append('embargo_date', this.dataset.embargo_date); formData.append('belongs_to_bibliography', this.dataset.belongs_to_bibliography); formData.append('title_main[value]', this.dataset.title_main.value); @@ -217,14 +219,3 @@ const app = new Vue({ } } }); - -// const app = new Vue({ -// el: '#app', - -// data: { -// loading: false, -// downloading: false, -// items: [], -// message: "Just a test", -// } -// }); \ No newline at end of file diff --git a/resources/views/auth/login.blade.php b/resources/views/auth/login.blade.php index 0569850..bcc1e59 100755 --- a/resources/views/auth/login.blade.php +++ b/resources/views/auth/login.blade.php @@ -1,8 +1,7 @@ -@extends('layouts.settings.layout') +@extends('settings.layouts.app') @section('content') -
diff --git a/resources/views/partials/nav.blade.php b/resources/views/partials/nav.blade.php index 8170b4e..8bca915 100755 --- a/resources/views/partials/nav.blade.php +++ b/resources/views/partials/nav.blade.php @@ -91,9 +91,9 @@
  • {{ Auth::user()->login }}
  • -
    + {{ csrf_field() }}
    @@ -86,6 +86,14 @@ {!! Form::label('CreatingCorporation', 'Creating Corporation') !!} {!! Form::text('CreatingCorporation', null, ['class' => 'pure-u-23-24', 'v-model' => 'dataset.creating_corporation']) !!}
    + +
    + {!! Form::label('project_id', 'Project..') !!} +
    + {!! Form::select('project_id', $projects, null, ['id' => 'project_id', 'placeholder' => '--no project--', 'v-model' => 'dataset.project_id']) !!} +
    + project is optional +
    {!! Form::label('EmbargoDate', 'Embargo Date') !!} diff --git a/resources/views/publish/create-step1Old.blade.php b/resources/views/publish/create-step1Old.blade.php index 66a0d8e..4039d4a 100644 --- a/resources/views/publish/create-step1Old.blade.php +++ b/resources/views/publish/create-step1Old.blade.php @@ -1,4 +1,4 @@ -@extends('layouts.settings.layout') +@extends('settings.layouts.app') @section('title', 'Publish') diff --git a/resources/views/publish/create-step2.blade.php b/resources/views/publish/create-step2.blade.php index 798efdb..6337da8 100644 --- a/resources/views/publish/create-step2.blade.php +++ b/resources/views/publish/create-step2.blade.php @@ -1,4 +1,4 @@ -@extends('layouts.settings.layout') +@extends('settings.layouts.app') @section('title', 'Publish') diff --git a/resources/views/publish/create-step3.blade.php b/resources/views/publish/create-step3.blade.php index 5b84d69..8746265 100644 --- a/resources/views/publish/create-step3.blade.php +++ b/resources/views/publish/create-step3.blade.php @@ -1,4 +1,4 @@ -@extends('layouts.settings.layout') +@extends('settings.layouts.app') @section('title', 'Publish') diff --git a/resources/views/settings/collection/collection.blade.php b/resources/views/settings/collection/collection.blade.php index 91e1bc5..dff0126 100644 --- a/resources/views/settings/collection/collection.blade.php +++ b/resources/views/settings/collection/collection.blade.php @@ -1,4 +1,4 @@ -@extends('layouts.settings.layout') +@extends('settings.layouts.app') @section('content')
    diff --git a/resources/views/settings/home/index.blade.php b/resources/views/settings/dashboard.blade.php similarity index 96% rename from resources/views/settings/home/index.blade.php rename to resources/views/settings/dashboard.blade.php index f755fed..88329eb 100644 --- a/resources/views/settings/home/index.blade.php +++ b/resources/views/settings/dashboard.blade.php @@ -1,4 +1,6 @@ -@extends('layouts.settings.layout') +@extends('settings.layouts.app') + +{{-- @section('breadcrumbs', Breadcrumbs::render('settings.dashboard')) --}} @section('content')
    diff --git a/resources/views/settings/document/document.blade.php b/resources/views/settings/document/document.blade.php index c54b461..2f59075 100644 --- a/resources/views/settings/document/document.blade.php +++ b/resources/views/settings/document/document.blade.php @@ -1,4 +1,4 @@ -@extends('layouts.settings.layout') +@extends('settings.layouts.app') @section('content')
    diff --git a/resources/views/settings/document/edit.blade.php b/resources/views/settings/document/edit.blade.php index b570d6c..b00286f 100644 --- a/resources/views/settings/document/edit.blade.php +++ b/resources/views/settings/document/edit.blade.php @@ -1,4 +1,4 @@ -@extends('layouts.settings.layout') +@extends('settings.layouts.app') @section('content')
    diff --git a/resources/views/settings/document/show.blade.php b/resources/views/settings/document/show.blade.php index ee1bb2e..fa6d879 100644 --- a/resources/views/settings/document/show.blade.php +++ b/resources/views/settings/document/show.blade.php @@ -1,4 +1,4 @@ -@extends('layouts.settings.layout') +@extends('settings.layouts.app') @section('content')
    diff --git a/resources/views/settings/includes/partials/breadcrumbs.blade.php b/resources/views/settings/includes/partials/breadcrumbs.blade.php new file mode 100644 index 0000000..f0d36de --- /dev/null +++ b/resources/views/settings/includes/partials/breadcrumbs.blade.php @@ -0,0 +1,14 @@ +@if ($breadcrumbs) + +@endif \ No newline at end of file diff --git a/resources/views/layouts/settings/layout.blade.php b/resources/views/settings/layouts/app.blade.php similarity index 90% rename from resources/views/layouts/settings/layout.blade.php rename to resources/views/settings/layouts/app.blade.php index 2894199..8aed409 100644 --- a/resources/views/layouts/settings/layout.blade.php +++ b/resources/views/settings/layouts/app.blade.php @@ -35,8 +35,8 @@

    Home

    @@ -65,13 +65,13 @@ @permission('review')

    Publish

    @endpermission -

    User

    +

    Access Management

    - --}} + {{-- @yield('breadcrumbs') --}} + @if(Breadcrumbs::exists()) + {!! Breadcrumbs::render() !!} + @endif {{--
    --}}
    diff --git a/resources/views/settings/license/edit.blade.php b/resources/views/settings/license/edit.blade.php index 170e8b7..dd534f8 100644 --- a/resources/views/settings/license/edit.blade.php +++ b/resources/views/settings/license/edit.blade.php @@ -1,4 +1,4 @@ -@extends('layouts.settings.layout') +@extends('settings.layouts.app') @section('content')
    diff --git a/resources/views/settings/license/license.blade.php b/resources/views/settings/license/license.blade.php index 94456dc..d2f4070 100644 --- a/resources/views/settings/license/license.blade.php +++ b/resources/views/settings/license/license.blade.php @@ -1,4 +1,4 @@ -@extends('layouts.settings.layout') +@extends('settings.layouts.app') @section('content')
    diff --git a/resources/views/settings/person/add.blade.php b/resources/views/settings/person/add.blade.php index 1cf6a08..122b33a 100644 --- a/resources/views/settings/person/add.blade.php +++ b/resources/views/settings/person/add.blade.php @@ -1,4 +1,4 @@ -@extends('layouts.settings.layout') +@extends('settings.layouts.app') @section('content') diff --git a/resources/views/settings/person/edit.blade.php b/resources/views/settings/person/edit.blade.php index f18577f..e9dd652 100644 --- a/resources/views/settings/person/edit.blade.php +++ b/resources/views/settings/person/edit.blade.php @@ -1,4 +1,4 @@ -@extends('layouts.settings.layout') +@extends('settings.layouts.app') @section('content')
    diff --git a/resources/views/settings/person/person.blade.php b/resources/views/settings/person/person.blade.php index fd11d86..59fd16f 100644 --- a/resources/views/settings/person/person.blade.php +++ b/resources/views/settings/person/person.blade.php @@ -1,4 +1,4 @@ -@extends('layouts.settings.layout') +@extends('settings.layouts.app') @section('content')
    diff --git a/resources/views/settings/project/add.blade.php b/resources/views/settings/project/add.blade.php index 124d920..510143f 100644 --- a/resources/views/settings/project/add.blade.php +++ b/resources/views/settings/project/add.blade.php @@ -1,4 +1,4 @@ -@extends('layouts.settings.layout') +@extends('settings.layouts.app') @section('content')
    diff --git a/resources/views/settings/project/category.blade.php b/resources/views/settings/project/category.blade.php index 4d29a72..2548bc6 100644 --- a/resources/views/settings/project/category.blade.php +++ b/resources/views/settings/project/category.blade.php @@ -1,4 +1,4 @@ -@extends('layouts.settings.layout') +@extends('settings.layouts.app') @section('content')
    diff --git a/resources/views/settings/project/edit.blade.php b/resources/views/settings/project/edit.blade.php index 56f4a0c..3995ec3 100644 --- a/resources/views/settings/project/edit.blade.php +++ b/resources/views/settings/project/edit.blade.php @@ -1,4 +1,4 @@ -@extends('layouts.settings.layout') +@extends('settings.layouts.app') @section('content')
    diff --git a/resources/views/settings/role/create.blade.php b/resources/views/settings/role/create.blade.php index 6c34478..8c21256 100644 --- a/resources/views/settings/role/create.blade.php +++ b/resources/views/settings/role/create.blade.php @@ -1,4 +1,4 @@ -@extends('layouts.settings.layout') +@extends('settings.layouts.app') @section('content')
    diff --git a/resources/views/settings/role/edit.blade.php b/resources/views/settings/role/edit.blade.php index ee76879..1d4056e 100644 --- a/resources/views/settings/role/edit.blade.php +++ b/resources/views/settings/role/edit.blade.php @@ -1,4 +1,4 @@ -@extends('layouts.settings.layout') +@extends('settings.layouts.app') @section('content')
    diff --git a/resources/views/settings/role/role.blade.php b/resources/views/settings/role/role.blade.php index 87a108d..a63969a 100644 --- a/resources/views/settings/role/role.blade.php +++ b/resources/views/settings/role/role.blade.php @@ -1,4 +1,4 @@ -@extends('layouts.settings.layout') +@extends('settings.layouts.app') @section('content')
    diff --git a/resources/views/settings/user/create.blade.php b/resources/views/settings/user/create.blade.php index 497aaf6..2cdac92 100644 --- a/resources/views/settings/user/create.blade.php +++ b/resources/views/settings/user/create.blade.php @@ -1,4 +1,4 @@ -@extends('layouts.settings.layout') +@extends('settings.layouts.app') @section('content')
    @@ -20,12 +20,12 @@
    - {!! Form::open(['route' => 'user.store', 'method'=>'POST', 'class' => 'pure-form pure-form-aligned']) !!} + {!! Form::open(['route' => 'settings.user.store', 'method'=>'POST', 'class' => 'pure-form pure-form-aligned']) !!}
    diff --git a/resources/views/settings/user/edit.blade.php b/resources/views/settings/user/edit.blade.php index 3b28b62..239a9c8 100644 --- a/resources/views/settings/user/edit.blade.php +++ b/resources/views/settings/user/edit.blade.php @@ -1,4 +1,4 @@ -@extends('layouts.settings.layout') +@extends('settings.layouts.app') @section('content')
    @@ -11,7 +11,7 @@
    - + BACK @@ -29,7 +29,7 @@ @endif
    - {!! Form::model($user, ['method' => 'PATCH','route' => ['user.update', $user->id], 'class' => 'pure-form pure-form-aligned']) !!} + {!! Form::model($user, ['method' => 'PATCH','route' => ['settings.user.update', $user->id], 'class' => 'pure-form pure-form-aligned']) !!}
    diff --git a/resources/views/settings/user/user.blade.php b/resources/views/settings/user/user.blade.php index f1b139f..2dda77e 100644 --- a/resources/views/settings/user/user.blade.php +++ b/resources/views/settings/user/user.blade.php @@ -1,4 +1,4 @@ -@extends('layouts.settings.layout') +@extends('settings.layouts.app') @section('content')
    @@ -11,7 +11,7 @@
    - + Create New User @@ -47,9 +47,9 @@ @endif -  Edit +  Edit   -  Delete +  Delete @endforeach diff --git a/routes/breadcrumbs.php b/routes/breadcrumbs.php new file mode 100644 index 0000000..f7119dc --- /dev/null +++ b/routes/breadcrumbs.php @@ -0,0 +1,26 @@ +push('Dashboard', route('settings.dashboard')); +}); + +Breadcrumbs::register('publish.dataset.create', function ($breadcrumbs) { + $breadcrumbs->parent('settings.dashboard'); + $breadcrumbs->push('Publish', route('publish.dataset.create')); +}); + +Breadcrumbs::register('settings.user.index', function ($breadcrumbs) { + $breadcrumbs->parent('settings.dashboard'); + $breadcrumbs->push('Users Management', route('settings.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('settings.user.create', function ($breadcrumbs) { + $breadcrumbs->parent('settings.user.index'); + $breadcrumbs->push('users.create', route('settings.user.create')); +}); diff --git a/routes/web.php b/routes/web.php index df77085..b791893 100644 --- a/routes/web.php +++ b/routes/web.php @@ -16,41 +16,49 @@ use Illuminate\Support\Facades\Route; Route::get('/oai', ['as' => 'oai', 'uses' => 'Oai\RequestController@index']); -Route::group(['middleware' => ['permission:review'], 'prefix' => 'publish'], function () { - Route::get('/dataset/create-step1', ['as' => 'dataset.create1', 'uses' => 'Publish\IndexController@createStep1']); - Route::post('/dataset/store-step1', ['as' => 'dataset.store1', 'uses' => 'Publish\IndexController@storeStep1']); +Route::group( + [ + 'namespace' => 'Publish', + 'middleware' => ['permission:review'], + 'prefix' => 'publish', + 'as' => 'publish.' + ], + function () { + Route::get('dataset/create-step1', ['as' => 'dataset.create', 'uses' => 'IndexController@createStep1']); + Route::post('dataset/store-step1', ['as' => 'dataset.store1', 'uses' => 'IndexController@storeStep1']); - Route::get('/dataset/create-step2', ['as' => 'dataset.create2', 'uses' => 'Publish\IndexController@createStep2']); - Route::post('/dataset/store-step2', ['as' => 'dataset.store2', 'uses' => 'Publish\IndexController@storeStep2']); + Route::get('dataset/create-step2', ['as' => 'dataset.create2', 'uses' => 'IndexController@createStep2']); + Route::post('dataset/store-step2', ['as' => 'dataset.store2', 'uses' => 'IndexController@storeStep2']); - Route::get('/dataset/create-step3', ['as' => 'dataset.create3', 'uses' => 'Publish\IndexController@createStep3']); - Route::post('/dataset/store', ['as' => 'dataset.store', 'uses' => 'Publish\IndexController@store']); -}); + Route::get('dataset/create-step3', ['as' => 'dataset.create3', 'uses' => 'IndexController@createStep3']); + Route::post('dataset/store', ['as' => 'dataset.store', 'uses' => 'IndexController@store']); + } +); //=================================================setting users==================================================== Route::get('settings/', [ - 'as' => 'settings.home.index', 'uses' => 'Settings\HomeController@index', + 'as' => 'settings.dashboard', 'uses' => 'Settings\DashboardController@index', ]); Route::group(['middleware' => ['permission:settings']], function () { //Route::resource('users','UserController'); Route::get('settings/user', [ - 'as' => 'user.index', 'uses' => 'Settings\UserController@index', + 'as' => 'settings.user.index', 'uses' => 'Settings\UserController@index', ]); Route::get('settings/user/create', [ - 'as' => 'user.create', 'uses' => 'Settings\UserController@create', + 'as' => 'settings.user.create', 'uses' => 'Settings\UserController@create', ]); Route::post('settings/user/store', [ - 'as' => 'user.store', 'uses' => 'Settings\UserController@store', + 'as' => 'settings.user.store', 'uses' => 'Settings\UserController@store', ]); Route::get('settings/user/edit/{id}', [ - 'as' => 'user.edit', 'uses' => 'Settings\UserController@edit', + 'as' => 'settings.user.edit', 'uses' => 'Settings\UserController@edit', ]); Route::patch('settings/user/update/{id}', [ - 'as' => 'user.update', 'uses' => 'Settings\UserController@update', + 'as' => 'settings.user.update', 'uses' => 'Settings\UserController@update', ]); Route::get('settings/user/destroy/{id}', [ - 'as' => 'user.destroy', 'uses' => 'Settings\UserController@destroy', + 'as' => 'settings.user.destroy', 'uses' => 'Settings\UserController@destroy', ]); //Route::resource('users','RoleController');