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. 19
      assets/vue/components/resource_links/ShowLinks.vue

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

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

Loading…
Cancel
Save