From 610ce048cb49cd003df5456be4843c89f8e1b5e7 Mon Sep 17 00:00:00 2001 From: Blade Barringer Date: Thu, 13 Aug 2015 22:27:14 -0500 Subject: [PATCH] Refactor card achievements --- common/locales/en/generic.json | 8 ++--- common/locales/en/limited.json | 8 ++--- .../views/shared/profiles/achievements.jade | 30 ++++--------------- 3 files changed, 14 insertions(+), 32 deletions(-) diff --git a/common/locales/en/generic.json b/common/locales/en/generic.json index c0600db04d..7bf6b24daf 100644 --- a/common/locales/en/generic.json +++ b/common/locales/en/generic.json @@ -120,8 +120,8 @@ "greeting1": "\"Just saying hello :)\"", "greeting2": "\"`waves frantically`\"", "greeting3": "\"Hey you!\"", - "cheeryChum": "Cheery Chum", - "cheeryChumText": "Hey! Hi! Hello! Sent or received <%= cards %> greeting cards.", + "greetingCardAchievementTitle": "Cheery Chum", + "greetingCardAchievementText": "Hey! Hi! Hello! Sent or received <%= cards %> greeting cards.", "thankyouCard": "Thank-You Card", "thankyouCardExplanation": "You both receive the Greatly Grateful achievement!", "thankyouCardNotes": "Send a Thank-You card to a party member.", @@ -129,6 +129,6 @@ "thankyou1": "\"Thank you, thank you, thank you!\"", "thankyou2": "\"Sending you a thousand thanks.\"", "thankyou3": "\"I'm very grateful - thank you!\"", - "greatlyGrateful": "Greatly Grateful", - "greatlyGratefulText": "Thanks for being thankful! Sent or received <%= cards %> Thank-You cards." + "thankyouCardAchievementTitle": "Greatly Grateful", + "thankyouCardAchievementText": "Thanks for being thankful! Sent or received <%= cards %> Thank-You cards." } diff --git a/common/locales/en/limited.json b/common/locales/en/limited.json index 8ebf0b6151..03219f0041 100644 --- a/common/locales/en/limited.json +++ b/common/locales/en/limited.json @@ -17,8 +17,8 @@ "valentine1": "\"Roses are red\n\nViolets are nice\n\nLet's get together\n\nAnd fight against Vice!\"", "valentine2": "\"Roses are red\n\nThis poem style is old\n\nI hope that you like this\n\n'Cause it cost ten Gold.\"", "valentine3": "\"Roses are red\n\nIce Drakes are blue\n\nNo treasure is better\n\nThan time spent with you!\"", - "adoringFriends": "Adoring Friends", - "adoringFriendsText": "Aww, you and your friend must really care about each other! Sent or received <%= cards %> Valentine's Day cards.", + "valentineCardAchievementTitle": "Adoring Friends", + "valentineCardAchievementText": "Aww, you and your friend must really care about each other! Sent or received <%= cards %> Valentine's Day cards.", "polarBear": "Polar Bear", "turkey": "Turkey", "polarBearPup": "Polar Bear Cub", @@ -39,8 +39,8 @@ "nyeCardExplanation": "For celebrating the new year together, you both receive the \"Auld Acquaintance\" badge!", "nyeCardNotes": "Send a New Year's card to a party member.", "seasonalItems": "Seasonal Items", - "auldAcquaintance": "Auld Acquaintance", - "auldAcquaintanceText": "Happy New Year! Sent or received <%= cards %> New Year's cards.", + "nyeCardAchievementTitle": "Auld Acquaintance", + "nyeCardAchievementText": "Happy New Year! Sent or received <%= cards %> New Year's cards.", "nye0": "\"Happy New Year! May you slay many a bad Habit.\"", "nye1": "\"Happy New Year! May you reap many Rewards.\"", "nye2": "\"Happy New Year! May you earn many a Perfect Day.\"", diff --git a/website/views/shared/profiles/achievements.jade b/website/views/shared/profiles/achievements.jade index 6fa49ba013..976e858fed 100644 --- a/website/views/shared/profiles/achievements.jade +++ b/website/views/shared/profiles/achievements.jade @@ -226,27 +226,9 @@ div(ng-if='::profile.achievements.costumeContest') =env.t('costumeContestText') hr -div(ng-if='::profile.achievements.greeting') - .achievement.achievement-greeting - h5=env.t('cheeryChum') - small=env.t('cheeryChumText', {cards: "{{::profile.achievements.greeting}}"}) - hr - -div(ng-if='::profile.achievements.thankyou') - .achievement.achievement-thankyou - h5=env.t('greatlyGrateful') - small=env.t('greatlyGratefulText', {cards: "{{::profile.achievements.thankyou}}"}) - hr - -div(ng-if='::profile.achievements.nye') - .achievement.achievement-nye - h5=env.t('auldAcquaintance') - small - =env.t('auldAcquaintanceText', {cards: "{{::profile.achievements.nye}}"}) - hr - -div(ng-if='::profile.achievements.valentine') - .achievement.achievement-valentine - h5=env.t('adoringFriends') - small - =env.t('adoringFriendsText', {cards: "{{::profile.achievements.valentine}}"}) +each card in ['greeting', 'thankyou', 'nye', 'valentine'] + div(ng-if='::profile.achievements.#{card}') + div(class='achievement.achievement-#{card}') + h5=env.t('#{card}CardAchievementTitle') + small=env.t('#{card}CardAchievementText', {cards: "{{::profile.achievements.#{card}}}"}) + hr