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') -