Skip to content

Commit

Permalink
Merge pull request #181 from Habilya/master
Browse files Browse the repository at this point in the history
Added nb comments display in blog and dashboard
  • Loading branch information
jcc authored Oct 15, 2019
2 parents 4187df2 + 7bc5fc4 commit 4f137ea
Show file tree
Hide file tree
Showing 6 changed files with 8 additions and 0 deletions.
1 change: 1 addition & 0 deletions app/Transformers/ArticleTransformer.php
Original file line number Diff line number Diff line change
Expand Up @@ -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(),
];
}

Expand Down
3 changes: 3 additions & 0 deletions resources/js/dashboard/modules/article/Article.vue
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down
1 change: 1 addition & 0 deletions resources/js/lang/en/table.js
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down
1 change: 1 addition & 0 deletions resources/js/lang/ru/table.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ export default {
enabled: 'Включено',
article_title: 'Заголовок статьи',
click_num: 'Кол-во кликов',
comment_count: 'Комментарии',
ip: 'IP',
new_folder: 'Новая папка',
upload: 'Загрузка'
Expand Down
1 change: 1 addition & 0 deletions resources/js/lang/zh_cn/table.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ export default {
enabled: '是否启用',
article_title: '文章标题',
click_num: '点击次数',
comment_count: '评论数',
ip: 'IP',
new_folder: '创建文件夹',
upload: '上传图片'
Expand Down
1 change: 1 addition & 0 deletions resources/views/widgets/article.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
<i class="fas fa-user"></i>{{ $article->user->name ?? 'null' }}&nbsp;,&nbsp;
<i class="fas fa-clock"></i>{{ $article->published_at->diffForHumans() }}&nbsp;,&nbsp;
<i class="fas fa-eye"></i>{{ $article->view_count }}
<i class="fas fa-comments"></i>{{ $article->comments->count() }}
<a href="{{ url($article->slug) }}" class="float-right">
Read More <i class="fas fa-chevron-right"></i>
</a>
Expand Down

0 comments on commit 4f137ea

Please sign in to comment.