Remove undraw picture on comments and let the organiser know they are

the only profile that can comment if it's set in the event settings

Signed-off-by: Thomas Citharel <tcit@tcit.fr>
This commit is contained in:
Thomas Citharel 2020-10-20 10:59:56 +02:00
parent fb8e94c4e3
commit d7c0cc158b
No known key found for this signature in database
GPG Key ID: A061B9DDE0CA0773
4 changed files with 29 additions and 13 deletions

File diff suppressed because one or more lines are too long

Before

Width:  |  Height:  |  Size: 6.9 KiB

View File

@ -6,6 +6,9 @@
@submit.prevent="createCommentForEvent(newComment)"
@keyup.ctrl.enter="createCommentForEvent(newComment)"
>
<b-notification v-if="isEventOrganiser && !areCommentsClosed" :closable="false">{{
$t("Comments are closed for everybody else.")
}}</b-notification>
<article class="media">
<figure class="media-left">
<identity-picker-wrapper :inline="false" v-model="newComment.actor" />
@ -22,7 +25,9 @@
</div>
</article>
</form>
<b-notification v-else :closable="false">{{ $t("Comments have been closed.") }}</b-notification>
<b-notification v-else :closable="false">{{
$t("The organiser has chosen to close comments.")
}}</b-notification>
<transition name="comment-empty-list" mode="out-in">
<transition-group name="comment-list" v-if="comments.length" class="comment-list" tag="ul">
<comment
@ -35,9 +40,8 @@
@delete-comment="deleteComment"
/>
</transition-group>
<div v-else class="no-comments">
<div v-else-if="isAbleToComment" class="no-comments">
<span>{{ $t("No comments yet") }}</span>
<img src="../../assets/undraw_just_saying.svg" alt />
</div>
</transition>
</div>
@ -281,14 +285,24 @@ export default class CommentTree extends Vue {
return this.orderedComments.filter((comment) => !comment.deletedAt || comment.totalReplies > 0);
}
get isEventOrganiser(): boolean {
return (
this.currentActor.id !== undefined &&
this.event.organizerActor !== undefined &&
this.currentActor.id === this.event.organizerActor.id
);
}
get areCommentsClosed(): boolean {
return (
this.currentActor.id !== undefined &&
this.event.options.commentModeration !== CommentModeration.CLOSED
);
}
get isAbleToComment(): boolean {
if (this.currentActor.id) {
if (
this.event.options.commentModeration !== CommentModeration.CLOSED ||
(this.event.organizerActor && this.currentActor.id === this.event.organizerActor.id)
) {
return true;
}
return this.areCommentsClosed || this.isEventOrganiser;
}
return false;
}

View File

@ -56,7 +56,6 @@
"Closed": "Closed",
"Comment deleted": "Comment deleted",
"Comment from @{username} reported": "Comment from @{username} reported",
"Comments have been closed.": "Comments have been closed.",
"Comments": "Comments",
"Confirm my participation": "Confirm my participation",
"Confirm my particpation": "Confirm my particpation",
@ -805,5 +804,7 @@
"Instances you follow": "Instances you follow",
"Last group created": "Last group created",
"{username} was invited to {group}": "{username} was invited to {group}",
"The member was removed from the group {group}": "The member was removed from the group {group}"
"The member was removed from the group {group}": "The member was removed from the group {group}",
"The organiser has chosen to close comments.": "The organiser has chosen to close comments.",
"Comments are closed for everybody else.": "Comments are closed for everybody else."
}

View File

@ -855,5 +855,7 @@
"Instances you follow": "Instances que vous suivez",
"Last group created": "Dernier groupe créé",
"{username} was invited to {group}": "{username} a été invité à {group}",
"The member was removed from the group {group}": "Le ou la membre a été supprimé·e du groupe {group}"
"The member was removed from the group {group}": "Le ou la membre a été supprimé·e du groupe {group}",
"The organiser has chosen to close comments.": "L'organisateur·ice a choisi de fermer les commentaires.",
"Comments are closed for everybody else.": "Les commentaires sont fermés pour tous·tes les autres."
}