Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@
[#1866](https://github.com/nextcloud/cookbook/pull/1866) @seyfeb
- Allow editing existing recipe as new (see [1867](https://github.com/nextcloud/cookbook/issues/1867))
[#1866](https://github.com/nextcloud/cookbook/pull/1866) @seyfeb
- Replace checkmark with strikethrough for recipe ingredients
[#1910](https://github.com/nextcloud/cookbook/pull/1910) @j0hannesr0th

### Fixed
- Fix translation string to not contain quotes
Expand Down
34 changes: 7 additions & 27 deletions src/components/RecipeView/RecipeIngredient.vue
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,8 @@
}"
@click="toggleDone"
>
<div class="checkmark" :class="{ done: isDone }">✔</div>
<div class="ingredient">
<VueShowdown :markdown="displayIngredient" />
<VueShowdown :markdown="formattedIngredient" flavor="github" />
</div>
<span v-if="!ingredientHasCorrectSyntax" class="icon-error" />
</li>
Expand Down Expand Up @@ -53,6 +52,12 @@ const displayIngredient = computed(() => {
}
return props.ingredient;
});

const formattedIngredient = computed(() =>
isDone.value
? `~~${displayIngredient.value}~~`
: `**${displayIngredient.value}**`,
);
</script>

<script>
Expand All @@ -74,37 +79,12 @@ li {
list-style-type: none;
}

.unindented {
position: relative;
left: -1.25em;
}

li > .checkmark {
display: inline;
visibility: hidden;
}

li > .done {
visibility: visible;
}

li:hover > .checkmark {
color: var(--color-primary-element);
opacity: 0.5;
visibility: visible;
}

li > .ingredient {
display: inline;
padding-left: 1em;
margin-left: 0.3em;
text-indent: -1em;
}

.ingredient:deep(a) {
text-decoration: underline;
}

li > span.icon-error {
margin-left: 0.3em;
}
Expand Down