2014-08-04 16:21:43 -04:00
|
|
|
CocoView = require 'views/kinds/CocoView'
|
2014-08-05 08:33:33 -04:00
|
|
|
template = require 'templates/editor/related_achievements'
|
2014-08-04 16:21:43 -04:00
|
|
|
RelatedAchievementsCollection = require 'collections/RelatedAchievementsCollection'
|
|
|
|
Achievement = require 'models/Achievement'
|
|
|
|
|
|
|
|
module.exports = class RelatedAchievementsView extends CocoView
|
|
|
|
id: 'related-achievements-view'
|
|
|
|
template: template
|
|
|
|
className: 'tab-pane'
|
|
|
|
|
|
|
|
constructor: (options) ->
|
|
|
|
super options
|
2014-08-05 08:33:33 -04:00
|
|
|
@relatedID = options.relatedID
|
2014-08-04 16:21:43 -04:00
|
|
|
@achievements = new RelatedAchievementsCollection @relatedID
|
|
|
|
console.debug @achievements
|
|
|
|
@supermodel.loadCollection @achievements, 'achievements'
|
|
|
|
|
|
|
|
onLoaded: ->
|
|
|
|
console.debug 'related achievements loaded'
|
2014-08-05 08:33:33 -04:00
|
|
|
@achievements.loading = false
|
2014-08-04 16:21:43 -04:00
|
|
|
super()
|
|
|
|
|
|
|
|
getRenderData: ->
|
|
|
|
c = super()
|
|
|
|
c.achievements = @achievements
|
|
|
|
c.relatedID = @relatedID
|
|
|
|
c
|
2014-08-05 08:33:33 -04:00
|
|
|
|
|
|
|
render: ->
|
|
|
|
console.debug 'rendering achievements'
|
|
|
|
super()
|