@@ -8,17 +8,11 @@ import { nextTick, useTemplateRef } from 'vue'
88import { useSortable } from ' @vueuse/integrations/useSortable'
99
1010import { t } from ' @nextcloud/l10n'
11- import NcActions from ' @nextcloud/vue/components/NcActions'
12- import NcActionButton from ' @nextcloud/vue/components/NcActionButton'
13-
14- import DeleteIcon from ' vue-material-design-icons/TrashCanOutline.vue'
15- import RestoreIcon from ' vue-material-design-icons/RecycleVariant.vue'
16- import ConfirmIcon from ' vue-material-design-icons/CheckboxBlankOutline.vue'
17- import UnconfirmIcon from ' vue-material-design-icons/CheckboxMarkedOutline.vue'
1811
1912import OptionItem from ' ./OptionItem.vue'
2013import { usePollStore } from ' ../../stores/poll'
2114import { useOptionsStore } from ' ../../stores/options'
15+ import OptionMenu from ' ./OptionMenu.vue'
2216
2317const pollStore = usePollStore ()
2418const optionsStore = useOptionsStore ()
@@ -67,46 +61,10 @@ function onSort(event: { oldIndex: number; newIndex: number }) {
6761 :option =" option "
6862 :draggable =" true "
6963 show-owner>
70- <template v-if =" pollStore .permissions .edit " #actions >
71- <NcActions v-if =" ! pollStore .isClosed " class="action">
72- <NcActionButton
73- v-if =" ! option .deleted "
74- :name =" t (' polls' , ' Delete option' )"
75- :aria-label =" t (' polls' , ' Delete option' )"
76- @click =" optionsStore .delete ({ option })" >
77- <template #icon >
78- <DeleteIcon />
79- </template >
80- </NcActionButton >
81- <NcActionButton
82- v-if =" option .deleted "
83- :name =" t (' polls' , ' Restore option' )"
84- :aria-label =" t (' polls' , ' Restore option' )"
85- @click =" optionsStore .restore ({ option })" >
86- <template #icon >
87- <RestoreIcon />
88- </template >
89- </NcActionButton >
90- <NcActionButton
91- v-if =" ! option .deleted && ! pollStore .isClosed "
92- :name ="
93- option .confirmed
94- ? t (' polls' , ' Unconfirm option' )
95- : t (' polls' , ' Confirm option' )
96- "
97- :aria-label ="
98- option .confirmed
99- ? t (' polls' , ' Unconfirm option' )
100- : t (' polls' , ' Confirm option' )
101- "
102- type="tertiary"
103- @click =" optionsStore .confirm ({ option })" >
104- <template #icon >
105- <UnconfirmIcon v-if =" option .confirmed " />
106- <ConfirmIcon v-else />
107- </template >
108- </NcActionButton >
109- </NcActions >
64+ <template #actions >
65+ <OptionMenu
66+ v-if =" pollStore .permissions .edit || option .isOwner "
67+ :option =" option " />
11068 </template >
11169 </OptionItem >
11270 </div >
0 commit comments