codecombat/app/views/courses/CoursesView.coffee
2015-08-29 07:15:39 -07:00

18 lines
542 B
CoffeeScript

RootView = require 'views/core/RootView'
template = require 'templates/courses/courses'
CocoCollection = require 'collections/CocoCollection'
Course = require 'models/Course'
module.exports = class CoursesView extends RootView
id: 'courses-view'
template: template
constructor: (options) ->
super options
@courses = new CocoCollection([], { url: "/db/course", model: Course})
@supermodel.loadCollection(@courses, 'courses')
getRenderData: ->
context = super()
context.courses = @courses.models ? []
context