mirror of
https://github.com/codeninjasllc/codecombat.git
synced 2025-04-26 14:03:28 -04:00
Did some tweaking of UserView to handle slugs for ids.
This commit is contained in:
parent
adbfa42f25
commit
8f29d0ee7f
2 changed files with 3 additions and 2 deletions
app/views
|
@ -25,13 +25,14 @@ module.exports = class UserView extends RootView
|
|||
context.user = @user unless @user?.isAnonymous()
|
||||
context
|
||||
|
||||
isMe: -> @userID is me.id
|
||||
isMe: -> @userID in [me.id, me.get('slug')]
|
||||
|
||||
onLoaded: ->
|
||||
@onUserLoaded @user if @user.loaded and not @userLoaded
|
||||
super()
|
||||
|
||||
onUserLoaded: ->
|
||||
@userID = @user.id
|
||||
@userLoaded = true
|
||||
|
||||
ifUserNotFound: ->
|
||||
|
|
|
@ -84,7 +84,7 @@ module.exports = class JobProfileView extends UserView
|
|||
if me.isAdmin() or 'employer' in me.get('permissions', true)
|
||||
$.post "/db/user/#{me.id}/track/view_candidate"
|
||||
$.post "/db/user/#{@userID}/track/viewed_by_employer" unless me.isAdmin()
|
||||
@sessions = @supermodel.loadCollection(new LevelSessionsCollection(@userID), 'candidate_sessions').model
|
||||
@sessions = @supermodel.loadCollection(new LevelSessionsCollection(@user.id), 'candidate_sessions').model
|
||||
@listenToOnce @sessions, 'sync', => @render?()
|
||||
if me.isAdmin()
|
||||
# Mimicking how the VictoryModal fetches LevelFeedback
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue