diff options
author | dartcafe <github@dartcafe.de> | 2021-04-26 09:53:47 +0300 |
---|---|---|
committer | dartcafe <github@dartcafe.de> | 2021-04-26 09:53:47 +0300 |
commit | ff4dc705c041586a4ffd29fb590c1bdae56ad2fe (patch) | |
tree | 7a44141a3cf14f147ab15e41f71a7005c4c4eb06 /src/js/components/Options/OptionsDate.vue | |
parent | 2c1a5acb2573ea9f61d6661d103af71ca0de7274 (diff) |
fix add options in new poll
Signed-off-by: dartcafe <github@dartcafe.de>
Diffstat (limited to 'src/js/components/Options/OptionsDate.vue')
-rw-r--r-- | src/js/components/Options/OptionsDate.vue | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/src/js/components/Options/OptionsDate.vue b/src/js/components/Options/OptionsDate.vue index b3f8ede7..554e1466 100644 --- a/src/js/components/Options/OptionsDate.vue +++ b/src/js/components/Options/OptionsDate.vue @@ -23,7 +23,7 @@ <template> <div> <OptionsDateAdd v-if="!pollIsClosed" /> - <transition-group is="ul"> + <transition-group is="ul" v-if="!isOwner"> <OptionItem v-for="(option) in options" :key="option.id" :option="option" @@ -57,6 +57,13 @@ </OptionItem> </transition-group> + <EmptyContent v-else :icon="pollTypeIcon"> + {{ t('polls', 'No vote options') }} + <template #desc> + {{ t('polls', 'Add some!') }} + </template> + </EmptyContent> + <Modal v-if="cloneModal" :can-close="false"> <OptionCloneDate :option="optionToClone" class="modal__content" @close="closeModal()" /> </Modal> @@ -65,12 +72,12 @@ <script> import { mapGetters, mapState } from 'vuex' +import moment from '@nextcloud/moment' +import { Actions, ActionButton, EmptyContent, Modal } from '@nextcloud/vue' import OptionCloneDate from './OptionCloneDate' import OptionsDateAdd from './OptionsDateAdd' import OptionItem from './OptionItem' import OptionItemOwner from '../Options/OptionItemOwner' -import moment from '@nextcloud/moment' -import { Actions, ActionButton, Modal } from '@nextcloud/vue' import { confirmOption, removeOption } from '../../mixins/optionMixins' import { dateUnits } from '../../mixins/dateMixins' @@ -80,6 +87,7 @@ export default { components: { Actions, ActionButton, + EmptyContent, Modal, OptionCloneDate, OptionsDateAdd, @@ -110,11 +118,13 @@ export default { ...mapState({ options: (state) => state.options.list, acl: (state) => state.poll.acl, + isOwner: (state) => state.poll.acl.isOwner, }), ...mapGetters({ pollIsClosed: 'poll/closed', countOptions: 'options/count', + pollTypeIcon: 'poll/typeIcon', }), dateBaseOptionString() { |