codecombat/app/views/admin/level_sessions_view.coffee

28 lines
680 B
CoffeeScript
Raw Normal View History

2014-01-03 13:32:13 -05:00
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
2014-06-30 22:16:26 -04:00
id: 'admin-level-sessions-view'
2014-01-03 13:32:13 -05:00
template: template
constructor: (options) ->
super options
@getLevelSessions()
getLevelSessions: ->
@sessions = new LevelSessionCollection()
2014-01-03 13:32:13 -05:00
@sessions.fetch()
@listenToOnce @sessions, 'all', @render
2014-01-03 13:32:13 -05:00
getRenderData: =>
c = super()
c.sessions = @sessions.models
c.moment = moment
c