refactor(content): concatenate notes

This commit is contained in:
Sabe Jones
2016-08-09 23:19:53 +00:00
parent 051763bc49
commit 72f1114d85
4 changed files with 8 additions and 13 deletions

View File

@@ -518,25 +518,25 @@ api.premiumHatchingPotions = {
value: 2, value: 2,
text: t('hatchingPotionSpooky'), text: t('hatchingPotionSpooky'),
limited: true, limited: true,
season: 'fall', _season: 'fall',
}, },
Peppermint: { Peppermint: {
value: 2, value: 2,
text: t('hatchingPotionPeppermint'), text: t('hatchingPotionPeppermint'),
limited: true, limited: true,
season: 'winter', _season: 'winter',
}, },
Floral: { Floral: {
value: 2, value: 2,
text: t('hatchingPotionFloral'), text: t('hatchingPotionFloral'),
limited: true, limited: true,
season: 'spring', _season: 'spring',
}, },
Thunderstorm: { Thunderstorm: {
value: 2, value: 2,
text: t('hatchingPotionThunderstorm'), text: t('hatchingPotionThunderstorm'),
limited: true, limited: true,
season: 'summer', _season: 'summer',
canBuy: (function() { canBuy: (function() {
return true; return true;
}), }),
@@ -565,7 +565,7 @@ _.each(api.premiumHatchingPotions, function(pot, key) {
notes: t('hatchingPotionNotes', { notes: t('hatchingPotionNotes', {
potText: pot.text potText: pot.text
}), }),
addlNotes: t(`${pot.season}EventAvailability`), _addlNotes: t(`${pot._season}EventAvailability`),
premium: true, premium: true,
limited: false, limited: false,
canBuy: (function() { canBuy: (function() {

View File

@@ -70,8 +70,7 @@ shops.getMarketCategories = function getMarket (user, language) {
return { return {
key: premiumHatchingPotion.key, key: premiumHatchingPotion.key,
text: premiumHatchingPotion.text(language), text: premiumHatchingPotion.text(language),
notes: premiumHatchingPotion.notes(language), notes: `${premiumHatchingPotion.notes(language)} ${premiumHatchingPotion._addlNotes(language)}`,
addlNotes: premiumHatchingPotion.addlNotes(language),
class: `Pet_HatchingPotion_${premiumHatchingPotion.key}`, class: `Pet_HatchingPotion_${premiumHatchingPotion.key}`,
value: premiumHatchingPotion.value, value: premiumHatchingPotion.value,
locked: false, locked: false,

View File

@@ -22,11 +22,7 @@ describe('shops', () => {
it('items contain required fields', () => { it('items contain required fields', () => {
_.each(shopCategories, (category) => { _.each(shopCategories, (category) => {
_.each(category.items, (item) => { _.each(category.items, (item) => {
if (item.addlNotes) {
expect(item).to.have.all.keys(['key', 'text', 'notes', 'addlNotes', 'value', 'currency', 'locked', 'purchaseType', 'class']);
} else {
expect(item).to.have.all.keys(['key', 'text', 'notes', 'value', 'currency', 'locked', 'purchaseType', 'class']); expect(item).to.have.all.keys(['key', 'text', 'notes', 'value', 'currency', 'locked', 'purchaseType', 'class']);
}
}); });
}); });
}); });

View File

@@ -116,7 +116,7 @@
div(ng-repeat='item in category.items') div(ng-repeat='item in category.items')
button.customize-option(class='{{item.class}}', button.customize-option(class='{{item.class}}',
popover='{{item.notes}} {{item.addlNotes}}', popover-append-to-body='true', popover='{{item.notes}}', popover-append-to-body='true',
popover-title!='{{item.text}}', popover-title!='{{item.text}}',
popover-trigger='mouseenter', popover-placement='top', popover-trigger='mouseenter', popover-placement='top',
ng-click='purchase(category.identifier, item)') ng-click='purchase(category.identifier, item)')