Skip to content

Commit

Permalink
feat(all): add mocktails (#193)
Browse files Browse the repository at this point in the history
  • Loading branch information
anton-gustafsson authored Dec 18, 2022
1 parent 9311339 commit 3252176
Show file tree
Hide file tree
Showing 32 changed files with 290 additions and 76 deletions.
4 changes: 2 additions & 2 deletions android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ android {
applicationId "com.moimob.drinkable"
minSdkVersion rootProject.ext.minSdkVersion
targetSdkVersion rootProject.ext.targetSdkVersion
versionCode 11601
versionName "1.16.1"
versionCode 11700
versionName "1.17.0"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
aaptOptions {
// Files and dirs to omit from the packaged assets dir, modified to accommodate modern web apps.
Expand Down
4 changes: 4 additions & 0 deletions fastlane/metadata/android/en-US/changelogs/11700.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
• Added cocktail ingredient substitutes. For example Triple sec could be substituted with Cointreau
• Added Mocktails. It's currently hidden by default but there is a setting to activate it
• Updated Cocktail list item design
• Fixed missing translations
14 changes: 11 additions & 3 deletions fastlane/metadata/android/en-US/full_description.txt
Original file line number Diff line number Diff line change
@@ -1,11 +1,19 @@
Drinkable is an app which help you find cocktails that you could make today with ingredients from home. You can also explore new great cocktails to make. The app will always let you know what ingredents is missing.

Features:

- Includes 100+ cocktails.
- Also includes mocktails and cocktail ingredients.
- Ability to add your own cocktails and ingredients within the app.
- Mark cocktails as favorites
- Lets you know what cocktails you can make with the ingredients you have at home.
- 1 missing ingredient list. So you can easily pick up that last item and make a new cocktail.
- Save favorite cocktails.
- Rate cocktails with stars from zero to five.
- Supports both Imperial and Metric measurement system.
- Simple User Interface
- Offline support
- Offline support, this app will work even if you dont have internet connection.
- Simple User Interface.
- 8+ languages. English, Spanish, French, German and more.
- Open source, code is avaliable on Github.

Please reach out to [email protected] if you have any questions or wish for a specific cocktail or feature to be added.

Expand Down
2 changes: 1 addition & 1 deletion fastlane/metadata/android/en-US/title.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
Drinkable - Cocktail App
Drinkable
20 changes: 12 additions & 8 deletions src/components/dialogs/welcome-dialog.html
Original file line number Diff line number Diff line change
@@ -1,24 +1,28 @@
<template>
<ux-dialog class="small-dialog">
<div>
<div class="bg-base-200 modal-box relative" style="padding: 0.5em">

<h4 class="text-lg" t="welcome"></h4>
<div class="bg-base-200 modal-box relative p-4">
<h4 class="text-lg p4" t="welcome"></h4>
<p t="select-messuarement-system"></p>

<div class="small-dialog-content">
<div repeat.for="messuarementSystem of messuarementSystems"
<div
repeat.for="messuarementSystem of messuarementSystems"
click.delegate="selectMessuarementSystem(messuarementSystem)"
class="${messuarementSystem === selectedMessuarementSystem ? 'border-primary' : 'border-none'}"
style="border-width: 1px;">
class="${messuarementSystem === selectedMessuarementSystem ? 'border-secondary' : 'border-neutral'} border-2">
<p>${messuarementSystem.toLowerCase() | t}</p>
<div></div>
</div>
</div>

<div class="form-control w-full py-2">
<label class="label cursor-pointer">
<span class="label-text" t="show-mocktails"></span>
<input type="checkbox" class="toggle" checked.bind="showMocktails" />
</label>
</div>
<button class="btn btn-active flex-1 w-full" t="select" click.trigger="ok()"></button>

</div>
</div>
</ux-dialog>
</template>
</template>
22 changes: 19 additions & 3 deletions src/components/dialogs/welcome-dialog.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,23 +2,39 @@ import { inject } from 'aurelia-framework';
import { DialogController } from 'aurelia-dialog';
import { LocalStorageService } from 'services/local-storage-service';
import { MessuarementSystem } from 'domain/enums/messuarement-system';
import { CocktailService } from 'services/cocktail-service';

@inject(DialogController, LocalStorageService)
@inject(DialogController, LocalStorageService, CocktailService)
export class WelcomeDialog {
public showMocktails: boolean;

public controller: DialogController;
public messuarementSystems = [MessuarementSystem.Imperial, MessuarementSystem.Metric];
public selectedMessuarementSystem: MessuarementSystem = MessuarementSystem.Imperial;

constructor(dialogContoller: DialogController, private _localStorageService: LocalStorageService) {
constructor(
dialogContoller: DialogController,
private _localStorageService: LocalStorageService,
private _cocktailService: CocktailService
) {
this.controller = dialogContoller;
}

public async selectMessuarementSystem(messuarementSystem: MessuarementSystem) {
public selectMessuarementSystem(messuarementSystem: MessuarementSystem) {
this.selectedMessuarementSystem = messuarementSystem;
}

async ok() {
await this._localStorageService.updateMessuarmentSystem(this.selectedMessuarementSystem);
await this.updateShowMocktails();

this.controller.ok();
}

private async updateShowMocktails() {
let settings = this._localStorageService.getSettings();
settings.showMocktails = this.showMocktails;
await this._localStorageService.updateSettings(settings);
this._cocktailService.updateShowMocktails(settings.showMocktails);
}
}
70 changes: 70 additions & 0 deletions src/data/cocktail-data.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1643,5 +1643,75 @@ const cocktails: Cocktail[] = [
{ amount: '1.25', ingredientId: '2', unit: Unit.DL },
{ amount: '1.25', ingredientId: '10', unit: Unit.DL }
]
},
{
id: '116',
imageSrc: 'images/afterglow.jpg',
isImagePortrait: false,
name: 'Afterglow',
category: DrinkCategory.Mocktail,
instructions: 'Mix \nServe over ice',
ingredientGroups: [
{ amount: '20', ingredientId: '30', unit: Unit.ML },
{ amount: '80', ingredientId: '64', unit: Unit.ML },
{ amount: '80', ingredientId: '26', unit: Unit.ML }
]
},
{
id: '117',
imageSrc: 'images/alice_cocktail.jpg',
isImagePortrait: false,
name: 'Alice Cocktail',
category: DrinkCategory.Mocktail,
instructions: 'Shake well, strain into a large cocktail glass.',
ingredientGroups: [
{ amount: '10', ingredientId: '30', unit: Unit.ML },
{ amount: '10', ingredientId: '64', unit: Unit.ML },
{ amount: '20', ingredientId: '26', unit: Unit.ML },
{ amount: '40', ingredientId: '35', unit: Unit.ML }
]
},
{
id: '118',
imageSrc: 'images/apple_karate.jpg',
isImagePortrait: false,
name: 'Apple Karate',
category: DrinkCategory.Mocktail,
instructions:
'Place all ingredients in the blender jar - cover and whiz on medium speed until well blended. Pour in one tall, 2 medium or 3 small glasses and drink up.',
ingredientGroups: [
{ amount: '5', ingredientId: '97', unit: Unit.DL },
{ amount: '1', ingredientId: '98', unit: '' }
]
},
{
id: '119',
imageSrc: 'images/orangeade.jpg',
isImagePortrait: false,
name: 'Orangeade',
category: DrinkCategory.Mocktail,
instructions:
'Place some ice cubes in a large tumbler or highball glass, add lemon juice, orange juice, sugar syrup, and stir well. \nTop up with cold soda water, serve with a drinking straw.',
ingredientGroups: [
{ amount: '50', ingredientId: '10', unit: Unit.ML },
{ amount: '150', ingredientId: '64', unit: Unit.ML },
{ amount: '30', ingredientId: '3', unit: Unit.ML },
{ amount: '', ingredientId: '4', unit: '' }
]
},
{
id: '120',
imageSrc: 'images/banana_milk_shake.jpg',
isImagePortrait: false,
name: 'Banana Milk Shake',
category: DrinkCategory.Mocktail,
instructions:
'Blend very well, preferably in a household mixer. \nServe in a wine glass, garnish with whipped cream and a piece of banana.',
ingredientGroups: [
{ amount: '100', ingredientId: '77', unit: Unit.ML },
{ amount: '40', ingredientId: '64', unit: Unit.ML },
{ amount: '10', ingredientId: '3', unit: Unit.ML },
{ amount: '0.5', ingredientId: '99', unit: '' }
]
}
];
5 changes: 4 additions & 1 deletion src/data/ingredient-data.ts
Original file line number Diff line number Diff line change
Expand Up @@ -101,5 +101,8 @@ const currentIngredients: StaticIngredient[] = [
{ id: '93', translation: 'pisco', spiritType: SpiritType.None },
{ id: '94', translation: 'aquafaba', spiritType: SpiritType.None },
{ id: '95', translation: 'mango', spiritType: SpiritType.None },
{ id: '96', translation: 'passoa', spiritType: SpiritType.None }
{ id: '96', translation: 'passoa', spiritType: SpiritType.None },
{ id: '97', translation: 'apple-juice', spiritType: SpiritType.None },
{ id: '98', translation: 'carrot', spiritType: SpiritType.None },
{ id: '99', translation: 'banana', spiritType: SpiritType.None }
];
4 changes: 3 additions & 1 deletion src/domain/entities/setting-entity.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
export class SettingEntity {
appRateTimestamp: number;
language: string;
language?: string;
showMocktails: boolean;

constructor() {
this.appRateTimestamp = 0;
this.showMocktails = false;
}
}
6 changes: 4 additions & 2 deletions src/domain/enums/drink-category.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,16 @@ export enum DrinkCategory {
Cocktail = 0,
Shot = 1,
Other = 2,
Ingredient = 3
Ingredient = 3,
Mocktail = 4
}

export function getDrinkCategories(): EnumTranslationModel<DrinkCategory>[] {
return [
{ value: DrinkCategory.Cocktail, translation: 'drink-category.cocktail' },
{ value: DrinkCategory.Shot, translation: 'drink-category.shot' },
{ value: DrinkCategory.Other, translation: 'drink-category.other' },
{ value: DrinkCategory.Ingredient, translation: 'drink-category.ingredient' }
{ value: DrinkCategory.Ingredient, translation: 'drink-category.ingredient' },
{ value: DrinkCategory.Mocktail, translation: 'drink-category.mocktail' }
];
}
7 changes: 5 additions & 2 deletions src/locales/ca/ingredients.json
Original file line number Diff line number Diff line change
Expand Up @@ -94,5 +94,8 @@
"pisco": "Pisco",
"aquafaba": "Aquafaba",
"mango": "Mango",
"passoa": "Passoa"
}
"passoa": "Passoa",
"apple-juice": "suc de poma",
"carrot": "Pastanaga",
"banana": "Plàtan"
}
6 changes: 4 additions & 2 deletions src/locales/ca/translation.json
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,8 @@
"cocktail": "Còctel",
"shot": "Tir",
"other": "Altres",
"ingredient": "Ingredient"
"ingredient": "Ingredient",
"mocktail": "Mocktail"
},
"spirit-type": {
"gin": "Ginebra",
Expand All @@ -91,5 +92,6 @@
"whiskey-scotch": "Whisky / Escocès",
"cognac-brandy": "Conyac / Brandi"
},
"or": "O"
"or": "O",
"show-mocktails": "Mostra Mocktails"
}
6 changes: 4 additions & 2 deletions src/locales/de/translation.json
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,8 @@
"cocktail": "Cocktail",
"shot": "Schuss",
"other": "Sonstiges",
"ingredient": "Zutat"
"ingredient": "Zutat",
"mocktail": "Mocktail"
},
"spirit-type": {
"gin": "Ginebra",
Expand All @@ -91,5 +92,6 @@
"whiskey-scotch": "Whisky / Schottisch",
"cognac-brandy": "Conyac / Schnaps"
},
"or": "Oder"
"or": "Oder",
"show-mocktails": "Mocktails anzeigen"
}
5 changes: 4 additions & 1 deletion src/locales/en/ingredients.json
Original file line number Diff line number Diff line change
Expand Up @@ -94,5 +94,8 @@
"pisco": "Pisco",
"aquafaba": "Aquafaba",
"mango": "Mango",
"passoa": "Passoa"
"passoa": "Passoa",
"apple-juice": "Apple Juice",
"carrot": "Carrot",
"banana": "Banana"
}
6 changes: 4 additions & 2 deletions src/locales/en/translation.json
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,8 @@
"cocktail": "Cocktail",
"shot": "Shot",
"other": "Other",
"ingredient": "Ingredient"
"ingredient": "Ingredient",
"mocktail": "Mocktail"
},
"spirit-type": {
"gin": "Gin",
Expand All @@ -91,5 +92,6 @@
"whiskey-scotch": "Whiskey / Scotch",
"cognac-brandy": "Cognac / Brandy"
},
"or": "Or"
"or": "Or",
"show-mocktails": "Show Mocktails"
}
5 changes: 4 additions & 1 deletion src/locales/es/ingredients.json
Original file line number Diff line number Diff line change
Expand Up @@ -94,5 +94,8 @@
"pisco": "Pisco",
"aquafaba": "Aguafaba",
"mango": "Mango",
"passoa": "Passoa"
"passoa": "Passoa",
"apple-juice": "Jugo de manzana",
"carrot": "Zanahoria",
"banana": "Banana"
}
6 changes: 4 additions & 2 deletions src/locales/es/translation.json
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,8 @@
"cocktail": "Cóctel",
"shot": "Disparo",
"other": "Otro",
"ingredient": "Ingrediente"
"ingredient": "Ingrediente",
"mocktail": "Mocktail"
},
"spirit-type": {
"gin": "Ginebra",
Expand All @@ -91,5 +92,6 @@
"whiskey-scotch": "Whiskey / Escocés",
"cognac-brandy": "Coñac / Brandy"
},
"or": "O"
"or": "O",
"show-mocktails": "Mostrar mocktails"
}
7 changes: 5 additions & 2 deletions src/locales/fr/ingredients.json
Original file line number Diff line number Diff line change
Expand Up @@ -94,5 +94,8 @@
"pisco": "Pisco",
"aquafaba": "Aguafaba",
"mango": "Mangue",
"passoa": "Fruit de la passion"
}
"passoa": "Fruit de la passion",
"apple-juice": "Jus de pomme",
"carrot": "Carotte",
"banana": "Banane"
}
6 changes: 4 additions & 2 deletions src/locales/fr/translation.json
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,8 @@
"cocktail": "Cocktail",
"shot": "Tir",
"other": "Autre",
"ingredient": "Ingrédient"
"ingredient": "Ingrédient",
"mocktail": "Mocktail"
},
"spirit-type": {
"gin": "Gin",
Expand All @@ -91,5 +92,6 @@
"whiskey-scotch": "Whisky / Écossais",
"cognac-brandy": "Cognac / Brandy"
},
"or": "Ou"
"or": "Ou",
"show-mocktails": "Afficher mocktails"
}
Loading

0 comments on commit 3252176

Please sign in to comment.