diff --git a/app/schemas/models/achievement.coffee b/app/schemas/models/achievement.coffee index ae863f0ff..9b2ca20df 100644 --- a/app/schemas/models/achievement.coffee +++ b/app/schemas/models/achievement.coffee @@ -81,6 +81,7 @@ _.extend AchievementSchema.properties, additionalProperties: false i18n: {type: 'object', format: 'i18n', props: ['name', 'description'], description: 'Help translate this achievement'} rewards: c.RewardSchema 'awarded by this achievement' + hidden: {type: 'boolean', description: 'Hide achievement from user if true'} _.extend AchievementSchema, # Let's have these on the bottom diff --git a/app/templates/play/level/modal/hero-victory-modal.jade b/app/templates/play/level/modal/hero-victory-modal.jade index 5bf75373f..6ec9f46fc 100644 --- a/app/templates/play/level/modal/hero-victory-modal.jade +++ b/app/templates/play/level/modal/hero-victory-modal.jade @@ -50,6 +50,8 @@ block modal-body-content if level.isType('hero', 'hero-ladder', 'game-dev', 'web-dev') for achievement in achievements + if achievement.get('hidden') + - continue; - var animate = achievement.completed && !achievement.completedAWhileAgo .achievement-panel(class=achievement.completedAWhileAgo ? 'earned' : '' data-achievement-id=achievement.id data-animate=animate) - var rewards = achievement.get('rewards') || {}; diff --git a/app/views/core/RootView.coffee b/app/views/core/RootView.coffee index 8e29b9e12..d24a33516 100644 --- a/app/views/core/RootView.coffee +++ b/app/views/core/RootView.coffee @@ -45,6 +45,7 @@ module.exports = class RootView extends CocoView return if achievement.get('collection') is 'level.sessions' and not achievement.get('query')?.team #return if @isIE() # Some bugs in IE right now, TODO fix soon! # Maybe working now with not caching achievement fetches in CocoModel? return if window.serverConfig.picoCTF + return if achievement.get('hidden') new AchievementPopup achievement: achievement, earnedAchievement: earnedAchievement handleNewAchievements: (e) -> diff --git a/server/models/Achievement.coffee b/server/models/Achievement.coffee index 70e8318a6..f2190f135 100644 --- a/server/models/Achievement.coffee +++ b/server/models/Achievement.coffee @@ -91,6 +91,7 @@ AchievementSchema.statics.editableProperties = [ 'rewards' 'i18n' 'i18nCoverage' + 'hidden' ] AchievementSchema.statics.jsonSchema = require '../../app/schemas/models/achievement'