diff --git a/app/Enumerations/ActiveContentStatuses.php b/app/Enumerations/ActiveContentStatuses.php new file mode 100644 index 00000000..ed48c909 --- /dev/null +++ b/app/Enumerations/ActiveContentStatuses.php @@ -0,0 +1,18 @@ + $value) { + if ($key == Content::STATUS_DELETED) { + continue; + } + + self::push($key, $value); + } + } +} \ No newline at end of file diff --git a/app/Enumerations/ModuleNamesWithIds.php b/app/Enumerations/ModuleNamesWithIds.php new file mode 100644 index 00000000..6fac6162 --- /dev/null +++ b/app/Enumerations/ModuleNamesWithIds.php @@ -0,0 +1,21 @@ +id, $module->name); + } + } +} \ No newline at end of file diff --git a/app/Handlers/Contracts/AppHandler.php b/app/Handlers/Contracts/AppHandler.php index 968941bc..26a9324e 100644 --- a/app/Handlers/Contracts/AppHandler.php +++ b/app/Handlers/Contracts/AppHandler.php @@ -1,6 +1,7 @@ . View is returned only as name in plain text + * + * @return array of views/templates/html codes divided into section + */ + public static function getExtendedFormInputsCreate(); + + /** + * Getter for extended part of form for editing existing content + * + * Basically, this method may be + * + * @return array of views/templates/html codes divided into section + */ + public static function getExtendedFormInputsEdit(); + /** * Register admin menu (or multiple ones) * diff --git a/app/Handlers/Handler.php b/app/Handlers/Handler.php index edf024f8..be438540 100644 --- a/app/Handlers/Handler.php +++ b/app/Handlers/Handler.php @@ -1,6 +1,7 @@ trans('admin/contents.basicInfo'), + 'meta' => trans('admin/contents.metaOptions'), + 'publication' => trans('admin/contents.publicationOptions'), + 'appearance' => trans('admin/contents.appearance') + ]; + } + + public static function getExtendedFormInputsCreate() + { + return [ + 'basicInfo' => 'admin.content.formParts.basicInformation', + 'meta' => 'admin.content.formParts.metaInformation', + 'publication' => 'admin.content.formParts.publicationSetup', + 'appearance' => 'admin.content.formParts.appearance', + ]; + } + + public static function getExtendedFormInputsEdit() + { + return self::getExtendedFormInputsCreate(); + } + /** * Register admin menu (or multiple ones) * @@ -55,6 +81,18 @@ abstract class Handler implements AppHandler $sub->route('users.detail', trans('admin/mainMenu.userDetail'), [], 20, ['icon' => 'fa fa-user']); $sub->route('users.overview', trans('admin/mainMenu.usersOverview'), [], 30, ['icon' => 'fa fa-users']); }, 20, ['icon' => 'fa fa-users']); + $menu->dropdown(trans('admin/mainMenu.contentPages'), function ($sub) { + + $sub->dropdown(trans('admin/mainMenu.newContentPage'), function ($sub) { + $i = 1; + $modules = ModuleNamesWithIds::getWithTranslations(); + foreach ($modules as $module => $name) { + $sub->route('content.new', trans($name), ['moduleId' => $module], $i++); + } + }, 10, ['icon' => 'fa fa-plus']); + + $sub->route('content.overview', trans('admin/mainMenu.contentPageOverview'), [], 20, ['icon' => 'fa fa-list']); + }, 15, ['icon' => 'fa fa-database']); $menu->dropdown(trans('admin/mainMenu.fileManager'), function ($sub) { $sub->route('upload.file', trans('admin/mainMenu.uploadFile'), [], 10, ['icon' => 'fa fa-file']); $sub->route('upload.image', trans('admin/mainMenu.uploadImage'), [], 50, ['icon' => 'fa fa-image']); @@ -99,6 +137,5 @@ abstract class Handler implements AppHandler $menu->route('users.detail', trans('admin/userManagement.profile')); $menu->route('logout', trans('admin/common.logout')); }); - } } \ No newline at end of file diff --git a/app/Http/Controllers/Admin/ContentOverview.php b/app/Http/Controllers/Admin/ContentOverview.php new file mode 100644 index 00000000..fad1e58c --- /dev/null +++ b/app/Http/Controllers/Admin/ContentOverview.php @@ -0,0 +1,36 @@ +handler; + } + + // get pages for overview + $model = new Content(); + $pages = $model->getOverview($moduleFilterHandler, $status, true) + ->paginate($perPage); + + return view('admin.content.overview', ['pages' => $pages]); + } +} \ No newline at end of file diff --git a/app/Http/Controllers/Admin/CreateNewContent.php b/app/Http/Controllers/Admin/CreateNewContent.php new file mode 100644 index 00000000..faa97e8d --- /dev/null +++ b/app/Http/Controllers/Admin/CreateNewContent.php @@ -0,0 +1,93 @@ +select(['template_name', 'name', 'description']) + ->get(); + + // create default content object + $page = new Content(); + $page->status = Content::STATUS_DRAFT; + + // render view + return view('admin.content.new', [ + 'contentStatuses' => $statuses, + 'templates' => $templates, + 'moduleId' => $moduleId, + 'page' => $page, + 'moduleName' => trans($module->name), + 'formSectionNames' => call_user_func([$module->handler, 'getExtendedFormSections']), + 'formSections' => call_user_func([$module->handler, 'getExtendedFormInputsCreate']), + ]); + } + + /** + * Save new content page + * + * @param CreateNewStaticPageRequest $request + * + * @param $moduleId + * + * @return \Illuminate\Http\RedirectResponse + */ + public function postNew(CreateNewContentRequest $request, $moduleId) + { + $page = new Content(); + try { + $module = Module::findOrFail($moduleId); + } catch (NotFoundHttpException $e) { + return redirect() + ->route('content.overview') + ->withInput() + ->with('error', trans('admin/contents.invalidModule')); + } + + // setup basic info + $page->user_id = \Auth::user()->id; + $page->title = $request->title; + $page->url = Str::slug($request->url); + $page->published_from = $request->publishedFrom; + $page->published_to = $request->publishedTo; + $page->meta_keywords = $request->meta_description; + $page->meta_description = $request->meta_description; + $page->content = $request->pageContent; + $page->status = $request->status; + $page->template = $request->template; + $page->module_handler = $module->handler; + + // save module-specific stuff + call_user_func_array([$module->handler, 'createNew'], [&$page, $request]); + + $page->save(); + + Event::fire(new \Modules\StaticPages\Events\CreateNewStaticPage($page)); + + return redirect() + ->route('content.overview') + ->with('success', trans('admin/contents.successfullyCreated')); + } +} \ No newline at end of file diff --git a/app/Http/Controllers/Admin/EditContent.php b/app/Http/Controllers/Admin/EditContent.php new file mode 100644 index 00000000..0f95abc3 --- /dev/null +++ b/app/Http/Controllers/Admin/EditContent.php @@ -0,0 +1,266 @@ +history = $history; + } + + /** + * Display form for editing static page + * + * @param $id + * + * @return \Illuminate\Contracts\View\Factory|\Illuminate\View\View + */ + public function getEdit($id) + { + // select all content statuses + $statuses = ContentStatuses::getWithTranslations(); + + // try to find requested page + $page = Content::where('module_handler', config('staticpages.handler')) + ->findOrFail($id); + + $allModules = ModulesHandlerToId::getWithTranslations(); + $moduleId = $allModules[config('staticpages.handler')]; + $templates = Template::where('module_id', $moduleId) + ->select(['template_name', 'name', 'description']) + ->get(); + + $history = $this->history->getStructuredHistoryOf($page); + + // render view + return view('admin.content.edit', [ + 'contentStatuses' => $statuses, + 'page' => $page, + 'templates' => $templates, + 'formSectionNames' => call_user_func([$page->module_handler, 'getExtendedFormSections']), + 'formSections' => call_user_func([$page->module_handler, 'getExtendedFormInputsCreate']), + 'historySize' => count($history['changesets']) + ]); + } + + /** + * Edit static page and save changes into history. + * + * @param EditStaticPageRequest $request + * @param $id + * + * @return \Illuminate\Http\RedirectResponse + */ + public function postEdit(EditStaticPageRequest $request, $id) + { + try { + $page = Content::findOrFail($id); + } catch (NotFoundHttpException $e) { + + // page for editing not found + return redirect() + ->route('content.overview') + ->with('error', trans('admin/contents.invalidPage')); + } + + $request->url = Str::slug($request->url); + + // array of fields in database and fields from request + $fields = [ + 'title' => 'title', + 'url' => 'url', + 'template' => 'template', + 'published_from' => 'publishedFrom', + 'published_to' => 'publishedTo', + 'meta_keywords' => 'metaKeywords', + 'meta_description' => 'metaDescription', + 'content' => 'pageContent', + 'status' => 'status' + ]; + + // save new values with history + list($revision, $changedColumns) = $page->updateWithHistory($fields, $request->all()); + + $changedColumns += call_user_func_array([$page->module_handler, 'edit'], [&$page, $request, $revision]); + + // was something changed? + if ($changedColumns == 0) { + return redirect() + ->route('content.edit', ['id' => $page->id]) + ->with('error', trans('admin/contents.nothingToEdit')); + } + + // fire event with + Event::fire(new EditStaticPageEvent($page, $revision)); + + // something was changed, inform user + return redirect() + ->route('content.edit', ['id' => $page->id]) + ->with('success', trans('admin/contents.successfullyEdited')); + } + + /** + * Method for changing page status + * + * This method is called in static page overview from quick actions. It checks if status is valid, if page exists + * and updates status. + * + * @param $id + * @param $status + * + * @return \Illuminate\Http\RedirectResponse + */ + public function changeStatus($id, $status) + { + // get possible statuses + $statuses = ContentStatuses::getWithTranslations(); + unset($statuses[Content::STATUS_DELETED]); + + // check if given status is valid + if (!isset($statuses[$status])) { + return redirect() + ->route('content.overview') + ->with('error', trans('admin/contents.invalidStatus')); + } + + try { + // try to find this page + $page = Content::findOrFail($id); + } catch (NotFoundHttpException $e) { + // page not found + return redirect() + ->route('content.overview') + ->with('error', trans('admin/contents.invalidPage')); + } + + // try to change the page + list ($revision, $changedColumns) = $page->updateWithHistory(['status' => 'status'], ['status' => $status]); + + // was something changed? + if ($changedColumns == 0) { + return redirect() + ->route('content.edit', ['id' => $page->id]) + ->with('error', trans('admin/contents.nothingToEdit')); + } + + // fire events + if ($status != Content::STATUS_DRAFT) { + Event::fire(new PublishStaticPage($page, $revision)); + } else { + Event::fire(new MakeDraftFromStaticPage($page, $revision)); + } + + // redirect back to overview with info for user + return redirect() + ->route('content.overview') + ->with('success', trans('admin/contents.statusChanged')); + } + + /** + * Delete page + * + * @param $id + * + * @return \Illuminate\Http\RedirectResponse + */ + public function deletePage($id) + { + try { + // try to find this page + $page = Content::findOrFail($id); + } catch (NotFoundHttpException $e) { + // page not found + return redirect() + ->route('content.overview') + ->with('error', trans('admin/contents.invalidPage')); + } + + list ($revision, $changedColumns) = $page->updateWithHistory(['status' => 'status'], ['status' => Content::STATUS_DELETED]); + + // was something changed? + if ($changedColumns == 0) { + return redirect() + ->route('content.edit', ['id' => $page->id]) + ->with('error', trans('admin/contents.nothingToEdit')); + } + + // trigger delete event + Event::fire(new DeleteStaticPage($page, $revision)); + + // redirect back to overview with info for user + return redirect() + ->route('content.overview') + ->with('success', trans('admin/contents.pageDeleted', [ + 'name' => $page->title, + 'url' => $page->url + ])); + } + + /** + * Sets page as homepage + * + * @param $id + * + * @return \Illuminate\Http\RedirectResponse + */ + public function setHomepage($id) + { + try { + // try to find this page + /** + * @var $page Content + */ + $page = Content::findOrFail($id); + $homepage = $page->getHomepage(); + } catch (NotFoundHttpException $e) { + // page not found + return redirect() + ->route('content.overview') + ->with('error', trans('admin/contents.invalidPage')); + } + + + + list ($revision, $changedColumns) = $page->updateWithHistory(['is_homepage' => 'is_homepage'], ['is_homepage' => 1]); + + if ($homepage) + $homepage->updateWithHistory(['isHomepage' => 'is_homepage'], ['ishomepage' => 0]); + + // was something changed? + if ($changedColumns == 0) { + return redirect() + ->route('content.overview') + ->with('error', trans('admin/contents.nothingToEdit')); + } + + // trigger delete event +// Event::fire(new DeleteStaticPage($page, $revision)); + + // redirect back to overview with info for user + return redirect() + ->route('content.overview') + ->with('success', trans('admin/contents.homepageSetup', [ + 'name' => $page->title, + 'url' => $page->url + ])); + } +} \ No newline at end of file diff --git a/app/Http/Requests/CreateNewContentRequest.php b/app/Http/Requests/CreateNewContentRequest.php new file mode 100644 index 00000000..caf34a91 --- /dev/null +++ b/app/Http/Requests/CreateNewContentRequest.php @@ -0,0 +1,25 @@ + 'required', + 'url' => 'required|unique:contents,url', + 'template' => 'required|exists:templates,template_name', + 'published_from' => 'date', + 'published_to' => 'date', + 'title_photo' => 'exists:files,id', + 'module_settings' => 'json', + 'status' => 'required|in:draft,protected,public' + ]; + } +} diff --git a/app/Http/Requests/EditContentRequest.php b/app/Http/Requests/EditContentRequest.php new file mode 100644 index 00000000..eccee379 --- /dev/null +++ b/app/Http/Requests/EditContentRequest.php @@ -0,0 +1,30 @@ + 'required', + 'url' => 'required|unique:contents,url,' . $this->id, + 'template' => 'required|exists:templates,template_name', + 'published_from' => 'date', + 'published_to' => 'date', + 'title_photo' => 'exists:files,id', + 'status' => 'required|in:' . $statuses + ]; + } +} diff --git a/app/Http/routes.php b/app/Http/routes.php index 29492120..ea631f2a 100644 --- a/app/Http/routes.php +++ b/app/Http/routes.php @@ -68,6 +68,40 @@ Route::group([ ->name('templates.postEdit'); }); + // list of all static pages + Route::get('content/overview/{moduleId?}/{status?}', 'ContentOverview@getOverview') + ->name('content.overview'); + + // form for creating new static page + Route::get('content/new/{moduleId}', 'CreateNewContent@getNew') + ->name('content.new'); + + // form for editing existing static page + Route::get('content/edit/{id}', 'EditContent@getEdit') + ->name('content.edit'); + + // post method for creating new static page + Route::post('content/new/{moduleId}', 'CreateNewContent@postNew') + ->name('content.newPost'); + + // post method for creating new static page + Route::post('content/edit/{id}', 'EditContent@postEdit') + ->name('content.editPost'); + + // routes for quick actions + + // change status of page (protected, public or draft) + Route::get('content/status/{id}/{status}', 'EditContent@changeStatus') + ->name('content.changeStatus'); + + // set homepage + Route::get('content/homepage/{id}', 'EditContent@setHomepage') + ->name('content.setHomepage'); + + // delete page + Route::get('content/delete/{id}', 'EditContent@deletePage') + ->name('content.delete'); + // these routes are available for all logged (authenticated) users // display dashboard with some usefull information diff --git a/app/Models/Content.php b/app/Models/Content.php index 7f25e950..c2eb55f8 100644 --- a/app/Models/Content.php +++ b/app/Models/Content.php @@ -2,6 +2,7 @@ namespace App\Models; +use App\Enumerations\ContentStatuses; use Illuminate\Database\Eloquent\Model; use Illuminate\Support\Facades\DB; @@ -67,24 +68,39 @@ class Content extends Model } /** - * Getter for overview of all content pages of given handler (module type) + * Getter for overview of all content pages. * - * @param $handler + * These content pages may be filtered by using some handler + * + * @param bool $handler + * @param bool $status * @param bool $joinAuthor * + * @return */ - public function getByType($handler, $joinAuthor = false) + public function getOverview($handler = false, $status = false, $joinAuthor = false) { $query = DB::table('contents') - ->select('contents.*') + ->select('contents.*', 'modules.name AS module_name') ->where('contents.status', '<>', self::STATUS_DELETED) - ->where('module_handler', $handler) - ->orderBy('created_at'); + ->join('modules', 'modules.handler', '=', 'contents.module_handler') + ->orderBy('created_at', 'DESC'); + + // filter results using handler + if ($handler) { + $query = $query->where('module_handler', $handler); + } // join user email and user name to results when needed if ($joinAuthor) { $query = $query->join('users', 'users.id', '=', 'contents.user_id') - ->select('contents.*', 'users.name AS author_name', 'users.email AS author_email'); + ->addSelect('users.name AS author_name') + ->addSelect('users.email AS author_email'); + } + + // add filtering by status + if (in_array($status, ContentStatuses::getSimple())) { + $query = $query->where('contents.status', $status); } return $query; @@ -93,14 +109,18 @@ class Content extends Model /** * Updates current model with information about changed columns * - * @param array $fields - * @param array $request + * @param array $fields + * @param array $request + * @param string $revisionId * * @return int number of changed columns */ - public function updateWithHistory(array $fields, array $request) + public function updateWithHistory(array $fields, array $request, $revisionId = null) { - $editBatch = uniqid(); + if (!$revisionId) { + $revisionId = uniqid(); + } + $changed = 0; foreach ($fields as $fieldDB => $fieldRequest) { @@ -118,7 +138,7 @@ class Content extends Model $history = [ 'user_id' => \Auth::user()->id, 'content_id' => $this->id, - 'edit_batch' => $editBatch, + 'edit_batch' => $revisionId, 'column' => $fieldRequest, 'old_value' => $this->$fieldDB, 'new_value' => $request[$fieldRequest] @@ -136,7 +156,7 @@ class Content extends Model $this->save(); - return [$editBatch, $changed]; + return [$revisionId, $changed]; } /** diff --git a/resources/lang/en/admin/contents.php b/resources/lang/en/admin/contents.php index 521032c1..98f17d33 100644 --- a/resources/lang/en/admin/contents.php +++ b/resources/lang/en/admin/contents.php @@ -1,7 +1,38 @@ 'Deleted', - 'status_draft' => 'Draft', - 'status_protected' => 'Protected', - 'status_public' => 'Public' + 'status_deleted' => 'Deleted', + 'status_draft' => 'Draft', + 'status_protected' => 'Protected', + 'status_public' => 'Public', + 'new' => 'Create new :name', + 'edit' => 'Edit :name', + 'content' => 'Page content', + 'save' => 'Save new page', + 'basicInfo' => 'Basic information', + 'metaOptions' => 'Meta information', + 'publicationOptions' => 'Publication setup', + 'field_title' => 'Page title', + 'field_url' => 'URL', + 'field_meta_keywords' => 'Keywords', + 'field_meta_description' => 'Page description', + 'field_published_from' => 'Published from', + 'field_published_to' => 'Published to', + 'successfullyCreated' => 'Page successfully created', + 'noPagesAvailable' => 'No static pages available. Try to create one first.', + 'viewPage' => 'View page on web', + 'deletePage' => 'Delete page (ireversible!)', + 'makePublic' => 'Publish page', + 'makeProtected' => 'Publish page only for logged users', + 'makeDraft' => 'Disable page and make it draft', + 'invalidStatus' => 'Cannot change status to something undefined.', + 'statusChanged' => 'Status successfully changed.', + 'invalidPage' => 'Specified page does not exist.', + 'pageDeleted' => 'Page :name (:url) successfully deleted.', + 'nothingToEdit' => 'You did not submit any changes. Nothing was edited.', + 'successfullyEdited' => 'Edit successfull', + 'showHistory' => 'History (:count)', + 'appearance' => 'Appearance', + 'template' => 'Template of this page', + 'overview' => 'List of all content pages', + 'homepageSetup' => 'Homepage successfully set up.' ]; \ No newline at end of file diff --git a/resources/lang/en/admin/mainMenu.php b/resources/lang/en/admin/mainMenu.php index 5edb8b1b..950388de 100644 --- a/resources/lang/en/admin/mainMenu.php +++ b/resources/lang/en/admin/mainMenu.php @@ -22,5 +22,8 @@ return [ 'widgetAreas' => 'Widget areas', 'widgetsOverview' => 'All widgets', 'assignWidgets' => 'Assign widgets', - 'templates' => 'Templates' + 'templates' => 'Templates', + 'contentPages' => 'Web content', + 'contentPageOverview' => 'Overview', + 'newContentPage' => 'New content' ]; \ No newline at end of file diff --git a/resources/views/admin/content/edit.blade.php b/resources/views/admin/content/edit.blade.php new file mode 100644 index 00000000..dd7b09a8 --- /dev/null +++ b/resources/views/admin/content/edit.blade.php @@ -0,0 +1,14 @@ +@extends('admin.layout') + +@section('pageName', @trans('admin/contents.edit', ['name' => $page->title])) + +@section('content') + +
+

@lang('admin/contents.edit', ['name' => $page->title])

+
+ +
+ @include('admin.content.editForm') +
+@stop diff --git a/resources/views/admin/content/editForm.blade.php b/resources/views/admin/content/editForm.blade.php new file mode 100644 index 00000000..c2b46270 --- /dev/null +++ b/resources/views/admin/content/editForm.blade.php @@ -0,0 +1,37 @@ +@if (session('success')) +
+ {{ session('success') }} +
+@endif + +@if (session('error')) +
+ {{ session('error') }} +
+@endif + +
+ {!! csrf_field() !!} + + @include('admin.content.formInputs') + +
+
+ +
+ + @if ($historySize > 0) + + @endif +
+
+ +@section('javascripts') + + + +@stop \ No newline at end of file diff --git a/resources/views/admin/content/formInputs.blade.php b/resources/views/admin/content/formInputs.blade.php new file mode 100644 index 00000000..2242e016 --- /dev/null +++ b/resources/views/admin/content/formInputs.blade.php @@ -0,0 +1,17 @@ + + +
+ @foreach($formSections as $section => $view) +
+ @include($view) +
+ @endforeach +
\ No newline at end of file diff --git a/resources/views/admin/content/formParts/appearance.blade.php b/resources/views/admin/content/formParts/appearance.blade.php new file mode 100644 index 00000000..4bab3aca --- /dev/null +++ b/resources/views/admin/content/formParts/appearance.blade.php @@ -0,0 +1,27 @@ +
+
+ +
+
\ No newline at end of file diff --git a/resources/views/admin/content/formParts/basicInformation.blade.php b/resources/views/admin/content/formParts/basicInformation.blade.php new file mode 100644 index 00000000..5069d967 --- /dev/null +++ b/resources/views/admin/content/formParts/basicInformation.blade.php @@ -0,0 +1,56 @@ +
+
+ +
+
+ +
+
+ +
+
+ + + @if (isset($errors) && $errors->has('status')) +
+ {{ $errors->first('status') }} +
+ @endif +
+ +
+ +
+
+ +
+
\ No newline at end of file diff --git a/resources/views/admin/content/formParts/metaInformation.blade.php b/resources/views/admin/content/formParts/metaInformation.blade.php new file mode 100644 index 00000000..12954382 --- /dev/null +++ b/resources/views/admin/content/formParts/metaInformation.blade.php @@ -0,0 +1,21 @@ +
+
+ +
+
+
+
+ +
+
\ No newline at end of file diff --git a/resources/views/admin/content/formParts/publicationSetup.blade.php b/resources/views/admin/content/formParts/publicationSetup.blade.php new file mode 100644 index 00000000..81d22d29 --- /dev/null +++ b/resources/views/admin/content/formParts/publicationSetup.blade.php @@ -0,0 +1,31 @@ +
+
+ +
+ +
+ +
+
\ No newline at end of file diff --git a/resources/views/admin/content/new.blade.php b/resources/views/admin/content/new.blade.php new file mode 100644 index 00000000..edb97de5 --- /dev/null +++ b/resources/views/admin/content/new.blade.php @@ -0,0 +1,14 @@ +@extends('admin.layout') + +@section('pageName', @trans('admin/contents.new', ['name' => $moduleName])) + +@section('content') + +
+

@lang('admin/contents.new', ['name' => $moduleName])

+
+ +
+ @include('admin.content.newForm') +
+@stop diff --git a/resources/views/admin/content/newForm.blade.php b/resources/views/admin/content/newForm.blade.php new file mode 100644 index 00000000..67efbec1 --- /dev/null +++ b/resources/views/admin/content/newForm.blade.php @@ -0,0 +1,31 @@ +@if (session('success')) +
+ {{ session('success') }} +
+@endif + +@if (session('error')) +
+ {{ session('error') }} +
+@endif + +
+ {!! csrf_field() !!} + + @include('admin.content.formInputs') + +
+
+ +
+
+
+ +@section('javascripts') + + + +@stop \ No newline at end of file diff --git a/resources/views/admin/content/overview.blade.php b/resources/views/admin/content/overview.blade.php new file mode 100644 index 00000000..f5b833b1 --- /dev/null +++ b/resources/views/admin/content/overview.blade.php @@ -0,0 +1,77 @@ +@extends('admin/layout') + +@section('content') +
+

@lang('admin/contents.overview')

+ + @if (session('success')) +
+ {{ session('success') }} +
+ @endif + + @if (session('error')) +
+ {{ session('error') }} +
+ @endif +
+ +
+ @forelse($pages as $page) +
+
+

{{$page->title}}

+ {{date('d.m.Y', strtotime($page->created_at))}} + {{$page->author_name}} +
+ @lang($page->module_name) + +

+ @if (trim($page->meta_description)) + {{str_limit($page->meta_description)}} + @else + {{str_limit(strip_tags($page->content))}} + @endif +

+ + @if ($page->meta_keywords) +

{{$page->meta_keywords}}

+ @endif + +

+ + + + + @if($page->is_homepage) + + @else + + @endif + + + + @if($page->status == \App\Models\Content::STATUS_DRAFT) + + + @endif + + @if(in_array($page->status, [\App\Models\Content::STATUS_PROTECTED, \App\Models\Content::STATUS_PUBLIC])) + + @endif + + +

+ +
+
+ @empty + @lang('admin/contents.noPagesAvailable') + @endforelse +
+ +
+ {{$pages->render()}} +
+@stop \ No newline at end of file