mirror of
https://github.com/codeninjasllc/codecombat.git
synced 2025-02-17 08:50:58 -05:00
Fix admin view when not an admin
This commit is contained in:
parent
1da82fa851
commit
54c1361b1c
1 changed files with 3 additions and 2 deletions
|
@ -31,14 +31,15 @@ module.exports = class MainAdminView extends RootView
|
|||
getTitle: -> return $.i18n.t('account_settings.admin')
|
||||
|
||||
initialize: ->
|
||||
@campaigns = new Campaigns()
|
||||
@courses = new CocoCollection([], { url: "/db/course", model: Course})
|
||||
|
||||
if window.amActually
|
||||
@amActually = new User({_id: window.amActually})
|
||||
@amActually.fetch()
|
||||
@supermodel.trackModel(@amActually)
|
||||
if me.isAdmin()
|
||||
@campaigns = new Campaigns()
|
||||
@supermodel.trackRequest @campaigns.fetchByType('course', { data: { project: 'levels' } })
|
||||
@courses = new CocoCollection([], { url: "/db/course", model: Course})
|
||||
@supermodel.loadCollection(@courses, 'courses')
|
||||
super()
|
||||
|
||||
|
|
Loading…
Reference in a new issue