2014-07-06 14:45:27 -04:00
|
|
|
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'
|
|
|
|
|
2014-07-06 15:10:28 -04:00
|
|
|
constructor: (options, @nameOrID) ->
|
|
|
|
super options
|
|
|
|
|
2014-07-06 14:45:27 -04:00
|
|
|
# TODO Ruben Assume ID for now
|
2014-07-06 15:10:28 -04:00
|
|
|
@user = @supermodel.loadModel(new User(_id: nameOrID), 'user').model
|
2014-07-06 14:45:27 -04:00
|
|
|
|
2014-07-06 15:10:28 -04:00
|
|
|
onLoaded: ->
|
|
|
|
@render()
|
|
|
|
|
|
|
|
getRenderData: ->
|
|
|
|
context = super()
|
|
|
|
context.currentUserView = 'Achievements'
|
|
|
|
context.user = @user
|
|
|
|
context
|
|
|
|
|
|
|
|
isMe: -> @nameOrID is me.id
|