diff --git a/app/collections/EarnedAchievementCollection.coffee b/app/collections/EarnedAchievementCollection.coffee index d091c36f6..82207afeb 100644 --- a/app/collections/EarnedAchievementCollection.coffee +++ b/app/collections/EarnedAchievementCollection.coffee @@ -6,3 +6,4 @@ module.exports = class EarnedAchievementCollection extends CocoCollection initialize: (userID) -> @url = "/db/user/#{userID}/achievements" + super() diff --git a/app/lib/LevelBus.coffee b/app/lib/LevelBus.coffee index 4f7cb583c..7ea0837c1 100644 --- a/app/lib/LevelBus.coffee +++ b/app/lib/LevelBus.coffee @@ -195,7 +195,6 @@ module.exports = class LevelBus extends Bus @saveSession() onNewGoalStates: ({goalStates})-> - console.debug arguments state = @session.get 'state' unless utils.kindaEqual state.goalStates, goalStates # Only save when goals really change state.goalStates = goalStates diff --git a/app/templates/user/achievements.jade b/app/templates/user/achievements.jade index 34ccebd8a..c5a7c2f4e 100644 --- a/app/templates/user/achievements.jade +++ b/app/templates/user/achievements.jade @@ -20,7 +20,6 @@ block append content - var imgURL = achievement.getLockedImageURL(); else - var imgURL = achievement.getImageURL(); - - console.log(locked); .col-lg-4.col-xs-12 include ../achievement_notify else if activeLayout === 'table' @@ -38,7 +37,7 @@ block append content tr td= achievement.get('name') td= achievement.get('description') - td= moment().format("MMMM Do YY", earnedAchievement.get('changed')) + td= moment().format("MMMM Do YYYY", earnedAchievement.get('changed')) if achievement.isRepeatable() td= earnedAchievement.get('achievedAmount') else diff --git a/app/templates/user/home.jade b/app/templates/user/home.jade index e32e6dc32..e9aedd463 100644 --- a/app/templates/user/home.jade +++ b/app/templates/user/home.jade @@ -124,7 +124,7 @@ block append content each achievement in earnedAchievements.models tr td= achievement.get('achievementName') - td= moment().format("MMMM Do YY", achievement.get('changed')) + td= moment().format("MMMM Do YYYY", achievement.get('changed')) if achievement.get('achievedAmount') td= achievement.get('achievedAmount') else diff --git a/app/views/modal/NewModelModal.coffee b/app/views/modal/NewModelModal.coffee index 9edd7c5f7..0f7a33a10 100644 --- a/app/views/modal/NewModelModal.coffee +++ b/app/views/modal/NewModelModal.coffee @@ -34,7 +34,6 @@ module.exports = class NewModelModal extends ModalView model onModelSubmitted: (e) -> - console.debug 'on model submitted' e.preventDefault() model = @makeNewModel() res = model.save() diff --git a/app/views/user/MainUserView.coffee b/app/views/user/MainUserView.coffee index cd70bb452..cf0913913 100644 --- a/app/views/user/MainUserView.coffee +++ b/app/views/user/MainUserView.coffee @@ -22,7 +22,6 @@ module.exports = class MainUserView extends UserView getRenderData: -> context = super() if @levelSessions and @levelSessions.loaded - console.debug 'yep sessions loaded' singlePlayerSessions = [] multiPlayerSessions = [] languageCounts = {} @@ -42,18 +41,14 @@ module.exports = class MainUserView extends UserView context.multiPlayerSessions = multiPlayerSessions context.favoriteLanguage = favoriteLanguage if @earnedAchievements and @earnedAchievements.loaded - console.debug 'earned achievements loaded' context.earnedAchievements = @earnedAchievements context onLoaded: -> - console.debug @earnedAchievements - console.debug @earnedAchievements?.loaded - if @user.loaded and not @earnedAchievements + if @user.loaded and not (@earnedAchievements or @levelSessions) @supermodel.resetProgress() - #@levelSessions = new LevelSessionsCollection @user.getSlugOrID() + @levelSessions = new LevelSessionsCollection @user.getSlugOrID() @earnedAchievements = new EarnedAchievementCollection @user.getSlugOrID() - #@supermodel.loadCollection @levelSessions, 'levelSessions' + @supermodel.loadCollection @levelSessions, 'levelSessions' @supermodel.loadCollection @earnedAchievements, 'earnedAchievements' - super() diff --git a/server/plugins/achievements.coffee b/server/plugins/achievements.coffee index fd1e7af7d..23b1aba56 100644 --- a/server/plugins/achievements.coffee +++ b/server/plugins/achievements.coffee @@ -38,9 +38,9 @@ AchievablePlugin = (schema, options) -> isRepeatable = achievement.get('proportionalTo')? alreadyAchieved = if isNew then false else LocalMongo.matchesQuery originalDocObj, query newlyAchieved = LocalMongo.matchesQuery(docObj, query) - log.debug 'isRepeatable: ' + isRepeatable - log.debug 'alreadyAchieved: ' + alreadyAchieved - log.debug 'newlyAchieved: ' + newlyAchieved + #log.debug 'isRepeatable: ' + isRepeatable + #log.debug 'alreadyAchieved: ' + alreadyAchieved + #log.debug 'newlyAchieved: ' + newlyAchieved userObjectID = doc.get(achievement.get('userField')) userID = if _.isObject userObjectID then userObjectID.toHexString() else userObjectID # Standardize! Use strings, not ObjectId's @@ -59,7 +59,7 @@ AchievablePlugin = (schema, options) -> log.error err if err? if isRepeatable - log.debug 'Upserting repeatable achievement called \'' + (achievement.get 'name') + '\' for ' + userID + #log.debug 'Upserting repeatable achievement called \'' + (achievement.get 'name') + '\' for ' + userID proportionalTo = achievement.get 'proportionalTo' originalAmount = if originalDocObj then util.getByPath(originalDocObj, proportionalTo) or 0 else 0 newAmount = docObj[proportionalTo] @@ -74,11 +74,11 @@ AchievablePlugin = (schema, options) -> return log.debug err if err? earnedPoints = earned.earnedPoints - log.debug earnedPoints + #log.debug earnedPoints wrapUp() else # not alreadyAchieved - log.debug 'Creating a new earned achievement called \'' + (achievement.get 'name') + '\' for ' + userID + #log.debug 'Creating a new earned achievement called \'' + (achievement.get 'name') + '\' for ' + userID earned.earnedPoints = worth (new EarnedAchievement(earned)).save (err, doc) -> return log.error err if err?