From 9cfa27f08948a2b6b8773d6fa0d4d1bf0c36f9df Mon Sep 17 00:00:00 2001 From: Sabe Jones Date: Tue, 10 Mar 2015 18:39:00 -0500 Subject: [PATCH 1/3] feat(surveys): Survey achievement Updates the "Helped Habit Grow" achievement to be stackable. Also includes miscellaneous Bailey announcements for 3/10. --- common/locales/en/contrib.json | 5 ++- migrations/20150310_survey_achievements.js | 5 +++ website/src/models/user.js | 3 +- website/views/shared/new-stuff.jade | 38 ++++++++++++------- .../views/shared/profiles/achievements.jade | 19 ++++++---- 5 files changed, 48 insertions(+), 22 deletions(-) create mode 100644 migrations/20150310_survey_achievements.js diff --git a/common/locales/en/contrib.json b/common/locales/en/contrib.json index 6598c9b9e9..263a362a01 100644 --- a/common/locales/en/contrib.json +++ b/common/locales/en/contrib.json @@ -57,5 +57,8 @@ "whyAds": "Why Ads?", "whyAdsContent1": "Habit is an open source project, and can use all the help it can get - consider this a donation to the contributors. You also get 20 Gems from the purchase, which you can use to buy special items.", "whyAdsContent2": "'Hey, I backed the Kickstarter!' - follow", - "whyAdsContent3": "these instructions" + "whyAdsContent3": "these instructions", + "surveysSingle": "Helped HabitRPG grow by filling out a survey. The latest survey can be found here:", + "surveysMultiple": "Helped HabitRPG grow by filling out <%= surveys %> surveys. The latest survey can be found here:", + "currentSurvey": "Current Survey" } diff --git a/migrations/20150310_survey_achievements.js b/migrations/20150310_survey_achievements.js new file mode 100644 index 0000000000..9678b6c3c4 --- /dev/null +++ b/migrations/20150310_survey_achievements.js @@ -0,0 +1,5 @@ +db.users.update( + {'achievements.helpedHabit':true}, + {$set:{'achievements.habitSurveys':1}}, + {multi:1} +) \ No newline at end of file diff --git a/website/src/models/user.js b/website/src/models/user.js index 5329fe0c16..d07b9e5bc5 100644 --- a/website/src/models/user.js +++ b/website/src/models/user.js @@ -32,7 +32,8 @@ var UserSchema = new Schema({ _v: { type: Number, 'default': 0 }, achievements: { originalUser: Boolean, - helpedHabit: Boolean, + helpedHabit: Boolean, //TODO: Deprecate this. Superseded by habitSurveys + habitSurveys: Number, ultimateGear: Boolean, beastMaster: Boolean, beastMasterCount: Number, diff --git a/website/views/shared/new-stuff.jade b/website/views/shared/new-stuff.jade index 4fa59a4f80..750b105c4d 100644 --- a/website/views/shared/new-stuff.jade +++ b/website/views/shared/new-stuff.jade @@ -1,26 +1,38 @@ -h5 3/3/2015 - MARCH BACKGROUNDS, ANDROID APP NOTIFICATIONS, AND MARCH MYSTERY BOX +h5 3/10/2015 - TESTIMONIALS GUILD AND CHAT EXTENSION hr tr td - h5 March Backgrounds Revealed - p There are three new avatar backgrounds in the Background Shop! Now your avatar can dance in the Spring Rain, admire some Stained Glass, or frolic through the Rolling Hills! - p.small.muted by (in order) Sunstroke, Kiwibot, and Uncommon Criminal + h5 Testimonials Guild + p We're collecting testimonials from users to display on the front page along with pictures of their avatars. If HabitRPG has been helpful to you and you feel comfortable leaving a short testimonial for us, you can post it here. Thanks for all your help! <3 tr td - h5 Android App Notifications - p The Android app can now remind you to log in! Simply go to Settings and select the time that you want the reminder. - p.small.muted by Negue - tr - td - .inventory_present.pull-right - h5 March Mystery Box - p Wow! What could it be? All Habiticans who are subscribed during the month of March will receive the March Mystery Item Set! It will be revealed on the 25th, so keep your eyes peeled. Thanks for supporting the site <3 - p.small.muted by Lemoness + h5 Chat Extension + p Horacious Moreau has made a chat extension for HabitRPG! It creates a chat box for Tavern, parties, and Guilds. :) + br + p The Chat Client is also open-source! You can check out the project here. + p.small.muted by Horacious Moreau hr a(href='/static/old-news', target='_blank') Read older news mixin oldNews + h5 3/3/2015 - MARCH BACKGROUNDS, ANDROID APP NOTIFICATIONS, AND MARCH MYSTERY BOX + tr + td + h5 March Backgrounds Revealed + p There are three new avatar backgrounds in the Background Shop! Now your avatar can dance in the Spring Rain, admire some Stained Glass, or frolic through the Rolling Hills! + p.small.muted by (in order) Sunstroke, Kiwibot, and Uncommon Criminal + tr + td + h5 Android App Notifications + p The Android app can now remind you to log in! Simply go to Settings and select the time that you want the reminder. + p.small.muted by Negue + tr + td + .inventory_present.pull-right + h5 March Mystery Box + p Wow! What could it be? All Habiticans who are subscribed during the month of March will receive the March Mystery Item Set! It will be revealed on the 25th, so keep your eyes peeled. Thanks for supporting the site <3 + p.small.muted by Lemoness h5 2/24/2015 - FEBRUARY SUBSCRIBER ITEM AND ADD MULTIPLE TASKS! tr td diff --git a/website/views/shared/profiles/achievements.jade b/website/views/shared/profiles/achievements.jade index b83385032f..da40e7b227 100644 --- a/website/views/shared/profiles/achievements.jade +++ b/website/views/shared/profiles/achievements.jade @@ -120,13 +120,18 @@ div(ng-if='profile.achievements.rebirths') | {{profile.achievements.rebirthLevel}}. hr -div(ng-if='::profile.achievements.helpedHabit') - .achievement.achievement-tree - h5=env.t('helped') - small - =env.t('helpedText1') - |  - +aLink('http://community.habitrpg.com/node/290', env.t('helpedText2')) +div(ng-if='::profile.achievements.habitSurveys || user._id == profile._id') + .achievement.achievement-tree(ng-show='profile.achievements.habitSurveys') + div(ng-class='{muted: !profile.achievements.habitSurveys}') + h5=env.t('helped') + small(ng-if='profile.achievements.habitSurveys > 1') + =env.t('surveysMultiple', {surveys: "{{profile.achievements.habitSurveys"}) + |  + +aLink('https://www.surveymonkey.com/s/62RXRF3', env.t('currentSurvey')) + small(ng-if='!(profile.achievements.habitSurveys > 1)') + =env.t('surveysSingle') + |   + +aLink('https://www.surveymonkey.com/s/62RXRF3', env.t('currentSurvey')) hr div(ng-if=':: profile.achievements.veteran') From 53df85e01bd83a2c5ce60806334ae86889b29f6a Mon Sep 17 00:00:00 2001 From: Sabe Jones Date: Tue, 10 Mar 2015 18:47:21 -0500 Subject: [PATCH 2/3] fix(surveys): Fix malformed Angular --- website/views/shared/profiles/achievements.jade | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/website/views/shared/profiles/achievements.jade b/website/views/shared/profiles/achievements.jade index da40e7b227..77642444ef 100644 --- a/website/views/shared/profiles/achievements.jade +++ b/website/views/shared/profiles/achievements.jade @@ -125,7 +125,7 @@ div(ng-if='::profile.achievements.habitSurveys || user._id == profile._id') div(ng-class='{muted: !profile.achievements.habitSurveys}') h5=env.t('helped') small(ng-if='profile.achievements.habitSurveys > 1') - =env.t('surveysMultiple', {surveys: "{{profile.achievements.habitSurveys"}) + =env.t('surveysMultiple', {surveys: "{{profile.achievements.habitSurveys}}"}) |  +aLink('https://www.surveymonkey.com/s/62RXRF3', env.t('currentSurvey')) small(ng-if='!(profile.achievements.habitSurveys > 1)') From 3a9e2a512387c6dbdfa028d28df1db493a7d7569 Mon Sep 17 00:00:00 2001 From: Sabe Jones Date: Tue, 10 Mar 2015 19:08:10 -0500 Subject: [PATCH 3/3] fix(surveys): Visibility tweaks --- website/views/shared/new-stuff.jade | 8 +++++- .../views/shared/profiles/achievements.jade | 28 +++++++++---------- 2 files changed, 21 insertions(+), 15 deletions(-) diff --git a/website/views/shared/new-stuff.jade b/website/views/shared/new-stuff.jade index 750b105c4d..2a67b15a76 100644 --- a/website/views/shared/new-stuff.jade +++ b/website/views/shared/new-stuff.jade @@ -1,5 +1,11 @@ -h5 3/10/2015 - TESTIMONIALS GUILD AND CHAT EXTENSION +h5 3/10/2015 - SURVEY, TESTIMONIALS GUILD, AND CHAT EXTENSION hr + tr + td + h5 Survey and Achievement + .achievement.achievement-tree.pull-right + p We're giving out the rare Helped Habit Grow achievement to all users who help us out by completing this 10-question survey! If you already received this badge, taking this new survey will stack your achievement. Thanks for sparing a minute to let us know what you think about HabitRPG! + p.small.muted by sugarfiend and SabreCat tr td h5 Testimonials Guild diff --git a/website/views/shared/profiles/achievements.jade b/website/views/shared/profiles/achievements.jade index 77642444ef..56c5fa3b10 100644 --- a/website/views/shared/profiles/achievements.jade +++ b/website/views/shared/profiles/achievements.jade @@ -14,6 +14,20 @@ if mobile .item.item-divider=env.t('achievements') +div(ng-if='::profile.achievements.habitSurveys || user._id == profile._id') + .achievement.achievement-tree(ng-show='profile.achievements.habitSurveys') + div(ng-class='{muted: !profile.achievements.habitSurveys}') + h5=env.t('helped') + small(ng-if='profile.achievements.habitSurveys > 1') + =env.t('surveysMultiple', {surveys: "{{profile.achievements.habitSurveys}}"}) + |  + +aLink('https://www.surveymonkey.com/s/62RXRF3', env.t('currentSurvey')) + small(ng-if='!(profile.achievements.habitSurveys > 1)') + =env.t('surveysSingle') + |   + +aLink('https://www.surveymonkey.com/s/62RXRF3', env.t('currentSurvey')) + hr + div(ng-if='::profile.backer.npc') .achievement.achievement-helm h5 @@ -120,20 +134,6 @@ div(ng-if='profile.achievements.rebirths') | {{profile.achievements.rebirthLevel}}. hr -div(ng-if='::profile.achievements.habitSurveys || user._id == profile._id') - .achievement.achievement-tree(ng-show='profile.achievements.habitSurveys') - div(ng-class='{muted: !profile.achievements.habitSurveys}') - h5=env.t('helped') - small(ng-if='profile.achievements.habitSurveys > 1') - =env.t('surveysMultiple', {surveys: "{{profile.achievements.habitSurveys}}"}) - |  - +aLink('https://www.surveymonkey.com/s/62RXRF3', env.t('currentSurvey')) - small(ng-if='!(profile.achievements.habitSurveys > 1)') - =env.t('surveysSingle') - |   - +aLink('https://www.surveymonkey.com/s/62RXRF3', env.t('currentSurvey')) - hr - div(ng-if=':: profile.achievements.veteran') .achievement.achievement-cake div(ng-if='::profile.achievements.veteran')