diff options
author | =Corey Hulen <corey@hulen.com> | 2015-07-15 10:22:05 -0800 |
---|---|---|
committer | =Corey Hulen <corey@hulen.com> | 2015-07-15 10:22:05 -0800 |
commit | e017babc5ddd66e65469326bf723d5359875c2d1 (patch) | |
tree | 0da7ee5d9f4039eeb20f70940483c40943c9aa23 /web/react/components/post_body.jsx | |
parent | 252d0f3924dd19aa4dd1900c6c00c41c84755d1e (diff) | |
parent | 38f9e140e98123eb256968fb31f7fbb2aef978e0 (diff) | |
download | chat-e017babc5ddd66e65469326bf723d5359875c2d1.tar.gz chat-e017babc5ddd66e65469326bf723d5359875c2d1.tar.bz2 chat-e017babc5ddd66e65469326bf723d5359875c2d1.zip |
fixing merge
Diffstat (limited to 'web/react/components/post_body.jsx')
-rw-r--r-- | web/react/components/post_body.jsx | 17 |
1 files changed, 14 insertions, 3 deletions
diff --git a/web/react/components/post_body.jsx b/web/react/components/post_body.jsx index 7d5ef4d33..d9678df30 100644 --- a/web/react/components/post_body.jsx +++ b/web/react/components/post_body.jsx @@ -71,11 +71,22 @@ module.exports = React.createClass({ name = <a className="theme" onClick={function(){ utils.searchForTerm(profile.username); }}>{profile.username}</a>; } - var message = parentPost.message; + var message = "" + if(parentPost.message) { + message = utils.replaceHtmlEntities(parentPost.message) + } else if (parentPost.filenames.length) { + message = parentPost.filenames[0].split('/').pop(); + + if (parentPost.filenames.length === 2) { + message += " plus 1 other file"; + } else if (parentPost.filenames.length > 2) { + message += " plus " + (parentPost.filenames.length - 1) + " other files"; + } + } comment = ( <p className="post-link"> - <span>Commented on {name}{apostrophe} message: <a className="theme" onClick={this.props.handleCommentClick}>{utils.replaceHtmlEntities(message)}</a></span> + <span>Commented on {name}{apostrophe} message: <a className="theme" onClick={this.props.handleCommentClick}>{message}</a></span> </p> ); @@ -120,7 +131,7 @@ module.exports = React.createClass({ return ( <div className="post-body"> { comment } - <p key={post.Id+"_message"} className={postClass}><span>{inner}</span></p> + <p key={post.id+"_message"} className={postClass}><span>{inner}</span></p> { filenames && filenames.length > 0 ? <div className="post-image__columns"> { postFiles } |