diff --git a/assets/vue/components/Breadcrumb.vue b/assets/vue/components/Breadcrumb.vue index 97f9fd51a6..a91308b82f 100644 --- a/assets/vue/components/Breadcrumb.vue +++ b/assets/vue/components/Breadcrumb.vue @@ -26,7 +26,7 @@ diff --git a/assets/vue/components/resource_links/ShowLinks.vue b/assets/vue/components/resource_links/ShowLinks.vue index 3c195224bb..b0110dc665 100644 --- a/assets/vue/components/resource_links/ShowLinks.vue +++ b/assets/vue/components/resource_links/ShowLinks.vue @@ -6,7 +6,16 @@ >
- {{ $t("Course") }}: {{ link.course.resourceNode.title }} + + {{ $t("Course") }}: {{ link.course.resourceNode.title }} + + {{ $t("Course") }}: {{ link.course.resourceNode.title }}
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") }, diff --git a/assets/vue/composables/fileUtils.js b/assets/vue/composables/fileUtils.js index 3709dee2fe..0e0f87381b 100644 --- a/assets/vue/composables/fileUtils.js +++ b/assets/vue/composables/fileUtils.js @@ -1,4 +1,8 @@ export function useFileUtils() { + const isFile = (fileData) => { + return fileData.resourceNode && fileData.resourceNode.firstResourceFile + } + const isImage = (fileData) => { return isFile(fileData) && fileData.resourceNode.firstResourceFile.image } @@ -21,8 +25,9 @@ export function useFileUtils() { return mimeType.split("/")[1].toLowerCase() === "html" } - const isFile = (fileData) => { - return fileData.resourceNode && fileData.resourceNode.firstResourceFile + const isPreviewable = (fileData) => { + const mimeType = fileData.resourceNode.firstResourceFile.mimeType.toLowerCase() + return isImage(fileData) || isVideo(fileData) || isAudio(fileData) || isHtml(fileData) || mimeType === "application/pdf" } return { @@ -31,5 +36,6 @@ export function useFileUtils() { isVideo, isAudio, isHtml, + isPreviewable, } } diff --git a/assets/vue/router/admin.js b/assets/vue/router/admin.js index 8d4f0f29d6..eaaf86b494 100644 --- a/assets/vue/router/admin.js +++ b/assets/vue/router/admin.js @@ -1,19 +1,19 @@ export default { path: '/admin', name: 'admin', - meta: { requiresAuth: true }, + meta: { requiresAuth: true, showBreadcrumb: true }, component: () => import('../components/admin/AdminLayout.vue'), children: [ { path: '', name: 'AdminIndex', - meta: { requiresAdmin: true, requiresSessionAdmin: true }, + meta: { requiresAdmin: true, requiresSessionAdmin: true, showBreadcrumb: false }, component: () => import('../views/admin/AdminIndex.vue'), }, { name: 'AdminConfigurationColors', path: 'configuration/colors', - meta: { requiresAdmin: true, requiresSessionAdmin: true }, + meta: { requiresAdmin: true, requiresSessionAdmin: true, showBreadcrumb: true }, component: () => import('../views/admin/AdminConfigureColors.vue'), } ], diff --git a/assets/vue/views/course/CatalogueCourses.vue b/assets/vue/views/course/CatalogueCourses.vue index 9b3236019a..6d609e90a4 100644 --- a/assets/vue/views/course/CatalogueCourses.vue +++ b/assets/vue/views/course/CatalogueCourses.vue @@ -152,16 +152,39 @@ >