From 7159b1ec09b25bd2a1be437c1c6064436a125cfd Mon Sep 17 00:00:00 2001 From: Habilis Date: Thu, 3 Oct 2019 17:16:15 -0400 Subject: [PATCH 1/3] Added nb comments display in blog and dashboard --- app/Transformers/ArticleTransformer.php | 1 + resources/js/dashboard/modules/article/Article.vue | 3 +++ resources/js/lang/en/table.js | 1 + resources/js/lang/ru/table.js | 1 + resources/js/lang/zh_cn/table.js | 1 + resources/views/widgets/article.blade.php | 1 + 6 files changed, 8 insertions(+) diff --git a/app/Transformers/ArticleTransformer.php b/app/Transformers/ArticleTransformer.php index c16cf64a4..8df720382 100644 --- a/app/Transformers/ArticleTransformer.php +++ b/app/Transformers/ArticleTransformer.php @@ -28,6 +28,7 @@ public function transform(Article $article) 'visitors' => $article->view_count, 'published_at' => $article->published_at->diffForHumans(), 'published_time' => $article->published_at->toDateTimeString(), + 'comment_count' => $article->comments->count(), ]; } diff --git a/resources/js/dashboard/modules/article/Article.vue b/resources/js/dashboard/modules/article/Article.vue index 4425374a3..12835356b 100644 --- a/resources/js/dashboard/modules/article/Article.vue +++ b/resources/js/dashboard/modules/article/Article.vue @@ -25,6 +25,9 @@ export default { name: 'subtitle', trans: 'table.subtitle', sortField: 'subtitle', + }, { + name: 'comment_count', + trans: 'table.comment_count' }, { name: 'published_at', trans: 'table.published_at', diff --git a/resources/js/lang/en/table.js b/resources/js/lang/en/table.js index 1eb34cb7d..1de50af4a 100644 --- a/resources/js/lang/en/table.js +++ b/resources/js/lang/en/table.js @@ -24,6 +24,7 @@ export default { enabled: 'Enabled', article_title: 'Article Title', click_num: 'Clicks Num', + comment_count: 'Comments', ip: 'IP', new_folder: 'New Folder', upload: 'Uplaod' diff --git a/resources/js/lang/ru/table.js b/resources/js/lang/ru/table.js index af4ae3b2c..0f488a135 100644 --- a/resources/js/lang/ru/table.js +++ b/resources/js/lang/ru/table.js @@ -24,6 +24,7 @@ export default { enabled: 'Включено', article_title: 'Заголовок статьи', click_num: 'Кол-во кликов', + comment_count: 'Comments', ip: 'IP', new_folder: 'Новая папка', upload: 'Загрузка' diff --git a/resources/js/lang/zh_cn/table.js b/resources/js/lang/zh_cn/table.js index 538dceb0e..dd64ff06c 100644 --- a/resources/js/lang/zh_cn/table.js +++ b/resources/js/lang/zh_cn/table.js @@ -24,6 +24,7 @@ export default { enabled: '是否启用', article_title: '文章标题', click_num: '点击次数', + comment_count: 'Comments', ip: 'IP', new_folder: '创建文件夹', upload: '上传图片' diff --git a/resources/views/widgets/article.blade.php b/resources/views/widgets/article.blade.php index d93fd7682..29f072c50 100644 --- a/resources/views/widgets/article.blade.php +++ b/resources/views/widgets/article.blade.php @@ -31,6 +31,7 @@ {{ $article->user->name ?? 'null' }} ,  {{ $article->published_at->diffForHumans() }} ,  {{ $article->view_count }} + {{ $article->comments->count() }} Read More From d1d73123ad9844e603508602d1a3593132853a40 Mon Sep 17 00:00:00 2001 From: Jiajian Chan Date: Tue, 15 Oct 2019 12:21:04 +0800 Subject: [PATCH 2/3] Update table.js --- resources/js/lang/zh_cn/table.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/resources/js/lang/zh_cn/table.js b/resources/js/lang/zh_cn/table.js index dd64ff06c..40a590c7c 100644 --- a/resources/js/lang/zh_cn/table.js +++ b/resources/js/lang/zh_cn/table.js @@ -24,7 +24,7 @@ export default { enabled: '是否启用', article_title: '文章标题', click_num: '点击次数', - comment_count: 'Comments', + comment_count: '评论数', ip: 'IP', new_folder: '创建文件夹', upload: '上传图片' From 7bc5fc43a27280cd64b679271b84e258cb23ec80 Mon Sep 17 00:00:00 2001 From: Jiajian Chan Date: Tue, 15 Oct 2019 12:21:53 +0800 Subject: [PATCH 3/3] Update table.js --- resources/js/lang/ru/table.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/resources/js/lang/ru/table.js b/resources/js/lang/ru/table.js index 0f488a135..de0ec4381 100644 --- a/resources/js/lang/ru/table.js +++ b/resources/js/lang/ru/table.js @@ -24,7 +24,7 @@ export default { enabled: 'Включено', article_title: 'Заголовок статьи', click_num: 'Кол-во кликов', - comment_count: 'Comments', + comment_count: 'Комментарии', ip: 'IP', new_folder: 'Новая папка', upload: 'Загрузка'