mirror of
https://github.com/codeninjasllc/codecombat.git
synced 2024-11-28 10:06:08 -05:00
27 lines
666 B
CoffeeScript
27 lines
666 B
CoffeeScript
|
View = require 'views/kinds/RootView'
|
||
|
template = require 'templates/admin/level_sessions'
|
||
|
LevelSession = require 'models/LevelSession'
|
||
|
|
||
|
# Placeholder
|
||
|
class LevelSessionCollection extends Backbone.Collection
|
||
|
url: '/db/level_session/x/active'
|
||
|
model: LevelSession
|
||
|
|
||
|
module.exports = class LevelSessionsView extends View
|
||
|
id: "admin-level-sessions-view"
|
||
|
template: template
|
||
|
|
||
|
constructor: (options) ->
|
||
|
super options
|
||
|
@getLevelSessions()
|
||
|
|
||
|
getLevelSessions: ->
|
||
|
@sessions = new LevelSessionCollection
|
||
|
@sessions.fetch()
|
||
|
@sessions.on('all', @render)
|
||
|
|
||
|
getRenderData: =>
|
||
|
c = super()
|
||
|
c.sessions = @sessions.models
|
||
|
c.moment = moment
|
||
|
c
|