WIP: Add preview
This commit is contained in:
parent
66220cdfcb
commit
2865328a8e
|
|
@ -24,7 +24,7 @@ onMounted(async () => {
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<div v-if="competence" class="mb-14">
|
<div v-if="competence">
|
||||||
<CompetenceSummaryBox
|
<CompetenceSummaryBox
|
||||||
:fail-count="competence.fail_count"
|
:fail-count="competence.fail_count"
|
||||||
:success-count="competence.success_count"
|
:success-count="competence.success_count"
|
||||||
|
|
|
||||||
|
|
@ -7,6 +7,7 @@ import AssignmentSummary from "@/components/dashboard/AssignmentSummary.vue";
|
||||||
import MentorOpenTasksCount from "@/components/dashboard/MentorOpenTasksCount.vue";
|
import MentorOpenTasksCount from "@/components/dashboard/MentorOpenTasksCount.vue";
|
||||||
import MentorMenteeCount from "@/components/dashboard/MentorMenteeCount.vue";
|
import MentorMenteeCount from "@/components/dashboard/MentorMenteeCount.vue";
|
||||||
import MentorCompetenceSummary from "@/components/dashboard/MentorCompetenceSummary.vue";
|
import MentorCompetenceSummary from "@/components/dashboard/MentorCompetenceSummary.vue";
|
||||||
|
import { getLearningPathUrl } from "@/utils/utils";
|
||||||
|
|
||||||
const mentorWidgets = [
|
const mentorWidgets = [
|
||||||
"MentorTasksWidget",
|
"MentorTasksWidget",
|
||||||
|
|
@ -33,28 +34,62 @@ const numberOfProgressWidgets = computed(() => {
|
||||||
function hasWidget(widget: WidgetType) {
|
function hasWidget(widget: WidgetType) {
|
||||||
return props.courseConfig.widgets.includes(widget);
|
return props.courseConfig.widgets.includes(widget);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function buttonLink(): string {
|
||||||
|
if (props.courseConfig?.role_key === "Member") {
|
||||||
|
return getLearningPathUrl(props.courseConfig?.course_slug);
|
||||||
|
} else if (props.courseConfig?.role_key === "Expert") {
|
||||||
|
return "btn-secondary";
|
||||||
|
} else if (props.courseConfig?.role_key === "Supervisor") {
|
||||||
|
return "btn-secondary";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
function hasActionButton(): boolean {
|
||||||
|
return props.courseConfig.role_key !== "MentorUK";
|
||||||
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<div v-if="courseConfig" class="mb-14 space-y-8">
|
<div v-if="courseConfig" class="mb-14 space-y-8">
|
||||||
<div class="flex flex-col space-y-8 bg-white p-6">
|
<div class="flex flex-col space-y-8 bg-white p-6">
|
||||||
<div class="border-b border-gray-300 pb-8">
|
<div class="border-b border-gray-300 pb-8">
|
||||||
<h3 class="mb-4 text-3xl">{{ courseName }}</h3>
|
<div class="flex flex-row justify-between">
|
||||||
|
<h3 class="mb-4 text-3xl">{{ courseName }}</h3>
|
||||||
|
<a v-if="hasActionButton()" :href="buttonLink()" class="btn btn-sm btn-blue">
|
||||||
|
foo
|
||||||
|
</a>
|
||||||
|
</div>
|
||||||
<p>
|
<p>
|
||||||
<span class="rounded bg-gray-300 px-2 py-1">{{ courseConfig.role_key }}</span>
|
<span class="rounded bg-gray-300 px-2 py-1">{{ courseConfig.role_key }}</span>
|
||||||
|
<router-link
|
||||||
|
v-if="courseConfig.has_preview"
|
||||||
|
:to="getLearningPathUrl(courseConfig.course_slug)"
|
||||||
|
class="inline-block pl-6"
|
||||||
|
target="_blank"
|
||||||
|
>
|
||||||
|
<div class="flex items-center">
|
||||||
|
<span>{{ $t("a.VorschauTeilnehmer") }}</span>
|
||||||
|
<it-icon-external-link class="ml-1 !h-4 !w-4" />
|
||||||
|
</div>
|
||||||
|
</router-link>
|
||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
<LearningPathDiagram
|
<div
|
||||||
v-if="
|
v-if="
|
||||||
hasWidget('ProgressWidget') &&
|
hasWidget('ProgressWidget') &&
|
||||||
courseConfig.session_to_continue_id &&
|
courseConfig.session_to_continue_id &&
|
||||||
courseSlug
|
courseSlug
|
||||||
"
|
"
|
||||||
:key="courseSlug"
|
class="border-b border-gray-300 pb-8"
|
||||||
:course-slug="courseSlug"
|
>
|
||||||
:course-session-id="courseConfig.session_to_continue_id"
|
<LearningPathDiagram
|
||||||
diagram-type="horizontal"
|
:key="courseSlug"
|
||||||
></LearningPathDiagram>
|
:course-slug="courseSlug"
|
||||||
|
:course-session-id="courseConfig.session_to_continue_id"
|
||||||
|
diagram-type="horizontal"
|
||||||
|
></LearningPathDiagram>
|
||||||
|
</div>
|
||||||
<div v-if="numberOfProgressWidgets" class="flex flex-col flex-wrap">
|
<div v-if="numberOfProgressWidgets" class="flex flex-col flex-wrap">
|
||||||
<CompetenceSummary
|
<CompetenceSummary
|
||||||
v-if="hasWidget('CompetenceWidget')"
|
v-if="hasWidget('CompetenceWidget')"
|
||||||
|
|
|
||||||
|
|
@ -287,7 +287,7 @@ def collect_course_sessions_by_course(
|
||||||
|
|
||||||
|
|
||||||
def has_preview(role_key: RoleKeyType) -> bool:
|
def has_preview(role_key: RoleKeyType) -> bool:
|
||||||
return role_key in [RoleKeyType.MENTOR_UK, RoleKeyType.MENTOR_VV]
|
return role_key in [RoleKeyType.MENTOR_VV, RoleKeyType.MENTOR_UK] and not role_key == RoleKeyType.MEMBER
|
||||||
|
|
||||||
|
|
||||||
def get_newest_cs(
|
def get_newest_cs(
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue