MAINTENANCE: update laravel, dependencies, fix few bugs

This commit is contained in:
Michal Kváček
2017-09-13 14:02:39 +02:00
parent 3fdae2669b
commit 422339b313
15 changed files with 801 additions and 5168 deletions
+1 -1
View File
@@ -10,7 +10,7 @@ interface Module extends BaseRepository
public function getUpdateContentTitle(ModuleModel $module, ContentModel $content = null); public function getUpdateContentTitle(ModuleModel $module, ContentModel $content = null);
public function getOverviewTitle(ModuleModel $module); public function getOverviewTitle(ModuleModel $module = null);
public function getByHandler($handler); public function getByHandler($handler);
+1
View File
@@ -44,6 +44,7 @@ abstract class BaseHandler implements BaseModuleHandler
if ($user->can('manage', Content::class) && !$contentModules->isEmpty()) { if ($user->can('manage', Content::class) && !$contentModules->isEmpty()) {
$menu->dropdown(trans('admin/mainMenu.contentPages'), function ($sub) { $menu->dropdown(trans('admin/mainMenu.contentPages'), function ($sub) {
$sub->route('content.order', trans('admin/mainMenu.contentOrder'), [], 999, ['icon' => 'fa fa-fw fa-reorder']);
$sub->route('content.overview', trans('admin/mainMenu.contentPageOverview'), [], 10000, ['icon' => 'fa fa-fw fa-list']); $sub->route('content.overview', trans('admin/mainMenu.contentPageOverview'), [], 10000, ['icon' => 'fa fa-fw fa-list']);
}, 20, ['icon' => 'fa fa-fw fa-database']); }, 20, ['icon' => 'fa fa-fw fa-database']);
} }
+4 -4
View File
@@ -106,15 +106,15 @@ class Content extends Repository implements IContent
*/ */
public function getOverview($handler = null, $statuses = null) public function getOverview($handler = null, $statuses = null)
{ {
$query = ContentModel::select('contents.*', 'modules.name AS module_name', 'modules.id AS module_id') $query = ContentModel::select('contents.*')
->join('modules', 'modules.handler', '=', 'contents.moduleHandler') ->join('modules', 'modules.handler', '=', 'contents.moduleHandler')
->join('users', 'users.id', '=', 'contents.userId') ->join('users', 'users.id', '=', 'contents.userId')
->addSelect(DB::raw('COALESCE(users.name, users.email) AS author_name'))
->addSelect('users.email AS author_email')
->whereNull('contents.deleted_at') ->whereNull('contents.deleted_at')
->whereNull('contents.parentId')
->where('contents.language', LaravelLocalization::getCurrentLocale()) ->where('contents.language', LaravelLocalization::getCurrentLocale())
->where('modules.enabled', 1) ->where('modules.enabled', 1)
->with('module') ->with('module', 'subpages', 'templateModel')
->orderBy('contents.order')
->orderBy('contents.created_at', 'DESC'); ->orderBy('contents.created_at', 'DESC');
// filter results using handler // filter results using handler
+8 -3
View File
@@ -32,8 +32,8 @@ class Module extends Repository implements IModule
{ {
return Cache::remember('enabled-content-modules', 3600, function () { return Cache::remember('enabled-content-modules', 3600, function () {
return ModuleModel::where('enabled', true) return ModuleModel::where('enabled', true)
->where('manages_content', true) ->where('manages_content', true)
->get(); ->get();
}); });
} }
@@ -53,9 +53,14 @@ class Module extends Repository implements IModule
return is_null($moduleHeading) ? $pageHeading : $moduleHeading; return is_null($moduleHeading) ? $pageHeading : $moduleHeading;
} }
public function getOverviewTitle(ModuleModel $module) public function getOverviewTitle(ModuleModel $module = null)
{ {
$pageHeading = 'admin/contents.overview'; $pageHeading = 'admin/contents.overview';
if (is_null($module)) {
return $pageHeading;
}
$moduleHeading = $this->call($module, 'getOverviewTitle'); $moduleHeading = $this->call($module, 'getOverviewTitle');
return is_null($moduleHeading) ? $pageHeading : $moduleHeading; return is_null($moduleHeading) ? $pageHeading : $moduleHeading;
+3
View File
@@ -28,6 +28,9 @@ class InstallCMS extends Command
// check and eventualy create .env file // check and eventualy create .env file
if (!file_exists(base_path('.env'))) { if (!file_exists(base_path('.env'))) {
$this->createEnv(); $this->createEnv();
$this->line('Rerun this script again, we need to load changes.');
return;
} }
// install php dependencies // install php dependencies
@@ -33,7 +33,7 @@ class ContentOverview extends Controller
* @return \Illuminate\Contracts\View\Factory|\Illuminate\View\View * @return \Illuminate\Contracts\View\Factory|\Illuminate\View\View
* @internal param int|null $moduleId * @internal param int|null $moduleId
*/ */
public function index(Module $module = null, $status = null) public function index(Module $module, $status = null)
{ {
// get module settings // get module settings
$pageHeading = $this->module->getOverviewTitle($module); $pageHeading = $this->module->getOverviewTitle($module);
@@ -98,7 +98,7 @@ class EditTemplate extends Controller
// try to save content // try to save content
if (!is_writable($customDir) && !is_writable($originalDir)) { if (!is_writable($customDir) && !is_writable($originalDir)) {
return redirect() return redirect()
->route('templates.edit', ['id' => $request->id]) ->route('templates.edit', ['id' => $template->id])
->withInput() ->withInput()
->with('warning', trans('admin/templates.cannotWriteContent')); ->with('warning', trans('admin/templates.cannotWriteContent'));
} }
+1 -1
View File
@@ -138,7 +138,7 @@ class AppServiceProvider extends ServiceProvider
$registrator = $this->app->make('displayPipeline'); $registrator = $this->app->make('displayPipeline');
$registrator->add(AddViewedToPage::class); $registrator->add(AddViewedToPage::class);
$registrator->add(CompileShortcodes::class); // $registrator->add(CompileShortcodes::class);
} }
private function registerSavePipeline() private function registerSavePipeline()
+1 -1
View File
@@ -26,7 +26,7 @@ class BladeExtender extends ServiceProvider
$this->extendBlade(); $this->extendBlade();
Shortcode::register('widget', Widget::class); // Shortcode::register('widget', Widget::class);
} }
/** /**
+1 -1
View File
@@ -6,7 +6,7 @@
"animate.css": "~3.4.0", "animate.css": "~3.4.0",
"bootstrap": "v4.0.0-alpha.5", "bootstrap": "v4.0.0-alpha.5",
"font-awesome": "~4.5.0", "font-awesome": "~4.5.0",
"jquery": "~2.1.4", "jquery": "~3.2.1",
"metisMenu": "~2.0.3", "metisMenu": "~2.0.3",
"nprogress": "~0.2.0", "nprogress": "~0.2.0",
"responsive-bootstrap-toolkit": "~2.5.0", "responsive-bootstrap-toolkit": "~2.5.0",
+4 -4
View File
@@ -8,13 +8,14 @@
"type": "project", "type": "project",
"require": { "require": {
"php": ">=7.0.0", "php": ">=7.0.0",
"laravel/framework": "5.4.*", "laravel/framework": "5.5.*",
"watson/sitemap": "^2.0", "watson/sitemap": "^2.0",
"mcamara/laravel-localization": "^1.1", "mcamara/laravel-localization": "^1.1",
"franzose/closure-table": "5.*", "franzose/closure-table": "5.*",
"intervention/image": "^2.3", "intervention/image": "^2.3",
"webwizo/laravel-shortcodes": "1.0.4", "webwizo/laravel-shortcodes": "1.*",
"greggilbert/recaptcha": "^2.2@dev", "greggilbert/recaptcha": "^2.2@dev",
"doctrine/dbal": "^2.7@dev",
"nwidart/laravel-menus": "dev-master" "nwidart/laravel-menus": "dev-master"
}, },
"require-dev": { "require-dev": {
@@ -23,8 +24,7 @@
"phpunit/phpunit": "~4.0", "phpunit/phpunit": "~4.0",
"symfony/css-selector": "2.8.*|3.0.*", "symfony/css-selector": "2.8.*|3.0.*",
"symfony/dom-crawler": "2.8.*|3.0.*", "symfony/dom-crawler": "2.8.*|3.0.*",
"barryvdh/laravel-debugbar": "^2.1", "barryvdh/laravel-debugbar": "^2.1"
"doctrine/dbal": "^2.7@dev"
}, },
"autoload": { "autoload": {
"classmap": [ "classmap": [
Generated
+767 -592
View File
File diff suppressed because it is too large Load Diff
+1 -1
View File
@@ -160,7 +160,7 @@ return [
Franzose\ClosureTable\ClosureTableServiceProvider::class, Franzose\ClosureTable\ClosureTableServiceProvider::class,
\Watson\Sitemap\SitemapServiceProvider::class, \Watson\Sitemap\SitemapServiceProvider::class,
Intervention\Image\ImageServiceProvider::class, Intervention\Image\ImageServiceProvider::class,
Webwizo\Shortcodes\ShortcodesServiceProvider::class, // Webwizo\Shortcodes\ShortcodesServiceProvider::class,
/* /*
* Application Service Providers... * Application Service Providers...
*/ */
+6 -4552
View File
File diff suppressed because it is too large Load Diff
+1 -6
View File
@@ -5,15 +5,10 @@
"dev": "gulp watch" "dev": "gulp watch"
}, },
"devDependencies": { "devDependencies": {
"bootstrap-sass": "^3.3.7",
"bower": "1.8.0", "bower": "1.8.0",
"gulp": "^3.9.1", "gulp": "^3.9.1",
"jquery": "^3.2.1", "jquery": "^3.2.1",
"laravel-elixir": "^6.0.0-11", "laravel-elixir": "^6.0.0-11",
"laravel-elixir-vue-2": "^0.2.0", "lodash": "^4.16.2"
"laravel-elixir-webpack-official": "^1.0.2",
"lodash": "^4.16.2",
"vue": "^2.4.2",
"vue-resource": "^1.3.4"
} }
} }