From 1675bb26b2c9151f7ef8c5c8a2f675d5f42a0e0f Mon Sep 17 00:00:00 2001 From: thehindenburg Date: Fri, 19 Dec 2014 07:47:28 -0800 Subject: [PATCH 01/12] change link in gala page to gala wiki --- views/options/inventory/inventory.jade | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/views/options/inventory/inventory.jade b/views/options/inventory/inventory.jade index da48ed04fc..d5d254c2a3 100644 --- a/views/options/inventory/inventory.jade +++ b/views/options/inventory/inventory.jade @@ -29,7 +29,7 @@ script(type='text/ng-template', id='partials/options.inventory.seasonalshop.html .arrow h3.popover-title!=env.t('seasonalShopClosedTitle', {linkStart:"", linkEnd: ""}) .popover-content - p!=env.t('seasonalShopClosedText', {linkStart: "", linkEnd: ""}) + p!=env.t('seasonalShopClosedText', {linkStart: "", linkEnd: ""}) script(type='text/ng-template', id='partials/options.inventory.timetravelers.html') .container-fluid From a07863641697f7db072715844247acd35c040546 Mon Sep 17 00:00:00 2001 From: Blade Barringer Date: Fri, 19 Dec 2014 10:43:15 -0600 Subject: [PATCH 02/12] Fixed get members so it can be used on static/api page --- src/routes/apiv2.coffee | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/routes/apiv2.coffee b/src/routes/apiv2.coffee index 415577d565..408fd3f73f 100644 --- a/src/routes/apiv2.coffee +++ b/src/routes/apiv2.coffee @@ -580,8 +580,12 @@ module.exports = (swagger, v2) -> # --------------------------------- # Members # --------------------------------- - "/members/{uuid}": - spec:{} + "/members/{uuid}:GET": + spec: + path: '/members/{uuid}' + description: "Get a member." + parameters: [path('uuid','Member ID','string')] + middleware: [auth.auth, i18n.getUserLanguage] action: members.getMember "/members/{uuid}/message": spec: From d358236f42fa3fb87d040feee9fe92177ba3f3ca Mon Sep 17 00:00:00 2001 From: Blade Barringer Date: Fri, 19 Dec 2014 10:44:55 -0600 Subject: [PATCH 03/12] Corrected example for show private message so it would result in a valid call --- src/routes/apiv2.coffee | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/routes/apiv2.coffee b/src/routes/apiv2.coffee index 408fd3f73f..7b1ae522a0 100644 --- a/src/routes/apiv2.coffee +++ b/src/routes/apiv2.coffee @@ -593,7 +593,7 @@ module.exports = (swagger, v2) -> description: 'Send a private message to a member' parameters: [ path 'uuid', 'The UUID of the member to message', 'string' - body '', '{message: "The private message to send"}', 'object' + body '', '{"message": "The private message to send"}', 'object' ] middleware: [auth.auth] action: members.sendPrivateMessage From be37e88dc33f26847efa2290565d4895978ab2e0 Mon Sep 17 00:00:00 2001 From: Blade Barringer Date: Fri, 19 Dec 2014 11:05:24 -0600 Subject: [PATCH 04/12] Corrected example for send gift to be correct --- src/routes/apiv2.coffee | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/routes/apiv2.coffee b/src/routes/apiv2.coffee index 7b1ae522a0..40b0adf15d 100644 --- a/src/routes/apiv2.coffee +++ b/src/routes/apiv2.coffee @@ -612,7 +612,7 @@ module.exports = (swagger, v2) -> description: 'Send a gift to a member' parameters: [ path 'uuid', 'The UUID of the member', 'string' - body '', '{gems:{amount:Number, fromBalance:Boolean}, subscription:{months:Number}}', 'object' + body '', '{"type": "gems or subscription", "gems":{"amount":Number, "fromBalance":Boolean}, "subscription":{"months":Number}}', 'object' ] middleware: [auth.auth] action: members.sendGift From 7c0b25d58a6c5b1b585f42c9da147bb949ac62d8 Mon Sep 17 00:00:00 2001 From: Matteo Pagliazzi Date: Fri, 19 Dec 2014 19:46:05 +0100 Subject: [PATCH 05/12] pass base_url to emails as variable --- src/utils.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/utils.js b/src/utils.js index ba8dd47f95..f37d7cd9d0 100644 --- a/src/utils.js +++ b/src/utils.js @@ -35,6 +35,8 @@ function getMailingInfo(user) { } module.exports.txnEmail = function(mailingInfo, emailType, variables){ + var variables = [{name: 'BASE_URL', content: nconf.get('BASE_URL')}].concat(variables || []); + if (mailingInfo._id) mailingInfo = getMailingInfo(mailingInfo); if (!mailingInfo.email) return; request({ From 739d8885a36057bbf2198e350d507e92f87503d4 Mon Sep 17 00:00:00 2001 From: Matteo Pagliazzi Date: Fri, 19 Dec 2014 19:59:12 +0100 Subject: [PATCH 06/12] fix(emails): remove unused variable --- src/controllers/auth.js | 1 - 1 file changed, 1 deletion(-) diff --git a/src/controllers/auth.js b/src/controllers/auth.js index 67ddbc08f5..3a00eda7f0 100644 --- a/src/controllers/auth.js +++ b/src/controllers/auth.js @@ -207,7 +207,6 @@ api.resetPassword = function(req, res, next){ user.auth.local.hashed_password = hashed_password; utils.txnEmail(user, 'reset-password', [ {name: "NEW_PASSWORD", content: newPassword}, - {name: "URL", content: nconf.get('BASE_URL')}, {name: "USERNAME", content: user.auth.local.username} ]); user.save(function(err){ From 95951a470618c242c18b9f87177d754a11364f15 Mon Sep 17 00:00:00 2001 From: Blade Barringer Date: Fri, 19 Dec 2014 19:41:22 -0600 Subject: [PATCH 07/12] Updated moment calls to use number, period to fix the deprecation error --- test/api.mocha.coffee | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/test/api.mocha.coffee b/test/api.mocha.coffee index 28b2a97c3d..70521f91a1 100644 --- a/test/api.mocha.coffee +++ b/test/api.mocha.coffee @@ -141,7 +141,7 @@ describe "API", -> id: res.body.todos[0].id body: - dateCompleted: moment().subtract("days", 4) + dateCompleted: moment().subtract(4, "days") } { op: "updateTask" @@ -149,7 +149,7 @@ describe "API", -> id: res.body.todos[1].id body: - dateCompleted: moment().subtract("days", 4) + dateCompleted: moment().subtract(4, "days") } ]).end (res) -> expect(_.size(res.body.todos)).to.be 4 @@ -460,7 +460,7 @@ describe "API", -> { op: "update" body: - lastCron: moment().subtract("days", 1) + lastCron: moment().subtract(1, "days") } ]).end (res) -> expect(res.body.party.quest.progress.up).to.be.above up @@ -532,7 +532,7 @@ describe "API", -> { op: "update" body: - lastCron: moment().subtract("days", 1) + lastCron: moment().subtract(1, "days") } ]).end -> cb() @@ -608,7 +608,7 @@ describe "API", -> it "Handles unsubscription", (done) -> cron = -> - user.lastCron = moment().subtract("d", 1) + user.lastCron = moment().subtract(1, "d") user.fns.cron() expect(user.purchased.plan.customerId).to.not.be.ok() @@ -624,7 +624,7 @@ describe "API", -> cron() expect(user.purchased.plan.customerId).to.be.ok() expect(user.purchased.plan.dateTerminated).to.be.ok() - user.purchased.plan.dateTerminated = moment().subtract("d", 2) + user.purchased.plan.dateTerminated = moment().subtract(2, "d") cron() expect(user.purchased.plan.customerId).to.not.be.ok() payments.createSubscription user, From 8b3c6f94bf85f99620765e959885c77d08b5809d Mon Sep 17 00:00:00 2001 From: Matteo Pagliazzi Date: Sat, 20 Dec 2014 16:20:40 +0100 Subject: [PATCH 08/12] fix(loggly): send more infos about cron errors --- src/controllers/user.js | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/controllers/user.js b/src/controllers/user.js index 7bf164cd73..a7f80bf5f7 100644 --- a/src/controllers/user.js +++ b/src/controllers/user.js @@ -284,7 +284,13 @@ api.cron = function(req, res, next) { User.findById(user._id, cb); } ], function(err, saved) { - if(err) logging.loggly({error: "Cron caught", stack: err.stack || err}); + if(err) logging.loggly({ + error: "Cron caught", + stack: (err.stack || err.message || err), + body: req.body, headers: req.header, + auth: (req.headers['x-api-user'] + ' | ' + req.headers['x-api-key']), + originalUrl: req.originalUrl + }); res.locals.user = saved; next(err,saved); user = progress = quest = null; From 492260d74ae4c435a191bf0df1b26aed344387af Mon Sep 17 00:00:00 2001 From: Tyler Renelle Date: Sat, 20 Dec 2014 17:58:00 -0700 Subject: [PATCH 09/12] refactor(coupons): coupons cleanup using async.auto --- src/models/coupon.js | 44 ++++++++++++++++++++------------------------ 1 file changed, 20 insertions(+), 24 deletions(-) diff --git a/src/models/coupon.js b/src/models/coupon.js index c5122b6ba7..497b45697f 100644 --- a/src/models/coupon.js +++ b/src/models/coupon.js @@ -18,38 +18,34 @@ CouponSchema.statics.generate = function(event, count, callback) { } CouponSchema.statics.apply = function(user, code, next){ - var _coupon,_user; - async.waterfall([ - function(cb) { + async.auto({ + get_coupon: function (cb) { mongoose.model('Coupon').findById(cc.validate(code), cb); }, - function(coupon, cb) { - _coupon = coupon; - if (!coupon) return cb("Invalid coupon code"); - if (coupon.user) return cb("Coupon already used"); - switch (coupon.event) { + apply_coupon: ['get_coupon', function (cb, results) { + if (!results.get_coupon) return cb("Invalid coupon code"); + if (results.get_coupon.user) return cb("Coupon already used"); + switch (results.get_coupon.event) { case 'wondercon': - user.items.gear.owned.eyewear_special_wondercon_red = true; - user.items.gear.owned.eyewear_special_wondercon_black = true; - user.items.gear.owned.back_special_wondercon_black = true; - user.items.gear.owned.back_special_wondercon_red = true; - user.items.gear.owned.body_special_wondercon_red = true; - user.items.gear.owned.body_special_wondercon_black = true; - user.items.gear.owned.body_special_wondercon_gold = true; + user.items.gear.owned.eyewear_special_wondercon_red = true; + user.items.gear.owned.eyewear_special_wondercon_black = true; + user.items.gear.owned.back_special_wondercon_black = true; + user.items.gear.owned.back_special_wondercon_red = true; + user.items.gear.owned.body_special_wondercon_red = true; + user.items.gear.owned.body_special_wondercon_black = true; + user.items.gear.owned.body_special_wondercon_gold = true; user.extra = {signupEvent: 'wondercon'}; user.save(cb); break; } - }, - function(user, count, cb){ - _user = user; - _coupon.user = user._id; - _coupon.save(cb); - } - ], function(err){ + }], + expire_coupon: ['apply_coupon', function (cb, results) { + results.get_coupon.user = user._id; + results.get_coupon.save(cb); + }] + }, function(err, results){ if (err) return next(err); - next(null,_user); - _coupon = _user = null; + next(null,results.apply_coupon[0]); }) } From bb89a103560147de71811a6630f4cb781c40bcdf Mon Sep 17 00:00:00 2001 From: Sabe Jones Date: Sun, 21 Dec 2014 13:58:47 -0600 Subject: [PATCH 10/12] feat(event): Wintery Hair Colors --- views/options/profile.jade | 1 + 1 file changed, 1 insertion(+) diff --git a/views/options/profile.jade b/views/options/profile.jade index cf8fef0e25..715b32072f 100644 --- a/views/options/profile.jade +++ b/views/options/profile.jade @@ -63,6 +63,7 @@ mixin customizeProfile(mobile) button(type='button', ng-if='user.purchased.hair.color.#{color}', class='customize-option hair hair_bangs_1_#{color}', ng-click='unlock("hair.color.#{color}")') +buyPref('hair.color', ['rainbow','yellow','green','purple','blue','TRUred'], 'rainbowColors') +buyPref('hair.color', ['candycorn','ghostwhite','halloween','midnight','pumpkin','zombie'], 'hauntedColors', 'disabled') + +buyPref('hair.color', ['aurora','festive','hollygreen','peppermint','snowy','winterstar'], 'winteryColors') li.customize-menu menu(label=env.t('bodyHair')) From 833ff90a59eaf948c0dc0bd30d5fd7ea67bec444 Mon Sep 17 00:00:00 2001 From: Sabe Jones Date: Sun, 21 Dec 2014 15:41:32 -0600 Subject: [PATCH 11/12] chore(news): Wonderland Bailey 1 --- views/shared/new-stuff.jade | 52 +++++++++++++++++++++++++++---------- 1 file changed, 38 insertions(+), 14 deletions(-) diff --git a/views/shared/new-stuff.jade b/views/shared/new-stuff.jade index 8162251f90..76188b0e7b 100644 --- a/views/shared/new-stuff.jade +++ b/views/shared/new-stuff.jade @@ -1,28 +1,52 @@ -h5 ANDROID APP UPDATE, SEASONAL SHOP, AND WINTER PLOT-LINE CONTINUES +h5 WINTER WONDERLAND BEGINS! Winter Class Outfits, Wintery Hair Colors, and NPC Decorations! tr td - h5 Android App Update: December Art and Buying Gems! - p The December backgrounds and penguin pet quest are now visible in the Android mobile app! Also, we’ve made it possible to buy gems directly from the app. Now you don’t have to switch to the website to stock up! - p You can get the Android app here! We will announce when the iOS app is available as well. - p.small.muted by negue + h5 Winter Wonderland Begins! + p Winter has arrived, and the snow is gently drifting down over Habit City. Come celebrate with us! tr td - h5 Seasonal Shop Tab - .seasonalshop_closed.pull-right - p Looks like a new tab has appeared under Inventory - the Seasonal Shop! It's still closed, but I've heard a rumor that it will open soon... - p.small.muted by SabreCat and Lemoness + h5 Winter Class Outfits + .promo_winterclasses2015.pull-right + p From now until January 31st, limited edition outfits are available in the Rewards column. Depending on your class, you can be a Soothing Skater, Mage of the North, Gingerbread Warrior, or Icicle Drake! You'd better get productive to earn enough gold before they disappear. Good luck! + p.small.muted by Lemoness tr td - h5 Winter Plot-Line Continues - p Lemoness bursts into the Tavern, shaking icicles off her hat. "The Stoïkalm Steppes are completely abandoned!" she says, gulping the cup of tea that Daniel the Barkeep offers her. "No people milling about, no mounts and pets playing in the snow - and when I tried to fly closer, my dragon spooked and refused to land!" - p A cloaked figure in the corner steps into the fire light - SabreCat, a powerful adventurer from the north. "The Stoïkalm Steppes are the last home of many animals that have long since gone extinct elsewhere," he says. "The stoic Stoïkalmers would never flee their lands unless something was threatening their pets and mounts!" - p He turns to Lemoness. "I can speak the language of the northern beasts. I'll try to contact the roaming sabertooth prides to see if they know what happened." As he lopes off into the distance, a cold wind begins to blow. - p.muted Missed the first part of the Winter Plot-Line? Read it here. + h5 Wintery Hair Colors + .promo_winteryhair.pull-right + p The Seasonal Edition Wintery Hair Colors are now available for purchase in the avatar customizations page! Now you can dye your avatar's hair Holly Green, Winter Star, Snowy, Peppermint, Aurora, or Festive. + p Seasonal Edition items recur unchanged every year, but they are only available to purchase during a short period of time. This is different from Limited Edition Items, which only recur if something is changed, such as the art or the price. These hair colors may remind some of you of the Holiday Hair Colors that were available last winter. The Holiday Hair Colors have been Retired in favor of the similar Seasonal Edition Wintery Hair Colors. Read more about the difference between Seasonal and Limited Edition items here! + p.small.muted by Lemoness, crystalphoenix, and mariahm + tr + td + h5 NPC Decorations + .npc_alex.pull-right + p Looks like the NPCs are really getting in to the cheery winter mood around the site. Who wouldn't? After all, there's plenty more to come! + p.small.muted by Lemoness hr a(href='/static/old-news', target='_blank') Read older news mixin oldNews + h5 12/17/2014 - Android App Update, Seasonal Shop, and Winter Plot-Line Continues + tr + td + h5 Android App Update: December Art and Buying Gems! + p The December backgrounds and penguin pet quest are now visible in the Android mobile app! Also, we’ve made it possible to buy gems directly from the app. Now you don’t have to switch to the website to stock up! + p You can get the Android app here! We will announce when the iOS app is available as well. + p.small.muted by negue + tr + td + h5 Seasonal Shop Tab + .seasonalshop_closed.pull-right + p Looks like a new tab has appeared under Inventory - the Seasonal Shop! It's still closed, but I've heard a rumor that it will open soon... + p.small.muted by SabreCat and Lemoness + tr + td + h5 Winter Plot-Line Continues + p Lemoness bursts into the Tavern, shaking icicles off her hat. "The Stoïkalm Steppes are completely abandoned!" she says, gulping the cup of tea that Daniel the Barkeep offers her. "No people milling about, no mounts and pets playing in the snow - and when I tried to fly closer, my dragon spooked and refused to land!" + p A cloaked figure in the corner steps into the fire light - SabreCat, a powerful adventurer from the north. "The Stoïkalm Steppes are the last home of many animals that have long since gone extinct elsewhere," he says. "The stoic Stoïkalmers would never flee their lands unless something was threatening their pets and mounts!" + p He turns to Lemoness. "I can speak the language of the northern beasts. I'll try to contact the roaming sabertooth prides to see if they know what happened." As he lopes off into the distance, a cold wind begins to blow. + p.muted Missed the first part of the Winter Plot-Line? Read it here. h5 12/9/2014 - Penguin Pet Quest and Winter Plot-Line tr td From 07fbcbcb08f55161d33438396ecc307f6bbc98ce Mon Sep 17 00:00:00 2001 From: Sabe Jones Date: Sun, 21 Dec 2014 20:53:03 -0600 Subject: [PATCH 12/12] Revert "fix(phantom): downgrade to node 0.10.22 due to CERT error, see" This reverts commit dc18569e78201dd5ee736483721a78ca3a9eb0e9. --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index b6b97ba199..6f14a60e51 100644 --- a/package.json +++ b/package.json @@ -63,7 +63,7 @@ "www.habitrpg.com" ], "engines": { - "node": "0.10.22", + "node": "0.10.x", "npm": "1.2.x" }, "scripts": {