codecombat/app/views/user/achievements.coffee

23 lines
746 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) ->
2014-07-07 06:44:44 -04:00
super user
@earnedAchievements = @supermodel.loadCollection(new EarnedAchievementCollection(@user), 'achievements').model