diff --git a/web/react/components/post.jsx b/web/react/components/post.jsx
index 4b66e175c7..b798dc7ca5 100644
--- a/web/react/components/post.jsx
+++ b/web/react/components/post.jsx
@@ -74,9 +74,9 @@ module.exports = React.createClass({
var parentPost = this.props.parentPost;
var posts = this.props.posts;
- var type = "Post";
+ var type = 'Post';
if (post.root_id && post.root_id.length > 0) {
- type = "Comment";
+ type = 'Comment';
}
var commentCount = 0;
diff --git a/web/react/components/post_body.jsx b/web/react/components/post_body.jsx
index 7abf388388..13722857e1 100644
--- a/web/react/components/post_body.jsx
+++ b/web/react/components/post_body.jsx
@@ -31,9 +31,9 @@ module.exports = React.createClass({
var name = "...";
if (profile != null) {
if (profile.username.slice(-1) === 's') {
- apostrophe = "'";
+ apostrophe = '\'';
} else {
- apostrophe = "'s";
+ apostrophe = '\'s';
}
name = {profile.username};
}
@@ -62,11 +62,11 @@ module.exports = React.createClass({
var loading;
if (post.state === Constants.POST_FAILED) {
- postClass += " post-fail";
- loading = Retry;
+ postClass += ' post-fail';
+ loading = Retry;
} else if (post.state === Constants.POST_LOADING) {
- postClass += " post-waiting";
- loading =
;
+ postClass += ' post-waiting';
+ loading =
;
}
var embed;
diff --git a/web/react/components/post_info.jsx b/web/react/components/post_info.jsx
index 37e5257170..f6ab0ed8a2 100644
--- a/web/react/components/post_info.jsx
+++ b/web/react/components/post_info.jsx
@@ -12,44 +12,68 @@ module.exports = React.createClass({
},
render: function() {
var post = this.props.post;
- var isOwner = UserStore.getCurrentId() == post.user_id;
- var isAdmin = UserStore.getCurrentUser().roles.indexOf("admin") > -1
+ var isOwner = UserStore.getCurrentId() === post.user_id;
+ var isAdmin = UserStore.getCurrentUser().roles.indexOf('admin') > -1;
- var type = "Post";
+ var type = 'Post';
if (post.root_id && post.root_id.length > 0) {
- type = "Comment";
+ type = 'Comment';
}
- var comments = "";
- var lastCommentClass = this.props.isLastComment ? " comment-icon__container__show" : " comment-icon__container__hide";
- if (this.props.commentCount >= 1 && post.state !== Constants.POST_FAILED && post.state !== Constants.POST_LOADING) {
- comments = {this.props.commentCount};
+ var comments = '';
+ var lastCommentClass = ' comment-icon__container__hide';
+ if (this.props.isLastComment) {
+ lastCommentClass = ' comment-icon__container__show';
}
- var show_dropdown = isOwner || (this.props.allowReply === "true" && type != "Comment");
- if (post.state === Constants.POST_FAILED || post.state === Constants.POST_LOADING) show_dropdown = false;
+ if (this.props.commentCount >= 1 && post.state !== Constants.POST_FAILED && post.state !== Constants.POST_LOADING) {
+ comments = {this.props.commentCount};
+ }
+
+ var showDropdown = isOwner || (this.props.allowReply === 'true' && type !== 'Comment');
+ if (post.state === Constants.POST_FAILED || post.state === Constants.POST_LOADING) {
+ showDropdown = false;
+ }
+
+ var dropdownContents = [];
+ var dropdown;
+ if (showDropdown) {
+ var dataComments = 0;
+ if (type === 'Post') {
+ dataComments = this.props.commentCount;
+ }
+
+ if (isOwner) {
+ dropdownContents.push(