diff options
author | dartcafe <github@dartcafe.de> | 2021-03-22 01:20:44 +0300 |
---|---|---|
committer | dartcafe <github@dartcafe.de> | 2021-03-22 09:28:30 +0300 |
commit | e31a91655de85b97905b9053b83e923566bd4f0c (patch) | |
tree | 703ecb27315031ef08e811f4ced4d319999af84d /src/js/components/SideBar/SideBarTabOptions.vue | |
parent | 26f90b4126abc3731d46bb4c735e872d690eaba6 (diff) |
maintenance and tidy
Signed-off-by: dartcafe <github@dartcafe.de>
Diffstat (limited to 'src/js/components/SideBar/SideBarTabOptions.vue')
-rw-r--r-- | src/js/components/SideBar/SideBarTabOptions.vue | 33 |
1 files changed, 26 insertions, 7 deletions
diff --git a/src/js/components/SideBar/SideBarTabOptions.vue b/src/js/components/SideBar/SideBarTabOptions.vue index d786d50c..c56106d8 100644 --- a/src/js/components/SideBar/SideBarTabOptions.vue +++ b/src/js/components/SideBar/SideBarTabOptions.vue @@ -23,18 +23,36 @@ <template> <div> <ConfigBox v-if="!isOwner" :title="t('polls', 'As an admin you may edit this poll')" icon-class="icon-checkmark" /> - <ConfigProposals /> - <OptionsDateAdd v-if="pollType === 'datePoll' && !pollIsClosed" /> - <OptionsDateShift v-if="pollType === 'datePoll' && countOptions && !pollIsClosed" /> - <OptionsDate v-if="pollType === 'datePoll'" /> + <ConfigBox :title="t('polls', 'Allow Proposals from users')" icon-class="icon-category-customization"> + <ConfigProposals /> + </ConfigBox> - <OptionsTextAdd v-if="pollType === 'textPoll' && !pollIsClosed" /> - <OptionsText v-if="pollType === 'textPoll'" /> + <ConfigBox v-if="!pollIsClosed" :title="t('polls', 'Add an option')" icon-class="icon-add"> + <OptionsDateAdd v-if="pollType === 'datePoll'" /> + <OptionsTextAdd v-else-if="pollType === 'textPoll'" /> + </ConfigBox> + + <ConfigBox v-if="pollType === 'datePoll' && countOptions && !pollIsClosed" :title="t('polls', 'Shift all date options')" icon-class="icon-polls-move"> + <OptionsDateShift /> + </ConfigBox> + + <ConfigBox v-if="countOptions" :title="t('polls', 'Available Options')" :icon-class="pollTypeIcon"> + <OptionsDate v-if="pollType === 'datePoll'" /> + <OptionsText v-else-if="pollType === 'textPoll'" /> + </ConfigBox> + + <EmptyContent v-else :icon="pollTypeIcon"> + {{ t('polls', 'No vote options') }} + <template #desc> + {{ t('polls', 'Add some!') }} + </template> + </EmptyContent> </div> </template> <script> import { mapGetters, mapState } from 'vuex' +import { EmptyContent } from '@nextcloud/vue' import ConfigBox from '../Base/ConfigBox' import OptionsDate from '../Options/OptionsDate' import OptionsDateAdd from '../Options/OptionsDateAdd' @@ -49,6 +67,7 @@ export default { components: { ConfigBox, ConfigProposals, + EmptyContent, OptionsDate, OptionsDateAdd, OptionsDateShift, @@ -60,12 +79,12 @@ export default { ...mapGetters({ pollIsClosed: 'poll/closed', countOptions: 'options/count', + pollTypeIcon: 'poll/typeIcon', }), ...mapState({ pollType: state => state.poll.type, isOwner: state => state.poll.acl.isOwner, }), - }, } </script> |