Added ability to mark card as done
Closes #534 Signed-off-by: Thanos Kamber <thanos.kamber@gmail.com>
This commit is contained in:
committed by
Julius Härtl
parent
93e5ee7301
commit
c3b4ed6e1f
@@ -64,7 +64,8 @@
|
||||
<input type="submit" value="" class="icon-confirm">
|
||||
</form>
|
||||
|
||||
<DueDate v-if="!editing" :card="card" />
|
||||
<DueDate v-if="!editing && !card.done" :card="card" />
|
||||
<Done v-else-if="!editing && card.done" :card="card" />
|
||||
|
||||
<CardMenu v-if="!editing && compactMode" :card="card" class="right" />
|
||||
</div>
|
||||
@@ -94,12 +95,13 @@ import Color from '../../mixins/color.js'
|
||||
import labelStyle from '../../mixins/labelStyle.js'
|
||||
import AttachmentDragAndDrop from '../AttachmentDragAndDrop.vue'
|
||||
import CardMenu from './CardMenu.vue'
|
||||
import Done from './badges/Done.vue'
|
||||
import DueDate from './badges/DueDate.vue'
|
||||
import CardCover from './CardCover.vue'
|
||||
|
||||
export default {
|
||||
name: 'CardItem',
|
||||
components: { CardBadges, AttachmentDragAndDrop, CardMenu, DueDate, CardCover },
|
||||
components: { CardBadges, AttachmentDragAndDrop, CardMenu, DueDate, CardCover, Done },
|
||||
directives: {
|
||||
ClickOutside,
|
||||
},
|
||||
|
||||
@@ -36,6 +36,9 @@
|
||||
@click="unassignCardFromMe()">
|
||||
{{ t('deck', 'Unassign myself') }}
|
||||
</NcActionButton>
|
||||
<NcActionButton icon="icon-checkmark" :close-after-click="true" @click="changeCardDoneStatus()">
|
||||
{{ card.done ? t('deck', 'Mark as not done') : t('deck', 'Mark as done') }}
|
||||
</NcActionButton>
|
||||
<NcActionButton icon="icon-external" :close-after-click="true" @click="modalShow=true">
|
||||
{{ t('deck', 'Move card') }}
|
||||
</NcActionButton>
|
||||
@@ -157,6 +160,9 @@ export default {
|
||||
this.$store.dispatch('deleteCard', this.card)
|
||||
showUndo(t('deck', 'Card deleted'), () => this.$store.dispatch('cardUndoDelete', this.card))
|
||||
},
|
||||
changeCardDoneStatus() {
|
||||
this.$store.dispatch('changeCardDoneStatus', { ...this.card, done: !this.card.done })
|
||||
},
|
||||
archiveUnarchiveCard() {
|
||||
this.$store.dispatch('archiveUnarchiveCard', { ...this.card, archived: !this.card.archived })
|
||||
},
|
||||
|
||||
68
src/components/cards/badges/Done.vue
Normal file
68
src/components/cards/badges/Done.vue
Normal file
@@ -0,0 +1,68 @@
|
||||
<!--
|
||||
- @copyright Copyright (c) 2022 Thanos Kamber <thanos.kamber@gmail.com>
|
||||
-
|
||||
- @author Thanos Kamber <thanos.kamber@gmail.com>
|
||||
-
|
||||
- @license GNU AGPL version 3 or any later version
|
||||
-
|
||||
- This program is free software: you can redistribute it and/or modify
|
||||
- it under the terms of the GNU Affero General Public License as
|
||||
- published by the Free Software Foundation, either version 3 of the
|
||||
- License, or (at your option) any later version.
|
||||
-
|
||||
- This program is distributed in the hope that it will be useful,
|
||||
- but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
- GNU Affero General Public License for more details.
|
||||
-
|
||||
- You should have received a copy of the GNU Affero General Public License
|
||||
- along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
-
|
||||
-->
|
||||
|
||||
<template>
|
||||
<div v-if="card" class="done">
|
||||
<transition name="zoom">
|
||||
<div class="icon-check-circle">
|
||||
<CheckCircle :size="20" />
|
||||
</div>
|
||||
</transition>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import CheckCircle from 'vue-material-design-icons/CheckCircle.vue'
|
||||
|
||||
export default {
|
||||
name: 'Done',
|
||||
components: {
|
||||
CheckCircle,
|
||||
},
|
||||
props: {
|
||||
card: {
|
||||
type: Object,
|
||||
default: null,
|
||||
},
|
||||
},
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.icon-check-circle {
|
||||
color: var(--color-success);
|
||||
margin: 14px;
|
||||
}
|
||||
|
||||
@media print {
|
||||
.icon-check-circle {
|
||||
span {
|
||||
display: none;
|
||||
}
|
||||
|
||||
&::before {
|
||||
color: var(--color-text-lighter);
|
||||
content: 'Done';
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
Reference in New Issue
Block a user