Skip to content

Commit b35c690

Browse files
committed
Format AppNavigationForm.vue (refs #3099)
Signed-off-by: don9x2E <revan@kakao.com>
1 parent 66d0be7 commit b35c690

1 file changed

Lines changed: 103 additions & 98 deletions

File tree

src/components/AppNavigationForm.vue

Lines changed: 103 additions & 98 deletions
Original file line numberDiff line numberDiff line change
@@ -4,104 +4,109 @@
44
-->
55

66
<template>
7-
<NcListItem
8-
:active="isActive"
9-
:actions-aria-label="t('forms', 'Form actions')"
10-
:counter-number="form.submissionCount"
11-
compact
12-
:force-display-actions="forceDisplayActions"
13-
:name="formTitle"
14-
:to="{
15-
name: routerTarget,
16-
params: { hash: form.hash },
17-
}"
18-
@click="mobileCloseNavigation">
19-
<template #icon>
20-
<NcLoadingIcon v-if="loading" :size="16" />
21-
<IconCheck v-else-if="isExpired" :size="16" />
22-
<FormsIcon v-else :size="16" />
23-
</template>
24-
<template v-if="hasSubtitle" #subname>
25-
{{ formSubtitle }}
26-
</template>
27-
<template
28-
v-if="!loading && (!readOnly || canEdit || canSeeResults)"
29-
#actions>
30-
<NcActionRouter
31-
v-if="!isArchived && canEdit"
32-
close-after-click
33-
:disabled="isFormLocked"
34-
exact
35-
:to="{ name: 'edit', params: { hash: form.hash } }"
36-
@click="mobileCloseNavigation">
37-
<template #icon>
38-
<IconPencil :size="20" />
39-
</template>
40-
{{ t('forms', 'Edit form') }}
41-
</NcActionRouter>
42-
<NcActionButton
43-
v-if="!isArchived && !readOnly"
44-
close-after-click
45-
@click="onShareForm">
46-
<template #icon>
47-
<IconShareVariant :size="20" />
48-
</template>
49-
{{ t('forms', 'Share form') }}
50-
</NcActionButton>
51-
<NcActionRouter
52-
v-if="canSeeResults"
53-
close-after-click
54-
exact
55-
:to="{ name: 'results', params: { hash: form.hash } }"
56-
@click="mobileCloseNavigation">
57-
<template #icon>
58-
<IconPoll :size="20" />
59-
</template>
60-
{{ t('forms', 'Results') }}
61-
</NcActionRouter>
62-
<NcActionButton v-if="canEdit" close-after-click @click="onCloneForm">
63-
<template #icon>
64-
<IconContentCopy :size="20" />
65-
</template>
66-
{{ t('forms', 'Copy form') }}
67-
</NcActionButton>
68-
<NcActionSeparator v-if="canEdit && !readOnly" />
69-
<NcActionButton
70-
v-if="canEdit && !readOnly"
71-
close-after-click
72-
:disabled="isFormLocked"
73-
@click="onToggleArchive">
74-
<template #icon>
75-
<IconArchiveOff v-if="isArchived" :size="20" />
76-
<IconArchive v-else :size="20" />
77-
</template>
78-
{{
79-
isArchived
80-
? t('forms', 'Unarchive form')
81-
: t('forms', 'Archive form')
82-
}}
83-
</NcActionButton>
84-
<NcActionButton
85-
v-if="canEdit && !readOnly"
86-
close-after-click
87-
:disabled="isFormLocked"
88-
@click="showDeleteDialog = true">
89-
<template #icon>
90-
<IconDelete :size="20" />
91-
</template>
92-
{{ t('forms', 'Delete form') }}
93-
</NcActionButton>
94-
<NcDialog
95-
:open.sync="showDeleteDialog"
96-
:name="t('forms', 'Delete form')"
97-
:message="
98-
t('forms', 'Are you sure you want to delete {title}?', {
99-
title: formTitle,
100-
})
101-
"
102-
:buttons="buttons" />
103-
</template>
104-
</NcListItem>
7+
<div>
8+
<NcListItem
9+
:active="isActive"
10+
:actions-aria-label="t('forms', 'Form actions')"
11+
:counter-number="form.submissionCount"
12+
compact
13+
:force-display-actions="forceDisplayActions"
14+
:name="formTitle"
15+
:to="{
16+
name: routerTarget,
17+
params: { hash: form.hash },
18+
}"
19+
@click="mobileCloseNavigation">
20+
<template #icon>
21+
<NcLoadingIcon v-if="loading" :size="16" />
22+
<IconCheck v-else-if="isExpired" :size="16" />
23+
<FormsIcon v-else :size="16" />
24+
</template>
25+
<template v-if="hasSubtitle" #subname>
26+
{{ formSubtitle }}
27+
</template>
28+
<template
29+
v-if="!loading && (!readOnly || canEdit || canSeeResults)"
30+
#actions>
31+
<NcActionRouter
32+
v-if="!isArchived && canEdit"
33+
close-after-click
34+
:disabled="isFormLocked"
35+
exact
36+
:to="{ name: 'edit', params: { hash: form.hash } }"
37+
@click="mobileCloseNavigation">
38+
<template #icon>
39+
<IconPencil :size="20" />
40+
</template>
41+
{{ t('forms', 'Edit form') }}
42+
</NcActionRouter>
43+
<NcActionButton
44+
v-if="!isArchived && !readOnly"
45+
close-after-click
46+
@click="onShareForm">
47+
<template #icon>
48+
<IconShareVariant :size="20" />
49+
</template>
50+
{{ t('forms', 'Share form') }}
51+
</NcActionButton>
52+
<NcActionRouter
53+
v-if="canSeeResults"
54+
close-after-click
55+
exact
56+
:to="{ name: 'results', params: { hash: form.hash } }"
57+
@click="mobileCloseNavigation">
58+
<template #icon>
59+
<IconPoll :size="20" />
60+
</template>
61+
{{ t('forms', 'Results') }}
62+
</NcActionRouter>
63+
<NcActionButton
64+
v-if="canEdit"
65+
close-after-click
66+
@click="onCloneForm">
67+
<template #icon>
68+
<IconContentCopy :size="20" />
69+
</template>
70+
{{ t('forms', 'Copy form') }}
71+
</NcActionButton>
72+
<NcActionSeparator v-if="canEdit && !readOnly" />
73+
<NcActionButton
74+
v-if="canEdit && !readOnly"
75+
close-after-click
76+
:disabled="isFormLocked"
77+
@click="onToggleArchive">
78+
<template #icon>
79+
<IconArchiveOff v-if="isArchived" :size="20" />
80+
<IconArchive v-else :size="20" />
81+
</template>
82+
{{
83+
isArchived
84+
? t('forms', 'Unarchive form')
85+
: t('forms', 'Archive form')
86+
}}
87+
</NcActionButton>
88+
<NcActionButton
89+
v-if="canEdit && !readOnly"
90+
close-after-click
91+
:disabled="isFormLocked"
92+
@click="showDeleteDialog = true">
93+
<template #icon>
94+
<IconDelete :size="20" />
95+
</template>
96+
{{ t('forms', 'Delete form') }}
97+
</NcActionButton>
98+
</template>
99+
</NcListItem>
100+
<NcDialog
101+
:open.sync="showDeleteDialog"
102+
:name="t('forms', 'Delete form')"
103+
:message="
104+
t('forms', 'Are you sure you want to delete {title}?', {
105+
title: formTitle,
106+
})
107+
"
108+
:buttons="buttons" />
109+
</div>
105110
</template>
106111

107112
<script>

0 commit comments

Comments
 (0)