mirror of
https://github.com/flarum/core.git
synced 2025-07-17 14:51:19 +02:00
See [flarum/core #265](https://github.com/flarum/core/issues/265). - Adjusts key names to three-tier namespacing. - Extracts previously unextracted strings.
16 lines
451 B
JavaScript
16 lines
451 B
JavaScript
import { extend } from 'flarum/extend';
|
|
import Discussion from 'flarum/models/Discussion';
|
|
import Badge from 'flarum/components/Badge';
|
|
|
|
export default function addLockBadge() {
|
|
extend(Discussion.prototype, 'badges', function(badges) {
|
|
if (this.isLocked()) {
|
|
badges.add('locked', Badge.component({
|
|
type: 'locked',
|
|
label: app.translator.trans('flarum-lock.forum.badge.locked'),
|
|
icon: 'lock'
|
|
}));
|
|
}
|
|
});
|
|
}
|