codecombat/app/views/user/achievements.coffee

21 lines
718 B
CoffeeScript
Raw Normal View History

UserView = require 'views/kinds/UserView'
template = require 'templates/user/achievements'
{me} = require 'lib/auth'
Achievement = require 'models/Achievement'
2014-07-06 17:38:57 -04:00
EarnedAchievement = require 'models/EarnedAchievement'
AchievementCollection = require 'collections/AchievementCollection'
2014-07-06 17:38:57 -04:00
EarnedAchievementCollection = require 'collections/EarnedAchievementCollection'
2014-07-06 17:16:00 -04:00
module.exports = class UserAchievementsView extends UserView
id: 'user-achievements-view'
template: template
events:
'userLoaded': 'onUserLoaded'
constructor: (options, nameOrID) ->
super options, nameOrID
onUserLoaded: (user) ->
@achievements = @supermodel.loadCollection(new AchievementCollection(@user), 'achievements').model