ActivityPub-federated video streaming platform using P2P directly in your web browser
Move delete, delete & redraft actions to options
kimsible45ae994a442d
diff --git a/client/src/app/+videos/+video-watch/comment/video-comment.component.html b/client/src/app/+videos/+video-watch/comment/video-comment.component.htmlindex fdb555d18e..8e44d00522 100644--- a/client/src/app/+videos/+video-watch/comment/video-comment.component.html+++ b/client/src/app/+videos/+video-watch/comment/video-comment.component.html@@ -41,12 +41,10 @@></div><div class="comment-actions">- <div *ngIf="isUserLoggedIn()" (click)="onWantToReply()" class="comment-action-reply" i18n>Reply</div>- <div *ngIf="isRemovableByUser()" (click)="onWantToDelete()" class="comment-action-delete" i18n>Delete</div>- <div *ngIf="isRedraftableByUser()" (click)="onWantToRedraft()" class="comment-action-redraft" i18n>Delete & re-draft</div>+ <div *ngIf="isUserLoggedIn()" tabindex=0 (click)="onWantToReply()" class="comment-action-reply" i18n>Reply</div><my-user-moderation-dropdown- [prependActions]="prependModerationActions"+ [prependActions]="prependModerationActions" tabindex=0buttonSize="small" [account]="commentAccount" [user]="commentUser" i18n-label label="Options" placement="bottom-left auto"></my-user-moderation-dropdown></div>diff --git a/client/src/app/+videos/+video-watch/comment/video-comment.component.scss b/client/src/app/+videos/+video-watch/comment/video-comment.component.scssindex 151e3ba3ac..61fd24c709 100644--- a/client/src/app/+videos/+video-watch/comment/video-comment.component.scss+++ b/client/src/app/+videos/+video-watch/comment/video-comment.component.scss@@ -118,14 +118,12 @@display: flex;::ng-deep .dropdown-toggle,- .comment-action-reply,- .comment-action-delete,- .comment-action-redraft {+ .comment-action-reply {color: pvar(--greyForegroundColor);cursor: pointer;margin-right: 10px;- &:hover {+ &:hover, &:active, &:focus, &:focus-visible {color: pvar(--mainForegroundColor);}}diff --git a/client/src/app/+videos/+video-watch/comment/video-comment.component.ts b/client/src/app/+videos/+video-watch/comment/video-comment.component.tsindex 5071329096..c2964d3702 100644--- a/client/src/app/+videos/+video-watch/comment/video-comment.component.ts+++ b/client/src/app/+videos/+video-watch/comment/video-comment.component.ts@@ -115,6 +115,10 @@ export class VideoCommentComponent implements OnInit, OnChanges {return this.comment.account && this.isUserLoggedIn() && this.user.account.id === this.comment.account.id && this.comment.totalReplies === 0}+ isReportableByUser() {+ return this.comment.account && this.isUserLoggedIn() && this.comment.isDeleted === false && this.authService.getUser().account.id !== this.comment.account.id+ }+switchToDefaultAvatar ($event: Event) {($event.target as HTMLImageElement).src = Actor.GET_DEFAULT_AVATAR_URL()}@@ -146,14 +150,30 @@ export class VideoCommentComponent implements OnInit, OnChanges {this.comment.account = null}- if (this.isUserLoggedIn() && this.comment.isDeleted === false && this.authService.getUser().account.id !== this.comment.account.id) {- this.prependModerationActions = [- {- label: $localize`Report comment`,- handler: () => this.showReportModal()- }- ]- } else {+ this.prependModerationActions = []++ if (this.isReportableByUser()) {+ this.prependModerationActions.push({+ label: $localize`Report comment`,+ handler: () => this.showReportModal()+ })+ }++ if (this.isRemovableByUser()) {+ this.prependModerationActions.push({+ label: $localize`Remove comment`,+ handler: () => this.onWantToDelete()+ })+ }++ if (this.isRedraftableByUser()) {+ this.prependModerationActions.push({+ label: $localize`Remove & re-draft comment`,+ handler: () => this.onWantToRedraft()+ })+ }++ if (this.prependModerationActions.length === 0) {this.prependModerationActions = undefined}}