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: ->
|
2014-04-06 20:01:56 -04:00
|
|
|
@sessions = new LevelSessionCollection()
|
2014-01-03 13:32:13 -05:00
|
|
|
@sessions.fetch()
|
2014-04-06 20:01:56 -04:00
|
|
|
@listenToOnce @sessions, 'all', @render
|
2014-01-03 13:32:13 -05:00
|
|
|
|
|
|
|
getRenderData: =>
|
|
|
|
c = super()
|
|
|
|
c.sessions = @sessions.models
|
|
|
|
c.moment = moment
|
2014-04-06 20:01:56 -04:00
|
|
|
c
|