Agenda: Add clickable course links in agenda events - refs #3452

pull/5805/head
christianbeeznst 2 months ago
parent da69428831
commit 589ff501d6
  1. 1
      assets/vue/components/ccalendarevent/CCalendarEventInfo.vue
  2. 21
      assets/vue/components/resource_links/ShowLinks.vue

@ -25,6 +25,7 @@
v-else
:item="event"
:show-status="false"
:clickable-course="true"
/>
<CalendarRemindersInfo :event="event" />

@ -6,7 +6,16 @@
>
<div v-if="link.course" :class="{ 'text-right text-body-2': editStatus }">
<span class="mdi mdi-book"></span>
{{ $t("Course") }}: {{ link.course.resourceNode.title }}
<BaseAppLink
v-if="clickableCourse"
:to="{
name: 'CourseHome',
params: { id: courseId(link.course) }
}"
>
{{ $t("Course") }}: {{ link.course.resourceNode.title }}
</BaseAppLink>
<span v-else>{{ $t("Course") }}: {{ link.course.resourceNode.title }}</span>
</div>
<div
@ -56,6 +65,7 @@
<script setup>
import { RESOURCE_LINK_DRAFT, RESOURCE_LINK_PUBLISHED } from "../../constants/entity/resourcelink"
import { useI18n } from "vue-i18n"
import BaseAppLink from "../basecomponents/BaseAppLink.vue"
const { t } = useI18n()
@ -77,8 +87,17 @@ defineProps({
required: false,
default: false,
},
clickableCourse: {
type: Boolean,
required: false,
default: false,
},
})
const courseId = (course) => {
return course['@id'] ? course['@id'].split('/').pop() : null;
}
const visibilityOptions = [
{ value: RESOURCE_LINK_PUBLISHED, label: t("Published") },
{ value: RESOURCE_LINK_DRAFT, label: t("Draft") },

Loading…
Cancel
Save