Skip to content

Commit

Permalink
Add releasePhase for ThangTypes to allow heroes to go live in classro…
Browse files Browse the repository at this point in the history
…om without being live in home
  • Loading branch information
nwinter committed Jun 16, 2017
1 parent 8bde23d commit ee2a42c
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 1 deletion.
1 change: 1 addition & 0 deletions app/schemas/models/thang_type.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -209,6 +209,7 @@ _.extend ThangTypeSchema.properties,
}
spriteType: { enum: ['singular', 'segmented'], title: 'Sprite Type' }
restricted: {type: 'string', title: 'Restricted', description: 'If set, this ThangType will only be accessible by admins and whoever it is restricted to.'}
releasePhase: { enum: ['beta', 'released'], description: "How far along the ThangType's development is, determining who sees it." }

ThangTypeSchema.required = []

Expand Down
4 changes: 3 additions & 1 deletion app/views/play/modal/PlayHeroesModal.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ module.exports = class PlayHeroesModal extends ModalView
@confirmButtonI18N = options.confirmButtonI18N ? "common.save"
@heroes = new CocoCollection([], {model: ThangType})
@heroes.url = '/db/thang.type?view=heroes'
@heroes.setProjection ['original','name','slug','soundTriggers','featureImages','gems','heroClass','description','components','extendedName','unlockLevelName','i18n','poseImage','tier']
@heroes.setProjection ['original','name','slug','soundTriggers','featureImages','gems','heroClass','description','components','extendedName','unlockLevelName','i18n','poseImage','tier','releasePhase']
@heroes.comparator = 'gems'
@listenToOnce @heroes, 'sync', @onHeroesLoaded
@supermodel.loadCollection(@heroes, 'heroes')
Expand All @@ -55,6 +55,8 @@ module.exports = class PlayHeroesModal extends ModalView
@formatHero hero for hero in @heroes.models
if me.freeOnly()
@heroes.reset(@heroes.filter((hero) => !hero.locked))
unless me.isAdmin()
@heroes.reset(@heroes.filter((hero) => hero.get('releasePhase') isnt 'beta'))

formatHero: (hero) ->
hero.name = utils.i18n hero.attributes, 'extendedName'
Expand Down
1 change: 1 addition & 0 deletions server/handlers/thang_type_handler.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ ThangTypeHandler = class ThangTypeHandler extends Handler
'terrains'
'prerenderedSpriteSheetData'
'restricted'
'releasePhase'
]

hasAccess: (req) ->
Expand Down

0 comments on commit ee2a42c

Please sign in to comment.