mirror of
https://github.com/flarum/core.git
synced 2025-08-03 06:57:54 +02:00
Update post/notification components
This commit is contained in:
@@ -1,28 +1,23 @@
|
|||||||
import Notification from 'flarum/components/notification';
|
import Notification from 'flarum/components/notification';
|
||||||
import avatar from 'flarum/helpers/avatar';
|
|
||||||
import icon from 'flarum/helpers/icon';
|
|
||||||
import username from 'flarum/helpers/username';
|
import username from 'flarum/helpers/username';
|
||||||
import humanTime from 'flarum/helpers/human-time';
|
|
||||||
import categoryLabel from 'categories/helpers/category-label';
|
import categoryLabel from 'categories/helpers/category-label';
|
||||||
|
|
||||||
export default class NotificationDiscussionMoved extends Notification {
|
export default class NotificationDiscussionMoved extends Notification {
|
||||||
content() {
|
view() {
|
||||||
var notification = this.props.notification;
|
var notification = this.props.notification;
|
||||||
var discussion = notification.subject();
|
var discussion = notification.subject();
|
||||||
var category = discussion.category();
|
var category = discussion.category();
|
||||||
|
|
||||||
return m('a', {href: app.route('discussion.near', {
|
return super.view({
|
||||||
id: discussion.id(),
|
href: app.route('discussion.near', {
|
||||||
slug: discussion.slug(),
|
id: discussion.id(),
|
||||||
near: notification.content().postNumber
|
slug: discussion.slug(),
|
||||||
}), config: m.route}, [
|
near: notification.content().postNumber
|
||||||
avatar(notification.sender()),
|
}),
|
||||||
m('h3.notification-title', discussion.title()),
|
config: m.route,
|
||||||
m('div.notification-info', [
|
title: discussion.title(),
|
||||||
icon('arrow-right'),
|
icon: 'arrow-right',
|
||||||
' Moved to ', categoryLabel(category), ' by ', username(notification.sender()),
|
content: ['Moved to ', categoryLabel(category), ' by ', username(notification.sender())]
|
||||||
' ', humanTime(notification.time())
|
});
|
||||||
])
|
|
||||||
]);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -7,9 +7,6 @@ export default class PostDiscussionMoved extends PostActivity {
|
|||||||
var oldCategory = app.store.getById('categories', post.content()[0]);
|
var oldCategory = app.store.getById('categories', post.content()[0]);
|
||||||
var newCategory = app.store.getById('categories', post.content()[1]);
|
var newCategory = app.store.getById('categories', post.content()[1]);
|
||||||
|
|
||||||
return super.view(['moved the discussion from ', categoryLabel(oldCategory), ' to ', categoryLabel(newCategory), '.'], {
|
return super.view('arrow-right', ['moved the discussion from ', categoryLabel(oldCategory), ' to ', categoryLabel(newCategory), '.']);
|
||||||
className: 'post-discussion-moved',
|
|
||||||
icon: 'arrow-right'
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user