2014-07-06 14:45:27 -04:00
|
|
|
UserView = require 'views/kinds/UserView'
|
|
|
|
template = require 'templates/user/achievements'
|
|
|
|
{me} = require 'lib/auth'
|
2014-07-06 16:48:33 -04:00
|
|
|
Achievement = require 'models/Achievement'
|
|
|
|
AchievementCollection = require 'collections/AchievementCollection'
|
2014-07-06 14:45:27 -04:00
|
|
|
|
|
|
|
module.exports = class UserAchievementsViewe extends UserView
|
|
|
|
id: 'user-achievements-view'
|
|
|
|
template: template
|
|
|
|
|
2014-07-06 16:48:33 -04:00
|
|
|
events:
|
|
|
|
'userLoaded': 'onUserLoaded'
|
2014-07-06 14:45:27 -04:00
|
|
|
|
2014-07-06 16:48:33 -04:00
|
|
|
constructor: (options, nameOrID) ->
|
|
|
|
super options, nameOrID
|
|
|
|
|
|
|
|
onUserLoaded: (user) ->
|
|
|
|
@achievements = @supermodel.loadCollection(new AchievementCollection(@user), 'achievements').model
|