Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added option to check ingredients #393

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 @@ -33,6 +33,8 @@
[#433](https://github.com/nextcloud/cookbook/pull/433) @christianlupus
- Category and keyword selection from list of existing ones in recipe editor
[#402](https://github.com/nextcloud/cookbook/pull/402/) @seyfeb
- Allow checking of ingredients in web UI
[#393](https://github.com/nextcloud/cookbook/pull/393) @christianlupus

### Changed
- Switch of project ownership to neextcloud organization in GitHub
Expand Down
25 changes: 23 additions & 2 deletions src/components/RecipeIngredient.vue
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
<template>
<li :class="{ 'header': isHeader() }">{{ displayIngredient }}</li>
<li :class="{ 'header': isHeader() }" @click="toggleDone">
<div class="checkmark" :class="{ 'done': isDone }">✔</div>
{{ displayIngredient }}
</li>
</template>

<script>
Expand All @@ -9,6 +12,7 @@ export default {
data () {
return {
headerPrefix: "## ",
isDone: false,
}
},
computed: {
Expand All @@ -25,6 +29,9 @@ export default {
return true
}
return false
},
toggleDone: function() {
this.isDone = !this.isDone
}
}

Expand All @@ -43,5 +50,19 @@ li {
list-style-type: none;
font-variant: small-caps;
}


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

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

</style>