]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blob - client/src/app/videos/+video-watch/comment/video-comment.component.html
4753641bd9da6247f43660f22ec4dc70015564b6
[github/Chocobozzz/PeerTube.git] / client / src / app / videos / +video-watch / comment / video-comment.component.html
1 <div 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 alt="Avatar"
8 />
9 </a>
10
11 <div class="vertical-border"></div>
12 </div>
13
14 <div class="right" [ngClass]="{ 'mb-3': firstInThread }">
15 <span *ngIf="comment.isDeleted" class="comment-avatar"></span>
16
17 <div class="comment">
18 <ng-container *ngIf="!comment.isDeleted">
19 <div *ngIf="highlightedComment === true" class="highlighted-comment" i18n>Highlighted comment</div>
20
21 <div class="comment-account-date">
22 <a [href]="comment.account.url" target="_blank" rel="noopener noreferrer" class="comment-account">
23 <span class="comment-account-name" [ngClass]="{ 'video-author': video.account.id === comment.account.id }">{{ comment.account.displayName }}</span>
24 <span class="comment-account-fid ml-1">{{ comment.by }}</span>
25 </a>
26 <a [routerLink]="['/videos/watch', video.uuid, { 'threadId': comment.threadId }]"
27 class="comment-date" [title]="comment.createdAt">{{ comment.createdAt | myFromNow }}</a>
28 </div>
29 <div
30 class="comment-html"
31 [innerHTML]="sanitizedCommentHTML"
32 (timestampClicked)="handleTimestampClicked($event)"
33 timestampRouteTransformer
34 ></div>
35
36 <div class="comment-actions">
37 <div *ngIf="isUserLoggedIn()" (click)="onWantToReply()" class="comment-action-reply" i18n>Reply</div>
38 <div *ngIf="isRemovableByUser()" (click)="onWantToDelete()" class="comment-action-delete" i18n>Delete</div>
39 <my-user-moderation-dropdown
40 buttonSize="small" [account]="commentAccount" [user]="commentUser" label="Options" placement="bottom-left auto"
41 ></my-user-moderation-dropdown>
42 </div>
43 </ng-container>
44
45 <ng-container *ngIf="comment.isDeleted">
46 <div class="comment-account-date">
47 <span class="comment-account" i18n>Deleted</span>
48 <a [routerLink]="['/videos/watch', video.uuid, { 'threadId': comment.threadId }]"
49 class="comment-date">{{ comment.createdAt | myFromNow }}</a>
50 </div>
51
52 <div *ngIf="comment.isDeleted" class="comment-html comment-html-deleted">
53 <i i18n>This comment has been deleted</i>
54 </div>
55 </ng-container>
56
57 <my-video-comment-add
58 *ngIf="!comment.isDeleted && isUserLoggedIn() && inReplyToCommentId === comment.id"
59 [user]="user"
60 [video]="video"
61 [parentComment]="comment"
62 [parentComments]="newParentComments"
63 [focusOnInit]="true"
64 (commentCreated)="onCommentReplyCreated($event)"
65 (cancel)="onResetReply()"
66 ></my-video-comment-add>
67
68 <div *ngIf="commentTree" class="children">
69 <div *ngFor="let commentChild of commentTree.children">
70 <my-video-comment
71 [comment]="commentChild.comment"
72 [video]="video"
73 [inReplyToCommentId]="inReplyToCommentId"
74 [commentTree]="commentChild"
75 [parentComments]="newParentComments"
76 (wantedToReply)="onWantToReply($event)"
77 (wantedToDelete)="onWantToDelete($event)"
78 (resetReply)="onResetReply()"
79 (timestampClicked)="handleTimestampClicked($event)"
80 ></my-video-comment>
81 </div>
82 </div>
83 </div>
84
85 <ng-content></ng-content>
86 </div>
87 </div>