Chamilo is a learning management system focused on ease of use and accessibility
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
chamilo-lms/assets/vue/components/resource_links/ShowLinks.vue

87 lines
2.0 KiB

<template>
<div
v-for="(link, index) in item.resourceLinkListFromEntity"
:key="index"
class="field space-y-2"
>
<div v-if="link.course" :class="{ 'text-right text-body-2': editStatus }">
<span class="mdi mdi-book"></span>
{{ $t("Course") }}: {{ link.course.resourceNode.title }}
</div>
4 years ago
<div
v-if="link.session"
:class="{ 'text-right text-body-2': editStatus }"
>
<span class="mdi mdi-book-open" />
{{ $t("Session") }}: {{ link.session.title }}
</div>
4 years ago
<div
v-if="link.group"
:class="{ 'text-right text-body-2': editStatus }"
>
<span class="mdi mdi-people" />
{{ $t("Group") }}: {{ link.group.resourceNode.title }}
</div>
4 years ago
<div v-if="link.userGroup">
{{ $t("Class") }}: {{ link.userGroup.resourceNode.title }}
</div>
4 years ago
<div v-if="link.user">
<span class="mdi mdi-account"></span>
{{ link.user.username }}
</div>
<div v-if="showStatus">
{{ $t("Status") }}: {{ link.visibilityName }}
</div>
4 years ago
<div v-if="editStatus">
<div class="p-float-label">
<Dropdown
v-model="link.visibility"
:input-id="`link-${link.id}-status`"
:options="visibilityOptions"
option-label="label"
option-value="value"
/>
<label for="`link-${link.id}-status`">{{ $t("Status") }}</label>
</div>
</div>
</div>
</template>
<script setup>
import { RESOURCE_LINK_DRAFT, RESOURCE_LINK_PUBLISHED } from "../../constants/entity/resourcelink"
import { useI18n } from "vue-i18n"
const { t } = useI18n()
defineProps({
item: {
type: Object,
required: true,
default: () => ({
resourceLinkListFromEntity: [],
}),
},
showStatus: {
type: Boolean,
required: false,
default: true,
},
editStatus: {
type: Boolean,
required: false,
default: false,
},
})
const visibilityOptions = [
{ value: RESOURCE_LINK_PUBLISHED, label: t("Published") },
{ value: RESOURCE_LINK_DRAFT, label: t("Draft") },
]
</script>