File tree Expand file tree Collapse file tree 2 files changed +21
-1
lines changed Expand file tree Collapse file tree 2 files changed +21
-1
lines changed Original file line number Diff line number Diff line change 25
25
v-else
26
26
:item =" event"
27
27
:show-status =" false"
28
+ :clickable-course =" true"
28
29
/>
29
30
30
31
<CalendarRemindersInfo :event =" event" />
Original file line number Diff line number Diff line change 6
6
>
7
7
<div v-if =" link.course" :class =" { 'text-right text-body-2': editStatus }" >
8
8
<span class =" mdi mdi-book" ></span >
9
- {{ $t("Course") }}: {{ link.course.resourceNode.title }}
9
+ <BaseAppLink
10
+ v-if =" clickableCourse"
11
+ :to =" {
12
+ name: 'CourseHome',
13
+ params: { id: courseId(link.course) }
14
+ }"
15
+ >
16
+ {{ $t("Course") }}: {{ link.course.resourceNode.title }}
17
+ </BaseAppLink >
18
+ <span v-else >{{ $t("Course") }}: {{ link.course.resourceNode.title }}</span >
10
19
</div >
11
20
12
21
<div
56
65
<script setup>
57
66
import { RESOURCE_LINK_DRAFT , RESOURCE_LINK_PUBLISHED } from " ../../constants/entity/resourcelink"
58
67
import { useI18n } from " vue-i18n"
68
+ import BaseAppLink from " ../basecomponents/BaseAppLink.vue"
59
69
60
70
const { t } = useI18n ()
61
71
@@ -77,8 +87,17 @@ defineProps({
77
87
required: false ,
78
88
default: false ,
79
89
},
90
+ clickableCourse: {
91
+ type: Boolean ,
92
+ required: false ,
93
+ default: false ,
94
+ },
80
95
})
81
96
97
+ const courseId = (course ) => {
98
+ return course[' @id' ] ? course[' @id' ].split (' /' ).pop () : null ;
99
+ }
100
+
82
101
const visibilityOptions = [
83
102
{ value: RESOURCE_LINK_PUBLISHED , label: t (" Published" ) },
84
103
{ value: RESOURCE_LINK_DRAFT , label: t (" Draft" ) },
You can’t perform that action at this time.
0 commit comments