codecombat/app/views/editor/RelatedAchievementsView.coffee

32 lines
898 B
CoffeeScript
Raw Normal View History

2014-08-04 16:21:43 -04:00
CocoView = require 'views/kinds/CocoView'
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
@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'
@achievements.loading = false
2014-08-04 16:21:43 -04:00
super()
getRenderData: ->
c = super()
c.achievements = @achievements
c.relatedID = @relatedID
c
render: ->
console.debug 'rendering achievements'
super()