diff options
| author | Ron Lucke <lucke@elan-ev.de> | 2023-12-18 12:03:38 +0000 |
|---|---|---|
| committer | Ron Lucke <lucke@elan-ev.de> | 2023-12-18 12:03:38 +0000 |
| commit | ba52642f0634f211432e877d9dff0d2dec75d806 (patch) | |
| tree | a8da0636d714b4f29bc00439dc2f17c5fa995618 /resources/vue/components/courseware/blocks/CoursewareBlockActions.vue | |
| parent | e09c643e2ed3719b081ce3ee3b55fb15cbd04274 (diff) | |
StEP #3255
Merge request studip/studip!2355
Diffstat (limited to 'resources/vue/components/courseware/blocks/CoursewareBlockActions.vue')
| -rw-r--r-- | resources/vue/components/courseware/blocks/CoursewareBlockActions.vue | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/resources/vue/components/courseware/blocks/CoursewareBlockActions.vue b/resources/vue/components/courseware/blocks/CoursewareBlockActions.vue index 3ffff18..89beb0a 100644 --- a/resources/vue/components/courseware/blocks/CoursewareBlockActions.vue +++ b/resources/vue/components/courseware/blocks/CoursewareBlockActions.vue @@ -9,6 +9,9 @@ @deleteBlock="deleteBlock" @removeLock="removeLock" @copyToClipboard="copyToClipboard" + @deactivateComments="deactivateComments" + @activateComments="activateComments" + @showFeedback="showFeedback" /> </div> </template> @@ -34,6 +37,7 @@ export default { ...mapGetters({ userId: 'userId', userIsTeacher: 'userIsTeacher', + getRelatedFeedback: 'courseware-block-feedback/related', }), blocked() { return this.block?.relationships?.['edit-blocker']?.data !== null; @@ -47,6 +51,16 @@ export default { blockedByAnotherUser() { return this.blocked && this.userId !== this.blockerId; }, + hasFeedback() { + const { id, type } = this.block; + const feedback = this.getRelatedFeedback({ parent: { id, type }, relationship: 'feedback' }); + + if (feedback === null || feedback.length === 0) { + return false; + } + + return true; + }, menuItems() { let menuItems = []; if (this.canEdit) { @@ -61,6 +75,16 @@ export default { icon: this.block.attributes.visible ? 'visibility-visible' : 'visibility-invisible', // do we change the icons ? emit: 'setVisibility', }); + if (this.userIsTeacher) { + menuItems.push({ + id: 4, + label: this.block.attributes.commentable + ? this.$gettext('Kommentare abschalten') + : this.$gettext('Kommentare aktivieren'), + icon: 'comment2', + emit: this.block.attributes.commentable ? 'deactivateComments' : 'activateComments', + }); + } } if (this.blocked && this.blockedByAnotherUser && this.userIsTeacher) { menuItems.push({ @@ -145,6 +169,15 @@ export default { }, copyToClipboard() { this.$emit('copyToClipboard'); + }, + activateComments() { + this.$emit('activateComments') + }, + deactivateComments() { + this.$emit('deactivateComments') + }, + showFeedback() { + this.$emit('showFeedback'); } }, }; |
