Rename user.commentCount

This commit is contained in:
Toby Zerner 2018-08-24 21:33:18 +09:30
parent e253b79fe6
commit 14508d9fcc
3 changed files with 3 additions and 3 deletions

View File

@ -26,7 +26,7 @@ Object.assign(User.prototype, {
newNotificationsCount: Model.attribute('newNotificationsCount'), newNotificationsCount: Model.attribute('newNotificationsCount'),
discussionCount: Model.attribute('discussionCount'), discussionCount: Model.attribute('discussionCount'),
commentsCount: Model.attribute('commentsCount'), commentCount: Model.attribute('commentCount'),
canEdit: Model.attribute('canEdit'), canEdit: Model.attribute('canEdit'),
canDelete: Model.attribute('canDelete'), canDelete: Model.attribute('canDelete'),

View File

@ -131,7 +131,7 @@ export default class UserPage extends Page {
items.add('posts', items.add('posts',
LinkButton.component({ LinkButton.component({
href: app.route('user.posts', {username: user.username()}), href: app.route('user.posts', {username: user.username()}),
children: [app.translator.trans('core.forum.user.posts_link'), <span className="Button-badge">{user.commentsCount()}</span>], children: [app.translator.trans('core.forum.user.posts_link'), <span className="Button-badge">{user.commentCount()}</span>],
icon: 'far fa-comment' icon: 'far fa-comment'
}), }),
100 100

View File

@ -43,7 +43,7 @@ class UserSerializer extends BasicUserSerializer
$attributes += [ $attributes += [
'joinTime' => $this->formatDate($user->joined_at), 'joinTime' => $this->formatDate($user->joined_at),
'discussionCount' => (int) $user->discussion_count, 'discussionCount' => (int) $user->discussion_count,
'commentsCount' => (int) $user->comment_count, 'commentCount' => (int) $user->comment_count,
'canEdit' => $canEdit, 'canEdit' => $canEdit,
'canDelete' => $gate->allows('delete', $user), 'canDelete' => $gate->allows('delete', $user),
]; ];