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.
115 lines
2.5 KiB
115 lines
2.5 KiB
![]()
4 years ago
|
<template>
|
||
![]()
3 years ago
|
<div class="course-tool">
|
||
|
<a
|
||
![]()
3 years ago
|
:aria-labelledby="`course-tool-${tool.ctool.iid}`"
|
||
![]()
3 years ago
|
:href="goToCourseTool(course, tool)"
|
||
|
class="course-tool__link"
|
||
![]()
2 years ago
|
:class="cardCustomClass"
|
||
![]()
3 years ago
|
>
|
||
|
<span
|
||
![]()
2 years ago
|
:class="tool.tool.icon + ' ' + iconCustomClass"
|
||
![]()
3 years ago
|
aria-hidden="true"
|
||
![]()
3 years ago
|
class="course-tool__icon mdi"
|
||
![]()
3 years ago
|
/>
|
||
|
</a>
|
||
![]()
4 years ago
|
|
||
![]()
3 years ago
|
<a
|
||
|
:id="`course-tool-${tool.ctool.iid}`"
|
||
|
v-t="tool.tool.nameToShow"
|
||
|
:href="goToCourseTool(course, tool)"
|
||
|
class="course-tool__title"
|
||
![]()
2 years ago
|
:class="titleCustomClass"
|
||
![]()
3 years ago
|
/>
|
||
![]()
4 years ago
|
|
||
![]()
3 years ago
|
<div class="course-tool__options">
|
||
|
<button
|
||
![]()
3 years ago
|
v-if="isCurrentTeacher && !isSorting && !isCustomizing"
|
||
![]()
3 years ago
|
@click="changeVisibility(course, tool)"
|
||
|
>
|
||
![]()
2 years ago
|
<BaseIcon
|
||
![]()
2 years ago
|
v-if="isVisible"
|
||
![]()
2 years ago
|
icon="eye-on"
|
||
![]()
3 years ago
|
/>
|
||
![]()
2 years ago
|
<BaseIcon
|
||
![]()
3 years ago
|
v-else
|
||
![]()
2 years ago
|
icon="eye-off"
|
||
![]()
2 years ago
|
class="text-gray-50"
|
||
![]()
3 years ago
|
/>
|
||
|
</button>
|
||
![]()
4 years ago
|
|
||
![]()
3 years ago
|
<a
|
||
![]()
3 years ago
|
v-if="isCurrentTeacher && isCustomizing"
|
||
|
href="#"
|
||
|
>
|
||
![]()
2 years ago
|
<BaseIcon icon="edit" size="small" />
|
||
![]()
3 years ago
|
</a>
|
||
|
|
||
|
<!-- a
|
||
![]()
3 years ago
|
v-if="isCurrentTeacher"
|
||
|
:href="goToSettingCourseTool(course, tool)"
|
||
|
>
|
||
![]()
2 years ago
|
<BaseIcon
|
||
|
icon="cog"
|
||
![]()
3 years ago
|
size="lg"
|
||
![]()
4 years ago
|
/>
|
||
![]()
3 years ago
|
</a -->
|
||
![]()
4 years ago
|
</div>
|
||
|
</div>
|
||
|
</template>
|
||
|
|
||
![]()
3 years ago
|
<script setup>
|
||
![]()
2 years ago
|
import { useStore } from "vuex";
|
||
|
import { computed, inject } from "vue";
|
||
![]()
2 years ago
|
import BaseIcon from "../basecomponents/BaseIcon.vue";
|
||
![]()
4 years ago
|
|
||
![]()
3 years ago
|
const store = useStore();
|
||
![]()
4 years ago
|
|
||
![]()
2 years ago
|
const isSorting = inject("isSorting");
|
||
|
const isCustomizing = inject("isCustomizing");
|
||
![]()
3 years ago
|
|
||
![]()
3 years ago
|
// eslint-disable-next-line no-undef
|
||
![]()
2 years ago
|
const props = defineProps({
|
||
![]()
3 years ago
|
course: {
|
||
|
type: Object,
|
||
![]()
2 years ago
|
required: true
|
||
![]()
3 years ago
|
},
|
||
|
tool: {
|
||
|
type: Object,
|
||
![]()
2 years ago
|
required: true
|
||
![]()
3 years ago
|
},
|
||
|
goToCourseTool: {
|
||
|
type: Function,
|
||
![]()
2 years ago
|
required: true
|
||
![]()
3 years ago
|
},
|
||
|
changeVisibility: {
|
||
|
type: Function,
|
||
![]()
2 years ago
|
required: true
|
||
![]()
3 years ago
|
},
|
||
|
goToSettingCourseTool: {
|
||
|
type: Function,
|
||
![]()
2 years ago
|
required: true
|
||
|
}
|
||
![]()
3 years ago
|
});
|
||
|
|
||
![]()
2 years ago
|
const isCurrentTeacher = computed(() => store.getters["security/isCurrentTeacher"]);
|
||
![]()
2 years ago
|
const cardCustomClass = computed(() => {
|
||
|
if (isVisible.value) {
|
||
|
return '';
|
||
|
}
|
||
|
return 'bg-primary-bgdisabled border-primary-borderdisabled shadow-none ';
|
||
|
})
|
||
|
const iconCustomClass = computed(() => {
|
||
|
if (isVisible.value) {
|
||
|
return 'bg-primary-bgdisabled ';
|
||
|
}
|
||
|
return 'bg-gradient-to-b from-gray-50 to-gray-25 ';
|
||
|
})
|
||
|
const titleCustomClass = computed(() => {
|
||
|
if (isVisible.value) {
|
||
|
return '';
|
||
|
}
|
||
|
return 'text-gray-90 ';
|
||
|
})
|
||
|
const isVisible = computed(() => props.tool.ctool.resourceNode.resourceLinks[0].visibility === 2);
|
||
![]()
4 years ago
|
</script>
|