FEATURE: add selecting comments into template in visitors area

This commit is contained in:
Michal Kváček
2016-09-06 12:47:54 +02:00
parent 8f66a96ec0
commit 51d6850cd6
2 changed files with 14 additions and 1 deletions
+11 -1
View File
@@ -8,6 +8,7 @@ use App\Http\Controllers\Controller;
use App\Http\Requests\Request;
use App\Models\Content;
use App\Models\User;
use Modules\Blog\Article\Entities\Comment;
class Article extends Handler
{
@@ -21,6 +22,14 @@ class Article extends Handler
*/
public function render(Content $content, $parameters)
{
$content->comments = [];
if (isset($content->module_settings->allowComments) && $content->module_settings->allowComments) {
$content->comments = Comment::where('content_id', $content->id)
->where('approved', 1)
->orderBy('created_at')
->get();
}
return Controller::VisitorsView($content->template, ['page' => $content]);
}
@@ -79,7 +88,8 @@ class Article extends Handler
return $changedColumns;
}
public static function getOverviewTitle() {
public static function getOverviewTitle()
{
return trans('article::module.allArticles');
}