Mithril 2 Update ()

Update for Mithril 2
This commit is contained in:
Alexander Skvortsov 2020-09-23 22:49:53 -04:00 committed by GitHub
parent 44f5c7e1fe
commit 63198e67c6
3 changed files with 5 additions and 6 deletions

@ -7,10 +7,9 @@ export default function addLockControl() {
extend(DiscussionControls, 'moderationControls', function(items, discussion) {
if (discussion.canLock()) {
items.add('lock', Button.component({
children: app.translator.trans(discussion.isLocked() ? 'flarum-lock.forum.discussion_controls.unlock_button' : 'flarum-lock.forum.discussion_controls.lock_button'),
icon: 'fas fa-lock',
onclick: this.lockAction.bind(discussion)
}));
}, app.translator.trans(discussion.isLocked() ? 'flarum-lock.forum.discussion_controls.unlock_button' : 'flarum-lock.forum.discussion_controls.lock_button')));
}
});

@ -6,12 +6,12 @@ export default class DiscussionLockedNotification extends Notification {
}
href() {
const notification = this.props.notification;
const notification = this.attrs.notification;
return app.route.discussion(notification.subject(), notification.content().postNumber);
}
content() {
return app.translator.trans('flarum-lock.forum.notifications.discussion_locked_text', {user: this.props.notification.fromUser()});
return app.translator.trans('flarum-lock.forum.notifications.discussion_locked_text', {user: this.attrs.notification.fromUser()});
}
}

@ -2,13 +2,13 @@ import EventPost from 'flarum/components/EventPost';
export default class DiscussionLockedPost extends EventPost {
icon() {
return this.props.post.content().locked
return this.attrs.post.content().locked
? 'fas fa-lock'
: 'fas fa-unlock';
}
descriptionKey() {
return this.props.post.content().locked
return this.attrs.post.content().locked
? 'flarum-lock.forum.post_stream.discussion_locked_text'
: 'flarum-lock.forum.post_stream.discussion_unlocked_text';
}