mirror of
https://github.com/flarum/core.git
synced 2025-07-15 22:06:24 +02:00
25 lines
661 B
JavaScript
25 lines
661 B
JavaScript
import app from 'flarum/forum/app';
|
|
import Notification from 'flarum/forum/components/Notification';
|
|
import { truncate } from 'flarum/common/utils/string';
|
|
|
|
export default class PostLikedNotification extends Notification {
|
|
icon() {
|
|
return 'far fa-thumbs-up';
|
|
}
|
|
|
|
href() {
|
|
return app.route.post(this.attrs.notification.subject());
|
|
}
|
|
|
|
content() {
|
|
const notification = this.attrs.notification;
|
|
const user = notification.fromUser();
|
|
|
|
return app.translator.trans('flarum-likes.forum.notifications.post_liked_text', { user, count: 1 });
|
|
}
|
|
|
|
excerpt() {
|
|
return truncate(this.attrs.notification.subject().contentPlain(), 200);
|
|
}
|
|
}
|