1
0
mirror of https://github.com/flarum/core.git synced 2025-08-12 19:34:18 +02:00

Initial commit

This commit is contained in:
Toby Zerner
2015-06-23 10:25:24 +09:30
commit e57eb5a14f
20 changed files with 494 additions and 0 deletions

View File

@@ -0,0 +1,16 @@
import Notification from 'flarum/components/notification';
import username from 'flarum/helpers/username';
export default class PostLikedNotification extends Notification {
view() {
var notification = this.props.notification;
var post = notification.subject();
var auc = notification.additionalUnreadCount();
return super.view({
href: app.route.post(post),
icon: 'thumbs-o-up',
content: [username(notification.sender()), auc ? ' and '+auc+' others' : '', ' liked your post #', post.number()]
});
}
}

View File

@@ -0,0 +1,24 @@
import FormModal from 'flarum/components/form-modal';
import avatar from 'flarum/helpers/avatar';
import username from 'flarum/helpers/username';
export default class PostLikesModal extends FormModal {
view() {
var post = this.props.post;
return super.view({
className: 'post-likes-modal',
title: 'Users Who Like This',
body: [
m('ul.post-likes-list', [
post.likes().map(user =>
m('li', m('a', {href: app.route.user(user), config: m.route}, [
avatar(user),
username(user)
]))
)
])
]
});
}
}