From 4221fd55cb29c358b72fbb9b0ead92133b0e68e5 Mon Sep 17 00:00:00 2001 From: Michael Schmatz Date: Wed, 7 May 2014 13:56:10 -0700 Subject: [PATCH] Fixed #979 --- app/templates/account/profile.jade | 8 ++++++-- app/views/account/profile_view.coffee | 3 ++- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/app/templates/account/profile.jade b/app/templates/account/profile.jade index 8f3af794e..aedd0d623 100644 --- a/app/templates/account/profile.jade +++ b/app/templates/account/profile.jade @@ -17,7 +17,7 @@ block content if user.id != me.id button.btn.edit-settings-button#enter-espionage-mode 007 - if user.get('jobProfile') + if user.get('jobProfile') && allowedToViewJobProfile - var profile = user.get('jobProfile'); .job-profile-container .job-profile-row @@ -112,7 +112,11 @@ block content .project-image(style="background-image: url('/file/" + project.picture + "')") p= project.name div!= marked(project.description) - + else if allowedToViewJobProfile + .public-profile-container + h2 Loading... + + else .public-profile-container h2 diff --git a/app/views/account/profile_view.coffee b/app/views/account/profile_view.coffee index 5f38125f2..49249f317 100644 --- a/app/views/account/profile_view.coffee +++ b/app/views/account/profile_view.coffee @@ -18,7 +18,7 @@ module.exports = class ProfileView extends View super options if @userID is me.id @user = me - else + else if me.isAdmin() or "employer" in me.get('permissions') @user = User.getByID(@userID) @user.fetch() @listenTo @user, "sync", => @@ -27,6 +27,7 @@ module.exports = class ProfileView extends View getRenderData: -> context = super() context.user = @user + context.allowedToViewJobProfile = me.isAdmin() or "employer" in me.get('permissions') context.myProfile = @user.id is context.me.id context.marked = marked context.moment = moment