codecombat/app/views/kinds/UserView.coffee

32 lines
685 B
CoffeeScript
Raw Normal View History

RootView = require 'views/kinds/RootView'
template = require 'templates/kinds/user'
User = require 'models/User'
module.exports = class UserView extends RootView
template: template
className: 'user-view'
constructor: (options, @nameOrID) ->
super options
@listenTo @, 'userLoaded', @onUserLoaded
# TODO Ruben Assume ID for now
2014-07-07 06:03:48 -04:00
@user = User.getByID @nameOrID, {}, true,
success: =>
@trigger 'userLoaded', @user
getRenderData: ->
context = super()
context.currentUserView = 'Achievements'
context.user = @user
context
isMe: -> @nameOrID is me.id
onUserLoaded: ->
2014-07-07 06:44:44 -04:00
console.log 'onUserLoaded'
onLoaded: ->
super()