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/social/SocialWallComment.vue

55 lines
1.3 KiB

<template>
<q-item>
<q-item-section avatar top>
<q-avatar>
<img :src="comment.sender.illustrationUrl">
</q-avatar>
</q-item-section>
<q-item-section top>
<q-item-label lines="1">
<span class="text-weight-medium">{{ comment.sender.fullName }}</span>
</q-item-label>
<q-item-label v-html="comment.content" />
<q-item-label
:title="$filters.abbreviatedDatetime(comment.sendDate)"
caption
>
{{ $filters.relativeDatetime(comment.sendDate) }}
</q-item-label>
</q-item-section>
<q-item-section side top>
<WallActions
:is-owner="isOwner"
:social-post="comment"
@post-deleted="onCommentDeleted($event)"
/>
</q-item-section>
</q-item>
</template>
<script setup>
import {useStore} from "vuex"
import {computed} from "vue"
import WallActions from "./Actions"
const props = defineProps({
comment: {
type: Object,
required: true
}
})
const emit = defineEmits(['comment-deleted'])
const store = useStore();
const currentUser = store.getters['security/getUser'];
const isOwner = computed(() => currentUser['@id'] === props.comment.sender['@id'])
function onCommentDeleted(event) {
emit('comment-deleted', event);
}
</script>