mirror of
https://github.com/flarum/framework.git
synced 2024-12-12 14:13:37 +08:00
GitHub for Mac sucks, why does it leave out a file sometimes?
This commit is contained in:
parent
58adcfa3c4
commit
9befc68ea3
38
framework/core/js/forum/src/components/post-activity.js
Normal file
38
framework/core/js/forum/src/components/post-activity.js
Normal file
|
@ -0,0 +1,38 @@
|
|||
import Component from 'flarum/component';
|
||||
import humanTime from 'flarum/helpers/human-time';
|
||||
import avatar from 'flarum/helpers/avatar';
|
||||
import listItems from 'flarum/helpers/list-items';
|
||||
import ItemList from 'flarum/utils/item-list';
|
||||
|
||||
export default class PostActivity extends Component {
|
||||
view() {
|
||||
var activity = this.props.activity;
|
||||
var user = activity.user();
|
||||
var post = activity.post();
|
||||
var discussion = post.discussion();
|
||||
|
||||
return m('div', [
|
||||
avatar(user, {className: 'activity-icon'}),
|
||||
m('div.activity-info', [
|
||||
m('strong', post.number() == 1 ? 'Started a discussion' : 'Posted a reply'),
|
||||
humanTime(activity.time())
|
||||
]),
|
||||
m('a.activity-content.post-activity', {href: app.route('discussion.near', {
|
||||
id: discussion.id(),
|
||||
slug: discussion.slug(),
|
||||
near: post.number()
|
||||
}), config: m.route}, [
|
||||
m('ul.list-inline', listItems(this.headerItems().toArray())),
|
||||
m('div.body', m.trust(post.contentHtml()))
|
||||
])
|
||||
]);
|
||||
}
|
||||
|
||||
headerItems() {
|
||||
var items = new ItemList();
|
||||
|
||||
items.add('title', m('h3.title', this.props.activity.post().discussion().title()));
|
||||
|
||||
return items;
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user