From 9fca35cad531fe040155ba460577b0c3eba6b24e Mon Sep 17 00:00:00 2001
From: Reed Garmsen <rgarmsen2295@gmail.com>
Date: Thu, 2 Jul 2015 11:13:38 -0700
Subject: Added additional class to the markup indicating if the post came from
 the current user

---
 web/react/components/post_right.jsx | 20 +++++++++++++++-----
 1 file changed, 15 insertions(+), 5 deletions(-)

(limited to 'web/react/components/post_right.jsx')

diff --git a/web/react/components/post_right.jsx b/web/react/components/post_right.jsx
index 43be60afa..15a058c5f 100644
--- a/web/react/components/post_right.jsx
+++ b/web/react/components/post_right.jsx
@@ -68,9 +68,14 @@ RootPost = React.createClass({
         var filenames = this.props.post.filenames;
         var isOwner = UserStore.getCurrentId() == this.props.post.user_id;
 
-        var type = "Post"
+        var type = "Post";
         if (this.props.post.root_id.length > 0) {
-            type = "Comment"
+            type = "Comment";
+        }
+
+        var currentUser = "";
+        if (UserStore.getCurrentId() === this.props.post.user_id) {
+            currentUser = "current--user";
         }
 
         if (filenames) {
@@ -84,7 +89,7 @@ RootPost = React.createClass({
                 if (fileSplit.length < 2) continue;
 
                 var ext = fileSplit[fileSplit.length-1];
-                fileSplit.splice(fileSplit.length-1,1)
+                fileSplit.splice(fileSplit.length-1,1);
                 var filePath = fileSplit.join('.');
                 var filename = filePath.split('/')[filePath.split('/').length-1];
 
@@ -111,7 +116,7 @@ RootPost = React.createClass({
         }
 
         return (
-            <div className="post post--root">
+            <div className={"post post--root " + currentUser}>
                 <div className="post-profile-img__container">
                     <img className="post-profile-img" src={"/api/v1/users/" + this.props.post.user_id + "/image"} height="36" width="36" />
                 </div>
@@ -170,6 +175,11 @@ CommentPost = React.createClass({
 
         var commentClass = "post";
 
+        var currentUser = "";
+        if (UserStore.getCurrentId() === this.props.post.user_id) {
+            currentUser = "current--user";
+        }
+
         var postImageModalId = "rhs_comment_view_image_modal_" + this.props.post.id;
         var filenames = this.props.post.filenames;
         var isOwner = UserStore.getCurrentId() == this.props.post.user_id;
@@ -219,7 +229,7 @@ CommentPost = React.createClass({
         var message = utils.textToJsx(this.props.post.message);
 
         return (
-            <div className={commentClass}>
+            <div className={commentClass + " " + currentUser}>
                 <div className="post-profile-img__container">
                     <img className="post-profile-img" src={"/api/v1/users/" + this.props.post.user_id + "/image"} height="36" width="36" />
                 </div>
-- 
cgit v1.2.3-1-g7c22


From 97c112c42707f92279b8a85f1f0ad8517fa59f18 Mon Sep 17 00:00:00 2001
From: Asaad Mahmood <Unknowngi@live.com>
Date: Fri, 17 Jul 2015 23:56:27 +0500
Subject: Changing var currentUser in post_right

---
 web/react/components/post_right.jsx | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

(limited to 'web/react/components/post_right.jsx')

diff --git a/web/react/components/post_right.jsx b/web/react/components/post_right.jsx
index 15a058c5f..2c28c5d9f 100644
--- a/web/react/components/post_right.jsx
+++ b/web/react/components/post_right.jsx
@@ -73,9 +73,9 @@ RootPost = React.createClass({
             type = "Comment";
         }
 
-        var currentUser = "";
+        var currentUserCss = "";
         if (UserStore.getCurrentId() === this.props.post.user_id) {
-            currentUser = "current--user";
+            currentUserCss = "current--user";
         }
 
         if (filenames) {
@@ -116,7 +116,7 @@ RootPost = React.createClass({
         }
 
         return (
-            <div className={"post post--root " + currentUser}>
+            <div className={"post post--root " + currentUserCss}>
                 <div className="post-profile-img__container">
                     <img className="post-profile-img" src={"/api/v1/users/" + this.props.post.user_id + "/image"} height="36" width="36" />
                 </div>
@@ -175,9 +175,9 @@ CommentPost = React.createClass({
 
         var commentClass = "post";
 
-        var currentUser = "";
+        var currentUserCss = "";
         if (UserStore.getCurrentId() === this.props.post.user_id) {
-            currentUser = "current--user";
+            currentUserCss = "current--user";
         }
 
         var postImageModalId = "rhs_comment_view_image_modal_" + this.props.post.id;
@@ -229,7 +229,7 @@ CommentPost = React.createClass({
         var message = utils.textToJsx(this.props.post.message);
 
         return (
-            <div className={commentClass + " " + currentUser}>
+            <div className={commentClass + " " + currentUserCss}>
                 <div className="post-profile-img__container">
                     <img className="post-profile-img" src={"/api/v1/users/" + this.props.post.user_id + "/image"} height="36" width="36" />
                 </div>
-- 
cgit v1.2.3-1-g7c22

