mirror of
https://github.com/flarum/framework.git
synced 2024-12-13 07:03:35 +08:00
Rename user.commentCount
This commit is contained in:
parent
e253b79fe6
commit
14508d9fcc
|
@ -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'),
|
||||||
|
|
|
@ -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
|
||||||
|
|
|
@ -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),
|
||||||
];
|
];
|
||||||
|
|
Loading…
Reference in New Issue
Block a user