mirror of
https://github.com/flarum/framework.git
synced 2024-12-05 00:43:39 +08:00
Rename post.editTime
This commit is contained in:
parent
c2f6e2d7a3
commit
8eb4a75da7
|
@ -15,9 +15,9 @@ Object.assign(Post.prototype, {
|
||||||
contentHtml: Model.attribute('contentHtml'),
|
contentHtml: Model.attribute('contentHtml'),
|
||||||
contentPlain: computed('contentHtml', getPlainContent),
|
contentPlain: computed('contentHtml', getPlainContent),
|
||||||
|
|
||||||
editTime: Model.attribute('editTime', Model.transformDate),
|
editedAt: Model.attribute('editedAt', Model.transformDate),
|
||||||
editUser: Model.hasOne('editUser'),
|
editUser: Model.hasOne('editUser'),
|
||||||
isEdited: computed('editTime', editTime => !!editTime),
|
isEdited: computed('editedAt', editedAt => !!editedAt),
|
||||||
|
|
||||||
hideTime: Model.attribute('hideTime', Model.transformDate),
|
hideTime: Model.attribute('hideTime', Model.transformDate),
|
||||||
hideUser: Model.hasOne('hideUser'),
|
hideUser: Model.hasOne('hideUser'),
|
||||||
|
|
|
@ -21,7 +21,7 @@ export default class PostEdited extends Component {
|
||||||
const editUser = post.editUser();
|
const editUser = post.editUser();
|
||||||
const editedInfo = extractText(app.translator.trans(
|
const editedInfo = extractText(app.translator.trans(
|
||||||
'core.forum.post.edited_tooltip',
|
'core.forum.post.edited_tooltip',
|
||||||
{user: editUser, ago: humanTime(post.editTime())}
|
{user: editUser, ago: humanTime(post.editedAt())}
|
||||||
));
|
));
|
||||||
if (editedInfo !== this.oldEditedInfo) {
|
if (editedInfo !== this.oldEditedInfo) {
|
||||||
this.shouldUpdateTooltip = true;
|
this.shouldUpdateTooltip = true;
|
||||||
|
|
|
@ -56,7 +56,7 @@ class PostSerializer extends BasicPostSerializer
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($post->edited_at) {
|
if ($post->edited_at) {
|
||||||
$attributes['editTime'] = $this->formatDate($post->edited_at);
|
$attributes['editedAt'] = $this->formatDate($post->edited_at);
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($post->hidden_at) {
|
if ($post->hidden_at) {
|
||||||
|
|
Loading…
Reference in New Issue
Block a user