Skip to content

Commit

Permalink
bring back archive, restore and delete actions
Browse files Browse the repository at this point in the history
Signed-off-by: dartcafe <[email protected]>
  • Loading branch information
dartcafe committed Apr 4, 2024
1 parent a135987 commit 2c0e5e0
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 12 deletions.
14 changes: 5 additions & 9 deletions src/js/components/Navigation/PollNavigationItems.vue
Original file line number Diff line number Diff line change
Expand Up @@ -21,39 +21,35 @@
-->

<template>
<NcAppNavigationItem :name="poll.title"
:to="{name: 'vote', params: {id: poll.id}}"
:class="{ closed: closed }">
<NcAppNavigationItem :name="poll.title" :to="{name: 'vote', params: {id: poll.id}}" :class="{ closed: closed }">
<template #icon>
<TextPollIcon v-if="poll.type === 'textPoll'" />
<DatePollIcon v-else />
</template>
<template #actions>
<NcActionButton v-if="isPollCreationAllowed"
:name="t('polls', 'Clone poll')"
@click="$emit('clone-poll')">
<NcActionButton v-if="isPollCreationAllowed" :name="t('polls', 'Clone poll')" @click="$emit('clone-poll')">
<template #icon>
<ClonePollIcon />
</template>
</NcActionButton>

<NcActionButton v-if="poll.allowEdit && !poll.deleted"
<NcActionButton v-if="poll.permissions.edit && !poll.deleted"
:name="t('polls', 'Archive poll')"
@click="$emit('toggle-archive')">
<template #icon>
<ArchivePollIcon />
</template>
</NcActionButton>

<NcActionButton v-if="poll.allowEdit && poll.deleted"
<NcActionButton v-if="poll.permissions.edit && poll.deleted"
:name="t('polls', 'Restore poll')"
@click="$emit('toggle-archive')">
<template #icon>
<RestorePollIcon />
</template>
</NcActionButton>

<NcActionButton v-if="poll.allowEdit && poll.deleted"
<NcActionButton v-if="poll.permissions.edit && poll.deleted"
class="danger"
:name="t('polls', 'Delete poll')"
@click="$emit('delete-poll')">
Expand Down
6 changes: 3 additions & 3 deletions src/js/views/PollList.vue
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@
</template>
</NcActionButton>

<NcActionButton v-if="poll.allowEdit && !poll.deleted"
<NcActionButton v-if="poll.permissions.edit && !poll.deleted"
:name="t('polls', 'Archive poll')"
close-after-click
@click="toggleArchive(poll.id)">
Expand All @@ -72,7 +72,7 @@
{{ t('polls', 'Archive poll') }}
</NcActionButton>

<NcActionButton v-if="poll.allowEdit && poll.deleted"
<NcActionButton v-if="poll.permissions.edit && poll.deleted"
:name="t('polls', 'Restore poll')"
close-after-click
@click="toggleArchive(poll.id)">
Expand All @@ -82,7 +82,7 @@
{{ t('polls', 'Restore poll') }}
</NcActionButton>

<NcActionButton v-if="poll.allowEdit && poll.deleted"
<NcActionButton v-if="poll.permissions.edit && poll.deleted"
class="danger"
:name="t('polls', 'Delete poll')"
close-after-click
Expand Down

0 comments on commit 2c0e5e0

Please sign in to comment.