mirror of
https://github.com/flarum/core.git
synced 2025-07-16 22:31:18 +02:00
committed by
GitHub
parent
44f5c7e1fe
commit
63198e67c6
@@ -7,10 +7,9 @@ export default function addLockControl() {
|
|||||||
extend(DiscussionControls, 'moderationControls', function(items, discussion) {
|
extend(DiscussionControls, 'moderationControls', function(items, discussion) {
|
||||||
if (discussion.canLock()) {
|
if (discussion.canLock()) {
|
||||||
items.add('lock', Button.component({
|
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',
|
icon: 'fas fa-lock',
|
||||||
onclick: this.lockAction.bind(discussion)
|
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() {
|
href() {
|
||||||
const notification = this.props.notification;
|
const notification = this.attrs.notification;
|
||||||
|
|
||||||
return app.route.discussion(notification.subject(), notification.content().postNumber);
|
return app.route.discussion(notification.subject(), notification.content().postNumber);
|
||||||
}
|
}
|
||||||
|
|
||||||
content() {
|
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 {
|
export default class DiscussionLockedPost extends EventPost {
|
||||||
icon() {
|
icon() {
|
||||||
return this.props.post.content().locked
|
return this.attrs.post.content().locked
|
||||||
? 'fas fa-lock'
|
? 'fas fa-lock'
|
||||||
: 'fas fa-unlock';
|
: 'fas fa-unlock';
|
||||||
}
|
}
|
||||||
|
|
||||||
descriptionKey() {
|
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_locked_text'
|
||||||
: 'flarum-lock.forum.post_stream.discussion_unlocked_text';
|
: 'flarum-lock.forum.post_stream.discussion_unlocked_text';
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user