mirror of
https://github.com/codeninjasllc/codecombat.git
synced 2024-11-25 00:28:31 -05:00
19 lines
542 B
CoffeeScript
19 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
|