From 205d90e25bd6e0a78aa5e071aaa2f299048a4f7b Mon Sep 17 00:00:00 2001 From: Brian Smith Date: Fri, 22 Nov 2013 00:16:03 -0500 Subject: [PATCH] VRFS-689 only show band setup link if user is on his own profile --- web/app/assets/javascripts/profile.js | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/web/app/assets/javascripts/profile.js b/web/app/assets/javascripts/profile.js index 610325402..82c03e0cf 100644 --- a/web/app/assets/javascripts/profile.js +++ b/web/app/assets/javascripts/profile.js @@ -482,7 +482,9 @@ async: false, processData:false, success: function(response) { - if (!response || response.length === 0) { + logger.debug("context.JK.currentUserId=" + context.JK.currentUserId); + logger.debug("userId=" + userId); + if ( (!response || response.length === 0) && context.JK.currentUserId === userId) { var noBandHtml = $('#template-no-bands').html(); $("#profile-bands").append(noBandHtml); } @@ -538,8 +540,10 @@ configureBandFollowingButton(following, val.id); }); - var moreBandsHtml = $('#template-more-bands').html(); - $("#profile-bands").append(moreBandsHtml); + if (context.JK.currentUserId === userId) { + var moreBandsHtml = $('#template-more-bands').html(); + $("#profile-bands").append(moreBandsHtml); + } } }, error: app.ajaxError