feat: add close task popup link (#880)

Co-authored-by: kolaente <k@knt.li>
Reviewed-on: https://kolaente.dev/vikunja/frontend/pulls/880
Co-authored-by: konrad <k@knt.li>
Co-committed-by: konrad <k@knt.li>
This commit is contained in:
konrad 2021-10-21 20:00:45 +00:00 committed by Dominik Pschenitschni
parent c6b24dd8f1
commit 877b243c69
No known key found for this signature in database
GPG key ID: B257AC0149F43A77
4 changed files with 151 additions and 137 deletions

View file

@ -527,6 +527,7 @@
"deleteSuccess": "The task has been deleted successfully.", "deleteSuccess": "The task has been deleted successfully.",
"belongsToList": "This task belongs to list '{list}'", "belongsToList": "This task belongs to list '{list}'",
"due": "Due {at}", "due": "Due {at}",
"closePopup": "Close popup",
"delete": { "delete": {
"header": "Delete this task", "header": "Delete this task",
"text1": "Are you sure you want to remove this task?", "text1": "Are you sure you want to remove this task?",

View file

@ -3,6 +3,7 @@ import {
faAlignLeft, faAlignLeft,
faAngleRight, faAngleRight,
faArchive, faArchive,
faArrowLeft,
faBars, faBars,
faBell, faBell,
faCalendar, faCalendar,
@ -67,6 +68,7 @@ import {FontAwesomeIcon} from '@fortawesome/vue-fontawesome'
library.add(faAlignLeft) library.add(faAlignLeft)
library.add(faAngleRight) library.add(faAngleRight)
library.add(faArchive) library.add(faArchive)
library.add(faArrowLeft)
library.add(faBars) library.add(faBars)
library.add(faBell) library.add(faBell)
library.add(faBellSlash) library.add(faBellSlash)

View file

@ -246,7 +246,12 @@
<!-- Comments --> <!-- Comments -->
<comments :can-write="canWrite" :task-id="taskId"/> <comments :can-write="canWrite" :task-id="taskId"/>
</div> </div>
<div class="column is-one-third action-buttons" v-if="canWrite"> <div class="column is-one-third action-buttons">
<a @click="$router.back()" class="is-fullwidth is-block has-text-centered mb-4" v-if="shouldShowClosePopup">
<icon icon="arrow-left"/>
{{ $t('task.detail.closePopup') }}
</a>
<template v-if="canWrite">
<x-button <x-button
:class="{'is-success': !task.done}" :class="{'is-success': !task.done}"
:shadow="task.done" :shadow="task.done"
@ -368,7 +373,9 @@
type="secondary" type="secondary"
:icon="task.isFavorite ? 'star' : ['far', 'star']" :icon="task.isFavorite ? 'star' : ['far', 'star']"
> >
{{ task.isFavorite ? $t('task.detail.actions.unfavorite') : $t('task.detail.actions.favorite') }} {{
task.isFavorite ? $t('task.detail.actions.unfavorite') : $t('task.detail.actions.favorite')
}}
</x-button> </x-button>
<x-button <x-button
@click="showDeleteModal = true" @click="showDeleteModal = true"
@ -378,6 +385,7 @@
> >
{{ $t('task.detail.actions.delete') }} {{ $t('task.detail.actions.delete') }}
</x-button> </x-button>
</template>
<!-- Created / Updated [by] --> <!-- Created / Updated [by] -->
<p class="created"> <p class="created">
@ -558,6 +566,9 @@ export default {
hasAttachments() { hasAttachments() {
return this.$store.state.attachments.attachments.length > 0 return this.$store.state.attachments.attachments.length > 0
}, },
shouldShowClosePopup() {
return this.$route.name.includes('kanban')
},
}, },
methods: { methods: {
attachmentUpload(...args) { attachmentUpload(...args) {

View file

@ -57,7 +57,7 @@ export default {
font-size: 2rem; font-size: 2rem;
@media screen and (max-width: $desktop) { @media screen and (max-width: $desktop) {
display: none; color: $dark;
} }
} }
</style> </style>