mirror of
https://github.com/codeninjasllc/codecombat.git
synced 2024-11-25 00:28:31 -05:00
24 lines
563 B
CoffeeScript
24 lines
563 B
CoffeeScript
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
|
|
|
|
# TODO Ruben Assume ID for now
|
|
@user = @supermodel.loadModel(new User(_id: nameOrID), 'user').model
|
|
|
|
onLoaded: ->
|
|
@render()
|
|
|
|
getRenderData: ->
|
|
context = super()
|
|
context.currentUserView = 'Achievements'
|
|
context.user = @user
|
|
context
|
|
|
|
isMe: -> @nameOrID is me.id
|