mirror of
https://github.com/codeninjasllc/codecombat.git
synced 2024-11-25 08:38:09 -05:00
25 lines
744 B
CoffeeScript
25 lines
744 B
CoffeeScript
RootView = require 'views/kinds/RootView'
|
|
template = require 'templates/admin/level_sessions'
|
|
LevelSession = require 'models/LevelSession'
|
|
CocoCollection = require 'collections/CocoCollection'
|
|
|
|
class LevelSessionCollection extends CocoCollection
|
|
url: '/db/level_session/x/active?project=screenshot,levelName,creatorName'
|
|
model: LevelSession
|
|
|
|
module.exports = class LevelSessionsView extends RootView
|
|
id: 'admin-level-sessions-view'
|
|
template: template
|
|
|
|
constructor: (options) ->
|
|
super options
|
|
@getLevelSessions()
|
|
|
|
getLevelSessions: ->
|
|
@sessions = @supermodel.loadCollection(new LevelSessionCollection(), 'sessions').model
|
|
|
|
getRenderData: =>
|
|
c = super()
|
|
c.sessions = @sessions.models
|
|
c.moment = moment
|
|
c
|