Skip to content
Snippets Groups Projects
Commit 87fcbeec authored by Julian's avatar Julian
Browse files

Show group member- and ownerships in person overview

parent 3aa5d8b5
No related branches found
No related tags found
2 merge requests!1123Resolve "Finalise Vuetify app as SPA",!1066Translations update from Weblate
<template>
<v-list
v-if="groups.length"
>
<v-list-item
v-for="group in groups"
:key="group.id"
:to="{ name: 'core.group', params: { id: group.id }}"
>
<v-list-item-content>
<v-list-item-title>
{{ group.name }}
<span v-if="group.schoolTerm && group.schoolTerm.name">
({{ group.schoolTerm.name }})
</span>
</v-list-item-title>
</v-list-item-content>
</v-list-item>
</v-list>
<p v-else>
{{ $t("person.no_persons")}}
</p>
</template>
<script>
export default {
name: "GroupList",
props: {
groups: {
type: Array,
required: true,
}
}
}
</script>
<style scoped>
</style>
......@@ -158,6 +158,27 @@
<PersonList :persons="data.person.guardians"/>
</v-card>
</v-col>
<v-col
cols="12"
md="6"
lg="4"
v-if="data.person.memberOf.length || data.person.ownerOf.length"
>
<v-card
v-if="data.person.memberOf.length"
class="mb-6"
>
<v-card-title>{{ $t("group.title_plural") }}</v-card-title>
<GroupList :groups="data.person.memberOf"/>
</v-card>
<v-card
v-if="data.person.ownerOf.length"
>
<v-card-title>{{ $t("group.ownership") }}</v-card-title>
<GroupList :groups="data.person.ownerOf"/>
</v-card>
</v-col>
</v-row>
</template>
</template>
......@@ -165,11 +186,12 @@
</template>
<script>
import GroupList from "../group/GroupList.vue";
import PersonList from "./PersonList.vue";
export default {
name: "PersonOverview",
components: {PersonList},
components: {GroupList, PersonList},
props: {
id: {
type: String,
......
......@@ -31,5 +31,19 @@ query person($id: ID) {
id
fullName
}
memberOf {
id
name
schoolTerm {
name
}
}
ownerOf {
id
name
schoolTerm {
name
}
}
}
}
......@@ -163,7 +163,8 @@
"groups_and_child_groups": "Groups and Child Groups",
"menu_title": "Groups",
"title": "Group",
"title_plural": "Groups"
"title_plural": "Groups",
"ownership": "Group ownership"
},
"ical_feed": {
"menu_title": "Calendar Feeds"
......
......@@ -20,6 +20,7 @@ from .message import MessageType
from .notification import MarkNotificationReadMutation, NotificationType
from .permissions import GlobalPermissionType
from .person import PersonMutation, PersonType
from .school_term import SchoolTermType # noqa
from .search import SearchResultType
from .system_properties import SystemPropertiesType
from .user import UserType
......
from graphene_django import DjangoObjectType
from ..models import SchoolTerm
class SchoolTermType(DjangoObjectType):
class Meta:
model = SchoolTerm
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment