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
|
|
|
|
id: "admin-level-sessions-view"
|
|
|
|
template: template
|
|
|
|
|
|
|
|
constructor: (options) ->
|
|
|
|
super options
|
|
|
|
@getLevelSessions()
|
|
|
|
|
|
|
|
getLevelSessions: ->
|
|
|
|
@sessions = new LevelSessionCollection
|
|
|
|
@sessions.fetch()
|
2014-03-24 02:53:41 -04:00
|
|
|
@listenTo(@sessions, 'all', @render)
|
2014-01-03 13:32:13 -05:00
|
|
|
|
|
|
|
getRenderData: =>
|
|
|
|
c = super()
|
|
|
|
c.sessions = @sessions.models
|
|
|
|
c.moment = moment
|
|
|
|
c
|