Merge branch 'master' into production

This commit is contained in:
phoenixeliot 2016-07-14 16:38:33 -07:00
commit 091c062d67
6 changed files with 6 additions and 1 deletions

View file

@ -25,6 +25,7 @@ _.extend ClassroomSchema.properties,
levels: c.array { title: 'Levels' }, c.object { title: 'Level' }, { levels: c.array { title: 'Levels' }, c.object { title: 'Level' }, {
practice: {type: 'boolean'} practice: {type: 'boolean'}
practiceThresholdMinutes: {type: 'number'} practiceThresholdMinutes: {type: 'number'}
shareable: {type: 'boolean'}
type: c.shortString() type: c.shortString()
original: c.objectId() original: c.objectId()
name: {type: 'string'} name: {type: 'string'}

View file

@ -325,6 +325,7 @@ _.extend LevelSchema.properties,
replayable: {type: 'boolean', title: 'Replayable', description: 'Whether this (hero) level infinitely scales up its difficulty and can be beaten over and over for greater rewards.'} replayable: {type: 'boolean', title: 'Replayable', description: 'Whether this (hero) level infinitely scales up its difficulty and can be beaten over and over for greater rewards.'}
buildTime: {type: 'number', description: 'How long it has taken to build this level.'} buildTime: {type: 'number', description: 'How long it has taken to build this level.'}
practice: { type: 'boolean' } practice: { type: 'boolean' }
shareable: { type: 'boolean', title: 'Shareable' }
practiceThresholdMinutes: {type: 'number', description: 'Players with larger playtimes may be directed to a practice level.'} practiceThresholdMinutes: {type: 'number', description: 'Players with larger playtimes may be directed to a practice level.'}
# Admin flags # Admin flags

View file

@ -16,6 +16,7 @@ module.exports = class SettingsTabView extends CocoView
'name', 'description', 'documentation', 'nextLevel', 'background', 'victory', 'i18n', 'icon', 'goals', 'name', 'description', 'documentation', 'nextLevel', 'background', 'victory', 'i18n', 'icon', 'goals',
'type', 'terrain', 'showsGuide', 'banner', 'employerDescription', 'loadingTip', 'requiresSubscription', 'type', 'terrain', 'showsGuide', 'banner', 'employerDescription', 'loadingTip', 'requiresSubscription',
'helpVideos', 'replayable', 'scoreTypes', 'concepts', 'picoCTFProblem', 'practice', 'practiceThresholdMinutes' 'helpVideos', 'replayable', 'scoreTypes', 'concepts', 'picoCTFProblem', 'practice', 'practiceThresholdMinutes'
'shareable'
] ]
subscriptions: subscriptions:

View file

@ -136,6 +136,7 @@ class SimulatorsLeaderboardData extends CocoClass
return me.id in (user.id for user in @topSimulators.models) return me.id in (user.id for user in @topSimulators.models)
nearbySimulators: -> nearbySimulators: ->
return [] if not @playersAbove?.models
l = [] l = []
above = @playersAbove.models above = @playersAbove.models
l = l.concat(above) l = l.concat(above)

View file

@ -39,6 +39,7 @@ LevelHandler = class LevelHandler extends Handler
'requiresSubscription' 'requiresSubscription'
'adventurer' 'adventurer'
'practice' 'practice'
'shareable'
'adminOnly' 'adminOnly'
'disableSpaces' 'disableSpaces'
'hidesSubmitUntilRun' 'hidesSubmitUntilRun'

View file

@ -154,7 +154,7 @@ module.exports =
levels = _.sortBy(levels, 'campaignIndex') levels = _.sortBy(levels, 'campaignIndex')
for level in levels for level in levels
levelData = { original: mongoose.Types.ObjectId(level.original) } levelData = { original: mongoose.Types.ObjectId(level.original) }
_.extend(levelData, _.pick(level, 'type', 'slug', 'name', 'practice', 'practiceThresholdMinutes')) _.extend(levelData, _.pick(level, 'type', 'slug', 'name', 'practice', 'practiceThresholdMinutes', 'shareable'))
courseData.levels.push(levelData) courseData.levels.push(levelData)
coursesData.push(courseData) coursesData.push(courseData)
classroom.set('courses', coursesData) classroom.set('courses', coursesData)