From 9d781877a644a59f42c7c8d9574a60b9fd3a221f Mon Sep 17 00:00:00 2001 From: Sebastian Fey Date: Thu, 5 Nov 2020 21:15:07 +0100 Subject: [PATCH 01/10] Added keywords to recipe view Signed-off-by: Sebastian Fey --- src/components/RecipeKeyword.vue | 33 ++++++++++++++++++++++++++++++++ src/components/RecipeView.vue | 12 ++++++++++++ 2 files changed, 45 insertions(+) create mode 100644 src/components/RecipeKeyword.vue diff --git a/src/components/RecipeKeyword.vue b/src/components/RecipeKeyword.vue new file mode 100644 index 000000000..eec66e1a6 --- /dev/null +++ b/src/components/RecipeKeyword.vue @@ -0,0 +1,33 @@ + + + + + diff --git a/src/components/RecipeView.vue b/src/components/RecipeView.vue index 68b146e44..e0de6cb97 100644 --- a/src/components/RecipeView.vue +++ b/src/components/RecipeView.vue @@ -6,6 +6,11 @@

{{ $store.state.recipe.name }}

+

+

    + +
+

{{ $store.state.recipe.description }}

{{ t('cookbook', 'Source') }}: {{ $store.state.recipe.url }} @@ -50,6 +55,7 @@ import RecipeImages from './RecipeImages' import RecipeIngredient from './RecipeIngredient' import RecipeInstruction from './RecipeInstruction' +import RecipeKeyword from './RecipeKeyword' import RecipeTimer from './RecipeTimer' import RecipeTool from './RecipeTool' @@ -59,6 +65,7 @@ export default { RecipeImages, RecipeIngredient, RecipeInstruction, + RecipeKeyword, RecipeTimer, RecipeTool, }, @@ -67,6 +74,7 @@ export default { // Own properties ingredients: [], instructions: [], + keywords: [], timerCook: null, timerPrep: null, timerTotal: null, @@ -109,6 +117,10 @@ export default { $this.instructions = Object.values($this.$store.state.recipe.recipeInstructions) } + if ($this.$store.state.recipe.keywords) { + $this.keywords = String($this.$store.state.recipe.keywords).split(','); + } + if ($this.$store.state.recipe.cookTime) { let cookT = $this.$store.state.recipe.cookTime.match(/PT(\d+?)H(\d+?)M/) $this.timerCook = { hours: parseInt(cookT[1]), minutes: parseInt(cookT[2]) } From 7fec2a9bbc54ef3532323bf39405e34670486b60 Mon Sep 17 00:00:00 2001 From: Sebastian Fey Date: Thu, 5 Nov 2020 22:39:34 +0100 Subject: [PATCH 02/10] Added links to keywords in recipe view Signed-off-by: Sebastian Fey --- src/components/RecipeKeyword.vue | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/components/RecipeKeyword.vue b/src/components/RecipeKeyword.vue index eec66e1a6..253b02b71 100644 --- a/src/components/RecipeKeyword.vue +++ b/src/components/RecipeKeyword.vue @@ -1,5 +1,5 @@ @@ -29,7 +30,7 @@ li { margin-bottom: .3em; padding: 0px .5em; border: 1px solid var(--color-border-dark); - border-radius: 4px; + border-radius: var(--border-radius-pill); /* prevent text selection - doesn't look good */ -webkit-user-select: none; /* Safari */ @@ -43,6 +44,17 @@ li { color: var(--color-primary-text); } +.disabled li { + background-color: #FFF; + border-color: var(--color-border); + color: var(--color-border); +} + +.disabled li:hover { + border-color: var(--color-border); + cursor: default; +} + li:hover, .active li:hover { border: 1px solid var(--color-primary); }