Display persons
This commit is contained in:
parent
e49a4971ae
commit
15d6baac81
|
|
@ -15,7 +15,60 @@ const { loading: loadingPersons, dashboardPersons } = useDashboardPersons();
|
|||
</div>
|
||||
<div v-else class="bg-gray-200">
|
||||
<div class="container-large">
|
||||
{{ dashboardPersons }}
|
||||
<div class="bg-white px-4 py-2">
|
||||
<div
|
||||
v-for="person in dashboardPersons"
|
||||
:key="person.user_id"
|
||||
data-cy="person"
|
||||
class="flex flex-col justify-between gap-4 border-b p-2 last:border-b-0 md:flex-row md:items-center md:justify-between md:gap-16"
|
||||
>
|
||||
<div class="w-full flex-auto md:w-1/3">
|
||||
<div class="flex items-center space-x-2">
|
||||
<img
|
||||
:alt="person.last_name"
|
||||
class="h-11 w-11 rounded-full"
|
||||
:src="'/static/avatars/myvbv-default-avatar.png'"
|
||||
/>
|
||||
<div>
|
||||
<div class="text-bold">
|
||||
{{ person.first_name }}
|
||||
{{ person.last_name }}
|
||||
</div>
|
||||
<div class="text-gray-900">{{ person.email }}</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="w-full flex-auto items-start md:w-2/3">
|
||||
<div
|
||||
v-for="cs in person.course_sessions"
|
||||
:key="cs.id"
|
||||
class="w-full border-b pb-2 pt-2 first:pt-0 last:border-b-0 last:pb-0"
|
||||
>
|
||||
<div class="flex flex-col md:flex-row md:items-center">
|
||||
<div class="md:w-1/2">
|
||||
<div class="text-gray-900">{{ cs.course_title }}</div>
|
||||
<div v-if="cs.is_uk">{{ cs.session_title }}</div>
|
||||
</div>
|
||||
<div class="md:w-1/4">
|
||||
<div>{{ cs.user_role }}</div>
|
||||
</div>
|
||||
<div class="md:w-1/4 md:text-right">
|
||||
<div>action</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- <button-->
|
||||
<!-- class="underline"-->
|
||||
<!-- data-cy="lm-my-mentor-remove"-->
|
||||
<!-- @click="removeMyMentor(learningMentor.id)"-->
|
||||
<!-- >-->
|
||||
<!-- {{ $t("a.Entfernen") }}-->
|
||||
<!-- </button>-->
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -26,6 +26,8 @@ export type DashboardPersonCourseSessionType = {
|
|||
course_title: string;
|
||||
user_role: DashboardPersonRoleType;
|
||||
my_role: DashboardPersonRoleType;
|
||||
is_uk: boolean;
|
||||
is_vv: boolean;
|
||||
};
|
||||
|
||||
export type DashboardPersonType = {
|
||||
|
|
|
|||
|
|
@ -101,6 +101,8 @@ def get_dashboard_persons(request):
|
|||
"course_title": cs.course.title,
|
||||
"user_role": csu.role,
|
||||
"my_role": my_role,
|
||||
"is_uk": cs.course.configuration.is_uk,
|
||||
"is_vv": cs.course.configuration.is_vv,
|
||||
}
|
||||
],
|
||||
}
|
||||
|
|
@ -120,6 +122,8 @@ def get_dashboard_persons(request):
|
|||
"course_title": cs.course.title,
|
||||
"user_role": "LEARNING_MENTEE",
|
||||
"my_role": "LEARNING_MENTOR",
|
||||
"is_uk": cs.course.configuration.is_uk,
|
||||
"is_vv": cs.course.configuration.is_vv,
|
||||
}
|
||||
|
||||
if participant.user.id not in result_persons:
|
||||
|
|
@ -141,13 +145,16 @@ def get_dashboard_persons(request):
|
|||
participants__user=request.user
|
||||
).prefetch_related("mentor", "course_session")
|
||||
for mentor_relation in mentor_relation_qs:
|
||||
cs = mentor_relation.course_session
|
||||
course_session_entry = {
|
||||
"id": mentor_relation.course_session.id,
|
||||
"session_title": mentor_relation.course_session.title,
|
||||
"course_id": mentor_relation.course_session.course.id,
|
||||
"course_title": mentor_relation.course_session.course.title,
|
||||
"id": cs.id,
|
||||
"session_title": cs.title,
|
||||
"course_id": cs.course.id,
|
||||
"course_title": cs.course.title,
|
||||
"user_role": "LEARNING_MENTOR",
|
||||
"my_role": "LEARNING_MENTEE",
|
||||
"is_uk": cs.course.configuration.is_uk,
|
||||
"is_vv": cs.course.configuration.is_vv,
|
||||
}
|
||||
|
||||
if mentor_relation.mentor.id not in result_persons:
|
||||
|
|
|
|||
Loading…
Reference in New Issue