mirror of
https://github.com/flarum/core.git
synced 2025-07-10 03:16:22 +02:00
Change notification type components to be like post types
This commit is contained in:
@ -1,26 +1,21 @@
|
|||||||
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';
|
|
||||||
|
|
||||||
export default class NotificationDiscussionRenamed extends Notification {
|
export default class NotificationDiscussionRenamed extends Notification {
|
||||||
content() {
|
view() {
|
||||||
var notification = this.props.notification;
|
var notification = this.props.notification;
|
||||||
var discussion = notification.subject();
|
var discussion = notification.subject();
|
||||||
|
|
||||||
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().number
|
slug: discussion.slug(),
|
||||||
}), config: m.route}, [
|
near: notification.content().number
|
||||||
avatar(notification.sender()),
|
}),
|
||||||
m('h3.notification-title', notification.content().oldTitle),
|
config: m.route,
|
||||||
m('div.notification-info', [
|
title: notification.content().oldTitle,
|
||||||
icon('pencil'),
|
icon: 'pencil',
|
||||||
' Renamed by ', username(notification.sender()),
|
content: ['Renamed by ', username(notification.sender())]
|
||||||
' ', humanTime(notification.time())
|
});
|
||||||
])
|
|
||||||
]);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,17 +1,24 @@
|
|||||||
import Component from 'flarum/component';
|
import Component from 'flarum/component';
|
||||||
|
import avatar from 'flarum/helpers/avatar';
|
||||||
|
import icon from 'flarum/helpers/icon';
|
||||||
|
import humanTime from 'flarum/helpers/human-time';
|
||||||
|
|
||||||
export default class Notification extends Component {
|
export default class Notification extends Component {
|
||||||
view() {
|
view(args) {
|
||||||
var notification = this.props.notification;
|
var notification = this.props.notification;
|
||||||
|
|
||||||
return m('div.notification.notification-'+notification.contentType(), {
|
return m('div.notification.notification-'+notification.contentType(), {
|
||||||
classNames: !notification.isRead() ? 'unread' : '',
|
classNames: !notification.isRead() ? 'unread' : '',
|
||||||
onclick: this.read.bind(this)
|
onclick: this.read.bind(this)
|
||||||
}, this.content());
|
}, m('a', {href: args.href, config: args.config}, [
|
||||||
}
|
avatar(notification.sender()),
|
||||||
|
m('h3.notification-title', args.title),
|
||||||
content() {
|
m('div.notification-info', [
|
||||||
//
|
icon(args.icon), ' ',
|
||||||
|
args.content, ' ',
|
||||||
|
humanTime(notification.time())
|
||||||
|
])
|
||||||
|
]));
|
||||||
}
|
}
|
||||||
|
|
||||||
read() {
|
read() {
|
||||||
|
Reference in New Issue
Block a user