diff --git a/app/Handlers/Search/Content.php b/app/Handlers/Search/Content.php index eaf0f0c9..48e30681 100644 --- a/app/Handlers/Search/Content.php +++ b/app/Handlers/Search/Content.php @@ -2,6 +2,7 @@ namespace App\Handlers\Search; use App\Handlers\Contracts\SearchHandler; +use App\Models\Content as ContentModel; class Content implements SearchHandler { @@ -16,9 +17,9 @@ class Content implements SearchHandler { $token = '%' . $term . '%'; - return Content::where('content', 'LIKE', $token) - ->orWhere('description', 'LIKE', $token) - ->orWhere('keywords', 'LIKE', $token) + return ContentModel::where('content', 'LIKE', $token) + ->orWhere('meta_description', 'LIKE', $token) + ->orWhere('meta_keywords', 'LIKE', $token) ->orWhere('title', 'LIKE', $token) ->orWhere('url', 'LIKE', $token) ->get(); @@ -31,6 +32,6 @@ class Content implements SearchHandler public function getName() { - return trans('...'); + return trans('search.content'); } } \ No newline at end of file diff --git a/app/Handlers/Search/Presenters/AdminContent.php b/app/Handlers/Search/Presenters/AdminContent.php new file mode 100644 index 00000000..3ec76829 --- /dev/null +++ b/app/Handlers/Search/Presenters/AdminContent.php @@ -0,0 +1,12 @@ + $foundItems, 'tileClass' => 'large-4']); + } +} \ No newline at end of file diff --git a/app/Handlers/Search/Presenters/Content.php b/app/Handlers/Search/Presenters/Content.php deleted file mode 100644 index 8d0e8342..00000000 --- a/app/Handlers/Search/Presenters/Content.php +++ /dev/null @@ -1,12 +0,0 @@ -app->make('registerSearchEngine'); - $registrator->register(new Content(), new ContentPresenter()); + $registrator->register(new Content(), new AdminContentPresenter()); } } diff --git a/resources/lang/en/search.php b/resources/lang/en/search.php new file mode 100644 index 00000000..e79caadc --- /dev/null +++ b/resources/lang/en/search.php @@ -0,0 +1,7 @@ + 'Content', + 'term' => 'Search', + 'results' => 'Found results', + 'pageTitle' => 'Search' +]; \ No newline at end of file diff --git a/resources/views/admin/content/overviewTiles.blade.php b/resources/views/admin/content/overviewTiles.blade.php new file mode 100644 index 00000000..f353ac78 --- /dev/null +++ b/resources/views/admin/content/overviewTiles.blade.php @@ -0,0 +1,48 @@ +
+ @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) + + + @else + + + @endif + + +

+ +
+
+ @empty + @lang('admin/contents.noPagesAvailable') + @endforelse +
\ No newline at end of file