mirror of
https://github.com/flarum/core.git
synced 2025-07-29 04:30:56 +02:00
Rename JS sub-components so that descriptors are before the noun, not after
To be consistent with the naming in PHP world. e.g. ReplyComposer instead of ComposerReply
This commit is contained in:
23
js/forum/src/components/event-post.js
Normal file
23
js/forum/src/components/event-post.js
Normal file
@@ -0,0 +1,23 @@
|
||||
import Post from 'flarum/components/post';
|
||||
import username from 'flarum/helpers/username';
|
||||
import icon from 'flarum/helpers/icon';
|
||||
import humanTime from 'flarum/utils/human-time';
|
||||
import { dasherize } from 'flarum/utils/string';
|
||||
|
||||
export default class EventPost extends Post {
|
||||
view(iconName, content, attrs) {
|
||||
var post = this.props.post;
|
||||
|
||||
attrs = attrs || {};
|
||||
attrs.className = 'event-post post-'+dasherize(post.contentType())+' '+(attrs.className || '');
|
||||
|
||||
return super.view([
|
||||
icon(iconName+' post-icon'),
|
||||
m('div.event-post-info', [
|
||||
m('a.post-user', {href: app.route('user', { username: post.user().username() }), config: m.route}, username(post.user())), ' ',
|
||||
content
|
||||
]),
|
||||
m('div.event-post-time', humanTime(post.time()))
|
||||
], attrs);
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user