]>
Commit | Line | Data |
---|---|---|
1 | <div *ngIf="isCommentDisplayed()" class="root-comment"> | |
2 | <div class="left"> | |
3 | <a *ngIf="!comment.isDeleted" [href]="comment.account.url" target="_blank" rel="noopener noreferrer"> | |
4 | <img | |
5 | class="comment-avatar" | |
6 | [src]="comment.accountAvatarUrl" | |
7 | (error)="switchToDefaultAvatar($event)" | |
8 | alt="Avatar" | |
9 | /> | |
10 | </a> | |
11 | ||
12 | <div class="vertical-border"></div> | |
13 | </div> | |
14 | ||
15 | <div class="right" [ngClass]="{ 'mb-3': firstInThread }"> | |
16 | <span *ngIf="comment.isDeleted" class="comment-avatar"></span> | |
17 | ||
18 | <div class="comment"> | |
19 | <ng-container *ngIf="!comment.isDeleted"> | |
20 | <div *ngIf="highlightedComment === true" class="highlighted-comment" i18n>Highlighted comment</div> | |
21 | ||
22 | <div class="comment-account-date"> | |
23 | <div class="comment-account"> | |
24 | <a [routerLink]="[ '/accounts', comment.by ]"> | |
25 | <span class="comment-account-name" [ngClass]="{ 'video-author': video.account.id === comment.account.id }"> | |
26 | {{ comment.account.displayName }} | |
27 | </span> | |
28 | ||
29 | <span class="comment-account-fid ml-1">{{ comment.by }}</span> | |
30 | </a> | |
31 | </div> | |
32 | ||
33 | <a [routerLink]="['/videos/watch', video.uuid, { 'threadId': comment.threadId }]" class="comment-date" [title]="comment.createdAt"> | |
34 | {{ comment.createdAt | myFromNow }} | |
35 | </a> | |
36 | </div> | |
37 | ||
38 | <div | |
39 | class="comment-html" | |
40 | [innerHTML]="sanitizedCommentHTML" | |
41 | (timestampClicked)="handleTimestampClicked($event)" | |
42 | timestampRouteTransformer | |
43 | ></div> | |
44 | ||
45 | <div class="comment-actions"> | |
46 | <div *ngIf="isUserLoggedIn()" tabindex=0 (click)="onWantToReply()" class="comment-action-reply" i18n>Reply</div> | |
47 | ||
48 | <my-user-moderation-dropdown | |
49 | [prependActions]="prependModerationActions" tabindex=0 | |
50 | buttonSize="small" [account]="commentAccount" [user]="commentUser" i18n-label label="Options" placement="bottom-left auto" | |
51 | ></my-user-moderation-dropdown> | |
52 | </div> | |
53 | </ng-container> | |
54 | ||
55 | <ng-container *ngIf="comment.isDeleted"> | |
56 | <div class="comment-account-date"> | |
57 | <span class="comment-account" i18n>Deleted</span> | |
58 | <a [routerLink]="['/videos/watch', video.uuid, { 'threadId': comment.threadId }]" | |
59 | class="comment-date">{{ comment.createdAt | myFromNow }}</a> | |
60 | </div> | |
61 | ||
62 | <div class="comment-html comment-html-deleted"> | |
63 | <i i18n>This comment has been deleted</i> | |
64 | </div> | |
65 | </ng-container> | |
66 | ||
67 | <my-video-comment-add | |
68 | *ngIf="!comment.isDeleted && isUserLoggedIn() && inReplyToCommentId === comment.id" | |
69 | [user]="user" | |
70 | [video]="video" | |
71 | [parentComment]="comment" | |
72 | [parentComments]="newParentComments" | |
73 | [focusOnInit]="true" | |
74 | (commentCreated)="onCommentReplyCreated($event)" | |
75 | (cancel)="onResetReply()" | |
76 | [textValue]="redraftValue" | |
77 | ></my-video-comment-add> | |
78 | ||
79 | <div *ngIf="commentTree" class="children"> | |
80 | <div *ngFor="let commentChild of commentTree.children"> | |
81 | <my-video-comment | |
82 | [comment]="commentChild.comment" | |
83 | [video]="video" | |
84 | [inReplyToCommentId]="inReplyToCommentId" | |
85 | [commentTree]="commentChild" | |
86 | [parentComments]="newParentComments" | |
87 | (wantedToReply)="onWantToReply($event)" | |
88 | (wantedToDelete)="onWantToDelete($event)" | |
89 | (wantedToRedraft)="onWantToRedraft($event)" | |
90 | (resetReply)="onResetReply()" | |
91 | (timestampClicked)="handleTimestampClicked($event)" | |
92 | [redraftValue]="redraftValue" | |
93 | ></my-video-comment> | |
94 | </div> | |
95 | </div> | |
96 | ||
97 | <ng-content></ng-content> | |
98 | </div> | |
99 | </div> | |
100 | </div> | |
101 | ||
102 | <ng-container *ngIf="prependModerationActions"> | |
103 | <my-comment-report #commentReportModal [comment]="comment"></my-comment-report> | |
104 | </ng-container> |