2014-07-17 20:16:32 -04:00
|
|
|
RootView = require 'views/kinds/RootView'
|
2014-01-03 13:32:13 -05:00
|
|
|
template = require 'templates/admin/level_sessions'
|
|
|
|
LevelSession = require 'models/LevelSession'
|
2014-08-26 20:34:00 -04:00
|
|
|
CocoCollection = require 'collections/CocoCollection'
|
2014-01-03 13:32:13 -05:00
|
|
|
|
2014-08-26 20:34:00 -04:00
|
|
|
class LevelSessionCollection extends CocoCollection
|
|
|
|
url: '/db/level_session/x/active?project=screenshot,levelName,creatorName'
|
2014-01-03 13:32:13 -05:00
|
|
|
model: LevelSession
|
|
|
|
|
2014-07-17 20:16:32 -04:00
|
|
|
module.exports = class LevelSessionsView extends RootView
|
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-08-26 20:34:00 -04:00
|
|
|
@sessions = @supermodel.loadCollection(new LevelSessionCollection(), 'sessions').model
|
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
|