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'
|
2014-07-06 17:38:57 -04:00
|
|
|
EarnedAchievement = require 'models/EarnedAchievement'
|
2014-07-06 16:48:33 -04:00
|
|
|
AchievementCollection = require 'collections/AchievementCollection'
|
2014-07-06 17:38:57 -04:00
|
|
|
EarnedAchievementCollection = require 'collections/EarnedAchievementCollection'
|
2014-07-06 14:45:27 -04:00
|
|
|
|
2014-07-06 17:16:00 -04:00
|
|
|
module.exports = class UserAchievementsView extends UserView
|
2014-07-06 14:45:27 -04:00
|
|
|
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
|