mirror of
https://github.com/flarum/framework.git
synced 2025-03-21 12:35:15 +08:00
parent
44f5c7e1fe
commit
63198e67c6
extensions/lock/js/src/forum
@ -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';
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user