Skip to content

Commit 1719f62

Browse files
Merge pull request #5805 from christianbeeznest/GH-3452
Agenda: Add clickable course links in agenda events - refs #3452
2 parents b628d55 + 589ff50 commit 1719f62

File tree

2 files changed

+21
-1
lines changed

2 files changed

+21
-1
lines changed

assets/vue/components/ccalendarevent/CCalendarEventInfo.vue

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525
v-else
2626
:item="event"
2727
:show-status="false"
28+
:clickable-course="true"
2829
/>
2930

3031
<CalendarRemindersInfo :event="event" />

assets/vue/components/resource_links/ShowLinks.vue

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,16 @@
66
>
77
<div v-if="link.course" :class="{ 'text-right text-body-2': editStatus }">
88
<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>
1019
</div>
1120

1221
<div
@@ -56,6 +65,7 @@
5665
<script setup>
5766
import { RESOURCE_LINK_DRAFT, RESOURCE_LINK_PUBLISHED } from "../../constants/entity/resourcelink"
5867
import { useI18n } from "vue-i18n"
68+
import BaseAppLink from "../basecomponents/BaseAppLink.vue"
5969
6070
const { t } = useI18n()
6171
@@ -77,8 +87,17 @@ defineProps({
7787
required: false,
7888
default: false,
7989
},
90+
clickableCourse: {
91+
type: Boolean,
92+
required: false,
93+
default: false,
94+
},
8095
})
8196
97+
const courseId = (course) => {
98+
return course['@id'] ? course['@id'].split('/').pop() : null;
99+
}
100+
82101
const visibilityOptions = [
83102
{ value: RESOURCE_LINK_PUBLISHED, label: t("Published") },
84103
{ value: RESOURCE_LINK_DRAFT, label: t("Draft") },

0 commit comments

Comments
 (0)