2020-03-12 14:29:21 +01:00
|
|
|
<template>
|
2020-06-19 19:27:10 +02:00
|
|
|
<aside>
|
|
|
|
<ul>
|
2020-06-25 11:36:35 +02:00
|
|
|
<SettingMenuSection :title="$t('Account')" :to="{ name: RouteName.ACCOUNT_SETTINGS }">
|
|
|
|
<SettingMenuItem
|
|
|
|
:title="this.$t('General')"
|
|
|
|
:to="{ name: RouteName.ACCOUNT_SETTINGS_GENERAL }"
|
|
|
|
/>
|
|
|
|
<SettingMenuItem :title="$t('Preferences')" :to="{ name: RouteName.PREFERENCES }" />
|
|
|
|
<SettingMenuItem
|
|
|
|
:title="this.$t('Email notifications')"
|
|
|
|
:to="{ name: RouteName.NOTIFICATIONS }"
|
|
|
|
/>
|
|
|
|
</SettingMenuSection>
|
|
|
|
<SettingMenuSection :title="$t('Profiles')" :to="{ name: RouteName.IDENTITIES }">
|
|
|
|
<SettingMenuItem
|
|
|
|
v-for="profile in identities"
|
|
|
|
:key="profile.preferredUsername"
|
|
|
|
:title="profile.preferredUsername"
|
|
|
|
:to="{
|
|
|
|
name: RouteName.UPDATE_IDENTITY,
|
|
|
|
params: { identityName: profile.preferredUsername },
|
|
|
|
}"
|
|
|
|
/>
|
|
|
|
<SettingMenuItem :title="$t('New profile')" :to="{ name: RouteName.CREATE_IDENTITY }" />
|
|
|
|
</SettingMenuSection>
|
2020-06-19 19:27:10 +02:00
|
|
|
<SettingMenuSection
|
2020-06-25 11:36:35 +02:00
|
|
|
v-if="
|
|
|
|
[ICurrentUserRole.MODERATOR, ICurrentUserRole.ADMINISTRATOR].includes(
|
|
|
|
this.currentUser.role
|
|
|
|
)
|
|
|
|
"
|
|
|
|
:title="$t('Moderation')"
|
|
|
|
:to="{ name: RouteName.MODERATION }"
|
|
|
|
>
|
|
|
|
<SettingMenuItem :title="$t('Reports')" :to="{ name: RouteName.REPORTS }" />
|
|
|
|
<SettingMenuItem :title="$t('Moderation log')" :to="{ name: RouteName.REPORT_LOGS }" />
|
|
|
|
<SettingMenuItem :title="$t('Users')" :to="{ name: RouteName.USERS }" />
|
|
|
|
<SettingMenuItem :title="$t('Profiles')" :to="{ name: RouteName.PROFILES }" />
|
2020-08-27 11:53:24 +02:00
|
|
|
<SettingMenuItem :title="$t('Groups')" :to="{ name: RouteName.ADMIN_GROUPS }" />
|
2020-06-25 11:36:35 +02:00
|
|
|
</SettingMenuSection>
|
|
|
|
<SettingMenuSection
|
|
|
|
v-if="this.currentUser.role == ICurrentUserRole.ADMINISTRATOR"
|
|
|
|
:title="$t('Admin')"
|
|
|
|
:to="{ name: RouteName.ADMIN }"
|
|
|
|
>
|
|
|
|
<SettingMenuItem :title="$t('Dashboard')" :to="{ name: RouteName.ADMIN_DASHBOARD }" />
|
|
|
|
<SettingMenuItem
|
|
|
|
:title="$t('Instance settings')"
|
|
|
|
:to="{ name: RouteName.ADMIN_SETTINGS }"
|
|
|
|
/>
|
|
|
|
<SettingMenuItem :title="$t('Federation')" :to="{ name: RouteName.RELAYS }" />
|
|
|
|
</SettingMenuSection>
|
2020-06-19 19:27:10 +02:00
|
|
|
</ul>
|
|
|
|
</aside>
|
2020-03-12 14:29:21 +01:00
|
|
|
</template>
|
|
|
|
<script lang="ts">
|
2020-02-18 08:57:00 +01:00
|
|
|
import { Component, Prop, Vue } from "vue-property-decorator";
|
2020-06-25 11:36:35 +02:00
|
|
|
import SettingMenuSection from "./SettingMenuSection.vue";
|
|
|
|
import SettingMenuItem from "./SettingMenuItem.vue";
|
|
|
|
import { IDENTITIES } from "../../graphql/actor";
|
|
|
|
import { IPerson, Person } from "../../types/actor";
|
|
|
|
import { CURRENT_USER_CLIENT } from "../../graphql/user";
|
|
|
|
import { ICurrentUser, ICurrentUserRole } from "../../types/current-user.model";
|
|
|
|
|
|
|
|
import RouteName from "../../router/name";
|
2020-07-09 17:24:28 +02:00
|
|
|
|
2020-03-12 14:29:21 +01:00
|
|
|
@Component({
|
2020-06-25 11:36:35 +02:00
|
|
|
components: { SettingMenuSection, SettingMenuItem },
|
|
|
|
apollo: {
|
|
|
|
identities: {
|
|
|
|
query: IDENTITIES,
|
|
|
|
update: (data) => data.identities.map((identity: IPerson) => new Person(identity)),
|
|
|
|
},
|
|
|
|
currentUser: CURRENT_USER_CLIENT,
|
|
|
|
},
|
2020-03-12 14:29:21 +01:00
|
|
|
})
|
|
|
|
export default class SettingsMenu extends Vue {
|
2020-06-25 11:36:35 +02:00
|
|
|
profiles = [];
|
|
|
|
|
|
|
|
currentUser!: ICurrentUser;
|
|
|
|
|
|
|
|
identities!: IPerson[];
|
|
|
|
|
|
|
|
ICurrentUserRole = ICurrentUserRole;
|
2020-03-12 14:29:21 +01:00
|
|
|
|
2020-06-25 11:36:35 +02:00
|
|
|
RouteName = RouteName;
|
2020-03-12 14:29:21 +01:00
|
|
|
}
|
2020-02-18 08:57:00 +01:00
|
|
|
</script>
|
2020-06-17 15:54:24 +02:00
|
|
|
<style lang="scss" scoped>
|
2020-11-16 10:04:47 +01:00
|
|
|
::v-deep a {
|
2020-06-17 15:54:24 +02:00
|
|
|
text-decoration: none;
|
|
|
|
}
|
|
|
|
</style>
|