This commit is contained in:
Michael Schmatz 2014-05-07 13:56:10 -07:00
parent ae213cc330
commit 4221fd55cb
2 changed files with 8 additions and 3 deletions

View file

@ -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

View file

@ -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