mirror of
https://github.com/codeninjasllc/codecombat.git
synced 2024-11-30 02:55:43 -05:00
29 lines
875 B
CoffeeScript
29 lines
875 B
CoffeeScript
RootView = require 'views/core/RootView'
|
|
template = require 'templates/admin/clas'
|
|
CocoCollection = require 'collections/CocoCollection'
|
|
CocoModel = require 'models/CocoModel'
|
|
|
|
class CLASubmission extends CocoModel
|
|
@className: 'CLA'
|
|
@schema: require 'schemas/models/cla_submission'
|
|
urlRoot: '/db/cla.submission'
|
|
|
|
class CLACollection extends CocoCollection
|
|
url: '/db/cla.submissions'
|
|
model: CLASubmission
|
|
|
|
module.exports = class CLAsView extends RootView
|
|
id: 'admin-clas-view'
|
|
template: template
|
|
|
|
constructor: (options) ->
|
|
super options
|
|
@clas = @supermodel.loadCollection(new CLACollection(), 'clas', {cache: false}).model
|
|
|
|
getRenderData: ->
|
|
c = super()
|
|
c.clas = []
|
|
if @supermodel.finished()
|
|
c.clas = _.uniq (_.sortBy (cla.attributes for cla in @clas.models), (m) ->
|
|
m.githubUsername?.toLowerCase()), 'githubUsername'
|
|
c
|