Skip to content

Commit

Permalink
Merge pull request #64 from readingdancer/Family-Meals
Browse files Browse the repository at this point in the history
Adding support for Family Meals.
  • Loading branch information
readingdancer authored Mar 31, 2020
2 parents 79900fd + 1ffe5ad commit 4616c94
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 4 deletions.
8 changes: 7 additions & 1 deletion covid-19-support/src/App.vue
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,13 @@ export default {
filteredMarkers() {
if (this.entries == null) return null
const markers = this.entries.filter((c) => c.gsx$resource.$t === this.need && c.gsx$status.$t === 'active')
var markers
if (this.need == 'family') {
markers = this.entries.filter((c) => c.gsx$familymeal.$t == 1 && c.gsx$status.$t === 'active')
} else {
markers = this.entries.filter((c) => c.gsx$resource.$t === this.need && c.gsx$status.$t === 'active')
}
const dayFilters = ['sun', 'mon', 'tues', 'wed', 'thr', 'fri', 'sat'].map((attr) => `gsx$${attr}`)
const dayFilter = dayFilters[this.day]
Expand Down
8 changes: 7 additions & 1 deletion covid-19-support/src/components/Highlights.vue
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,9 @@ export default {
countPayOnline() {
return countBoolean(this.filteredMarkers, 'payonline')
},
countMustPreOrder() {
return countBoolean(this.filteredMarkers, 'mustpreorder')
},
countDiscountMedical() {
return countBoolean(this.filteredMarkers, 'discountmedical')
},
Expand Down Expand Up @@ -121,14 +124,17 @@ export default {
freeGroceryValueBox() {
return this.buildBoxValue('freegrocery', 'fa-shopping-basket', this.countGroceries, true)
},
mustPreOrderValueBox() {
return this.buildBoxValue('mustpreorder', 'fa-phone', this.countMustPreOrder, true)
},
valueBoxes() {
switch (this.need) {
case 'grocery':
return [this.orderOnlineValueBox, this.curbsidePickupValueBox, this.deliveryValueBox, this.seniorShoppingValueBox]
case 'restaurant':
return [this.orderOnlineValueBox, this.curbsidePickupValueBox, this.medicalDiscountsValueBox, this.deliveryValueBox]
case 'family': // Family Meal Kits
return [this.orderOnlineValueBox, this.curbsidePickupValueBox, this.deliveryValueBox, this.medicalDiscountsValueBox]
return [this.orderOnlineValueBox, this.curbsidePickupValueBox, this.deliveryValueBox, this.mustPreOrderValueBox]
case 'farm': // Farms
return [this.curbsidePickupValueBox, this.onFarmPickupValueBox, this.farmersMarketValueBox, this.orderOnlineValueBox]
case 'meal': // Free Meals
Expand Down
1 change: 1 addition & 0 deletions covid-19-support/src/components/SearchFilter.vue
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ export default {
{ value: 'none', text: this.$tc('label.selectacategory', 1) },
{ value: 'restaurant', text: this.$tc('category.restaurant', 2) },
{ value: 'meal', text: this.$tc('category.meal', 2) },
{ value: 'family', text: this.$tc('category.family', 2) },
{ value: 'farm', text: this.$tc('category.farm', 2) },
{ value: 'grocery', text: this.$tc('category.grocery', 2) },
{ value: 'pharmacy', text: this.$tc('category.pharmacy', 1) },
Expand Down
6 changes: 4 additions & 2 deletions covid-19-support/src/locales/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@
"petsupplies": "Pet Supplies",
"pharmacy": "Pharmacy|Pharmacies",
"restaurant": "Restaurant|Restaurants",
"school": "School meal|School meals"
"school": "School meal|School meals",
"family": "Prepared family meal|Prepared family meals"
},
"dayofweek": {
"friday": "Friday",
Expand Down Expand Up @@ -35,7 +36,8 @@
"seniorshopping": "Senior shopping hours",
"selectacategory": "Select a category...",
"farmersmarket": "Farmers Market|Farmers Markets",
"onfarmpickup": "On-farm pick-up"
"onfarmpickup": "On-farm pick-up",
"mustpreorder": "Must pre order"
},
"sidebar": {
"what-do-you-need": "What do you need?",
Expand Down

0 comments on commit 4616c94

Please sign in to comment.