<div class="root-comment">
- <img
- *ngIf="!comment.isDeleted"
- class="comment-avatar"
- [src]="comment.accountAvatarUrl"
- alt="Avatar"
- />
+ <div class="left">
+ <a *ngIf="!comment.isDeleted" [href]="comment.account.url" target="_blank" rel="noopener noreferrer">
+ <img
+ class="comment-avatar"
+ [src]="comment.accountAvatarUrl"
+ (error)="switchToDefaultAvatar($event)"
+ alt="Avatar"
+ />
+ </a>
- <span
- *ngIf="comment.isDeleted"
- class="comment-avatar"
- ></span>
+ <div class="vertical-border"></div>
+ </div>
- <div class="comment">
- <ng-container *ngIf="!comment.isDeleted">
- <div *ngIf="highlightedComment === true" class="highlighted-comment" i18n>Highlighted comment</div>
+ <div class="right" [ngClass]="{ 'mb-3': firstInThread }">
+ <span *ngIf="comment.isDeleted" class="comment-avatar"></span>
- <div class="comment-account-date">
- <a [href]="comment.account.url" target="_blank" rel="noopener noreferrer" class="comment-account">{{ comment.by }}</a>
- <a [routerLink]="['/videos/watch', video.uuid, { 'threadId': comment.threadId }]" class="comment-date">{{ comment.createdAt | myFromNow }}</a>
- </div>
- <div class="comment-html" [innerHTML]="sanitizedCommentHTML"></div>
+ <div class="comment">
+ <ng-container *ngIf="!comment.isDeleted">
+ <div *ngIf="highlightedComment === true" class="highlighted-comment" i18n>Highlighted comment</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>
- </ng-container>
+ <div class="comment-account-date">
+ <div class="comment-account">
+ <a
+ [routerLink]="[ '/accounts', comment.by ]"
+ class="comment-account-name" [ngClass]="{ 'video-author': video.account.id === comment.account.id }"
+ >
+ {{ comment.account.displayName }}
+ </a>
- <ng-container *ngIf="comment.isDeleted">
- <div class="comment-account-date">
- <span class="comment-account" i18n>Deleted</span>
- <a [routerLink]="['/videos/watch', video.uuid, { 'threadId': comment.threadId }]" class="comment-date">{{ comment.createdAt | myFromNow }}</a>
- </div>
+ <a [href]="comment.account.url" target="_blank" rel="noopener noreferrer" class="comment-account-fid ml-1">{{ comment.by }}</a>
+ </div>
+ <a [routerLink]="['/videos/watch', video.uuid, { 'threadId': comment.threadId }]"
+ class="comment-date" [title]="comment.createdAt">{{ comment.createdAt | myFromNow }}</a>
+ </div>
+ <div
+ class="comment-html"
+ [innerHTML]="sanitizedCommentHTML"
+ (timestampClicked)="handleTimestampClicked($event)"
+ timestampRouteTransformer
+ ></div>
- <div *ngIf="comment.isDeleted" class="comment-html comment-html-deleted">
- <i i18n>This comment has been deleted</i>
- </div>
- </ng-container>
+ <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>
- <my-video-comment-add
- *ngIf="!comment.isDeleted && isUserLoggedIn() && inReplyToCommentId === comment.id"
- [user]="user"
- [video]="video"
- [parentComment]="comment"
- [parentComments]="newParentComments"
- [focusOnInit]="true"
- (commentCreated)="onCommentReplyCreated($event)"
- ></my-video-comment-add>
+ <my-user-moderation-dropdown
+ buttonSize="small" [account]="commentAccount" [user]="commentUser" i18n-label label="Options" placement="bottom-left auto"
+ ></my-user-moderation-dropdown>
+ </div>
+ </ng-container>
- <div *ngIf="commentTree" class="children">
- <div *ngFor="let commentChild of commentTree.children">
- <my-video-comment
- [comment]="commentChild.comment"
- [video]="video"
- [inReplyToCommentId]="inReplyToCommentId"
- [commentTree]="commentChild"
- [parentComments]="newParentComments"
- (wantedToReply)="onWantToReply($event)"
- (wantedToDelete)="onWantToDelete($event)"
- (resetReply)="onResetReply()"
- ></my-video-comment>
+ <ng-container *ngIf="comment.isDeleted">
+ <div class="comment-account-date">
+ <span class="comment-account" i18n>Deleted</span>
+ <a [routerLink]="['/videos/watch', video.uuid, { 'threadId': comment.threadId }]"
+ class="comment-date">{{ comment.createdAt | myFromNow }}</a>
+ </div>
+
+ <div *ngIf="comment.isDeleted" class="comment-html comment-html-deleted">
+ <i i18n>This comment has been deleted</i>
+ </div>
+ </ng-container>
+
+ <my-video-comment-add
+ *ngIf="!comment.isDeleted && isUserLoggedIn() && inReplyToCommentId === comment.id"
+ [user]="user"
+ [video]="video"
+ [parentComment]="comment"
+ [parentComments]="newParentComments"
+ [focusOnInit]="true"
+ (commentCreated)="onCommentReplyCreated($event)"
+ (cancel)="onResetReply()"
+ ></my-video-comment-add>
+
+ <div *ngIf="commentTree" class="children">
+ <div *ngFor="let commentChild of commentTree.children">
+ <my-video-comment
+ [comment]="commentChild.comment"
+ [video]="video"
+ [inReplyToCommentId]="inReplyToCommentId"
+ [commentTree]="commentChild"
+ [parentComments]="newParentComments"
+ (wantedToReply)="onWantToReply($event)"
+ (wantedToDelete)="onWantToDelete($event)"
+ (resetReply)="onResetReply()"
+ (timestampClicked)="handleTimestampClicked($event)"
+ ></my-video-comment>
+ </div>
</div>
+
+ <ng-content></ng-content>
</div>
</div>
</div>