|
|
|
@ -1,68 +1,35 @@ |
|
|
|
|
<template> |
|
|
|
|
<v-card |
|
|
|
|
v-if="course" |
|
|
|
|
elevation="4" |
|
|
|
|
> |
|
|
|
|
<div class=""> |
|
|
|
|
<img class="object-cover w-full h-44" :src="course.illustrationUrl" /> |
|
|
|
|
</div> |
|
|
|
|
<div class="p-4"> |
|
|
|
|
<div class="h-10 flex flex-row justify-between"> |
|
|
|
|
<div class="line-clamp-2 text-md w-5/6"> |
|
|
|
|
<router-link :to="{ name: 'CourseHome', params: {id: course._id, course: course}, query: { sid: sessionId } }"> |
|
|
|
|
<span v-if="session"> |
|
|
|
|
{{ session.name }} - |
|
|
|
|
</span> |
|
|
|
|
{{ course.title }} |
|
|
|
|
</router-link> |
|
|
|
|
</div> |
|
|
|
|
<div> |
|
|
|
|
<v-icon icon="mdi-dots-vertical" /> |
|
|
|
|
</div> |
|
|
|
|
</div> |
|
|
|
|
|
|
|
|
|
<div v-if="course.users" class="pt-6"> |
|
|
|
|
<div class="flex flex-row" v-if="course.users.edges.length"> |
|
|
|
|
<div class="flex flex-row pr-3" v-for="courseRelUser in course.users.edges"> |
|
|
|
|
<div class="pr-2"> |
|
|
|
|
<img class="inline-block h-8 w-8 rounded-full ring-2 ring-white" |
|
|
|
|
:src="courseRelUser.node.user.illustrationUrl + '?w=80&h=80&fit=crop'" |
|
|
|
|
alt="" |
|
|
|
|
/> |
|
|
|
|
</div> |
|
|
|
|
<div v-if="course.users.edges.length < 3 " class="flex-col"> |
|
|
|
|
<div> |
|
|
|
|
{{ courseRelUser.node.user.firstname }} {{ courseRelUser.node.user.lastname }} |
|
|
|
|
</div> |
|
|
|
|
</div> |
|
|
|
|
</div> |
|
|
|
|
</div> |
|
|
|
|
</div> |
|
|
|
|
<!-- <q-card-actions>--> |
|
|
|
|
<!-- <q-btn--> |
|
|
|
|
<!-- type="a"--> |
|
|
|
|
<!-- :to="{ name: 'CourseHome', params: {id: course.id, course: course}}"--> |
|
|
|
|
<!-- text-color="white"--> |
|
|
|
|
<!-- color="primary"--> |
|
|
|
|
<!-- label="Go"--> |
|
|
|
|
<!-- />--> |
|
|
|
|
<!-- </q-card-actions>--> |
|
|
|
|
|
|
|
|
|
</div> |
|
|
|
|
</v-card> |
|
|
|
|
<Card class="course-card"> |
|
|
|
|
<template #header> |
|
|
|
|
<img |
|
|
|
|
:src="course.illustrationUrl" |
|
|
|
|
:alt="course.title" |
|
|
|
|
> |
|
|
|
|
</template> |
|
|
|
|
<template #title> |
|
|
|
|
<router-link |
|
|
|
|
:to="{ name: 'CourseHome', params: {id: course._id, course: course}, query: { sid: sessionId } }" |
|
|
|
|
class="course-card__home-link" |
|
|
|
|
> |
|
|
|
|
<span v-if="session"> |
|
|
|
|
{{ session.name }} - |
|
|
|
|
</span> |
|
|
|
|
{{ course.title }} |
|
|
|
|
</router-link> |
|
|
|
|
</template> |
|
|
|
|
<template #footer> |
|
|
|
|
<TeacherBar :teachers="teachers" /> |
|
|
|
|
</template> |
|
|
|
|
</Card> |
|
|
|
|
</template> |
|
|
|
|
|
|
|
|
|
<style scoped> |
|
|
|
|
.my-card { |
|
|
|
|
width: 100%; |
|
|
|
|
max-width: 370px; |
|
|
|
|
} |
|
|
|
|
</style> |
|
|
|
|
<script> |
|
|
|
|
<script setup> |
|
|
|
|
import Card from 'primevue/card'; |
|
|
|
|
import TeacherBar from '../TeacherBar'; |
|
|
|
|
|
|
|
|
|
export default { |
|
|
|
|
name: 'CourseCard', |
|
|
|
|
props: { |
|
|
|
|
// eslint-disable-next-line no-undef |
|
|
|
|
const props = defineProps( |
|
|
|
|
{ |
|
|
|
|
course: Object, |
|
|
|
|
session: Object, |
|
|
|
|
sessionId: { |
|
|
|
@ -70,12 +37,13 @@ export default { |
|
|
|
|
required: false, |
|
|
|
|
default: 0 |
|
|
|
|
} |
|
|
|
|
}, |
|
|
|
|
data() { |
|
|
|
|
return { |
|
|
|
|
}; |
|
|
|
|
}, |
|
|
|
|
methods: { |
|
|
|
|
} |
|
|
|
|
}; |
|
|
|
|
); |
|
|
|
|
|
|
|
|
|
const teachers = props.course.users.edges.map( |
|
|
|
|
edge => ({ |
|
|
|
|
id: edge.node.id, |
|
|
|
|
...edge.node.user, |
|
|
|
|
}) |
|
|
|
|
); |
|
|
|
|
</script> |
|
|
|
|