-
-
Notifications
You must be signed in to change notification settings - Fork 111
Expand file tree
/
Copy pathSettings.vue
More file actions
69 lines (64 loc) · 1.62 KB
/
Settings.vue
File metadata and controls
69 lines (64 loc) · 1.62 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
<!--
- SPDX-FileCopyrightText: 2021 LibreCode coop and LibreCode contributors
- SPDX-License-Identifier: AGPL-3.0-or-later
-->
<template>
<ul>
<NcAppNavigationItem icon="icon-user" :name="t('libresign', 'Account')"
:to="{name: 'Account'}">
<template #icon>
<NcIconSvgWrapper class="account-icon" :path="mdiAccount" :size="20" />
</template>
</NcAppNavigationItem>
<NcAppNavigationItem v-if="isAdmin" icon="icon-settings"
:name="t('libresign', 'Administration')"
:href="getAdminRoute()">
<template #icon>
<NcIconSvgWrapper class="tune-icon" :path="mdiTune" :size="20" />
</template>
</NcAppNavigationItem>
<NcAppNavigationItem icon="icon-star" :name="t('libresign', 'Rate LibreSign ❤️')"
href="https://apps.nextcloud.com/apps/libresign#comments">
<template #icon>
<NcIconSvgWrapper class="star-icon" :path="mdiStar" :size="20" />
</template>
</NcAppNavigationItem>
</ul>
</template>
<script>
import { t } from '@nextcloud/l10n'
import { getCurrentUser } from '@nextcloud/auth'
import { generateUrl } from '@nextcloud/router'
import NcAppNavigationItem from '@nextcloud/vue/components/NcAppNavigationItem'
import NcIconSvgWrapper from '@nextcloud/vue/components/NcIconSvgWrapper'
import {
mdiAccount,
mdiStar,
mdiTune,
} from '@mdi/js'
export default {
name: 'Settings',
components: {
NcAppNavigationItem,
NcIconSvgWrapper,
},
setup() {
return {
mdiAccount,
mdiStar,
mdiTune,
}
},
data() {
return {
isAdmin: getCurrentUser()?.isAdmin ?? false,
}
},
methods: {
t,
getAdminRoute() {
return generateUrl('settings/admin/libresign')
},
},
}
</script>