mirror of
https://github.com/flarum/core.git
synced 2025-10-15 00:44:40 +02:00
Replace Ember app with Mithril app
This commit is contained in:
24
js/forum/src/components/terminal-post.js
Normal file
24
js/forum/src/components/terminal-post.js
Normal file
@@ -0,0 +1,24 @@
|
||||
import Component from 'flarum/component';
|
||||
import humanTime from 'flarum/utils/human-time';
|
||||
|
||||
/**
|
||||
Displays information about a the first or last post in a discussion.
|
||||
|
||||
@prop discussion {Discussion} The discussion to display the post for
|
||||
@prop lastPost {Boolean} Whether or not to display the last/start post
|
||||
@class TerminalPost
|
||||
@constructor
|
||||
@extends Component
|
||||
*/
|
||||
export default class TerminalPost extends Component {
|
||||
view() {
|
||||
var discussion = this.props.discussion;
|
||||
var lastPost = this.props.lastPost && discussion.repliesCount();
|
||||
|
||||
return m('li', [
|
||||
m('span.username', discussion[lastPost ? 'lastUser' : 'startUser']().username()),
|
||||
lastPost ? ' replied ' : ' started ',
|
||||
m('time', humanTime(discussion[lastPost ? 'lastTime' : 'startTime']()))
|
||||
])
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user