Add ability to delete comments
[oweals/peertube.git] / client / src / app / videos / +video-watch / comment / video-comment.component.html
1 <div class="root-comment">
2   <img [src]="getAvatarUrl(comment.account)" alt="Avatar" />
3
4   <div class="comment">
5     <div class="comment-account-date">
6       <a target="_blank" [href]="comment.account.url" class="comment-account">{{ comment.by }}</a>
7       <div class="comment-date">{{ comment.createdAt | myFromNow }}</div>
8     </div>
9     <div>{{ comment.text }}</div>
10
11     <div class="comment-actions">
12       <div *ngIf="isUserLoggedIn()" (click)="onWantToReply()" class="comment-action-reply">Reply</div>
13       <div *ngIf="isRemovableByUser()" (click)="onWantToDelete()" class="comment-action-delete">Delete</div>
14     </div>
15
16     <my-video-comment-add
17       *ngIf="isUserLoggedIn() && inReplyToCommentId === comment.id"
18       [user]="user"
19       [video]="video"
20       [parentComment]="comment"
21       [focusOnInit]="true"
22       (commentCreated)="onCommentReplyCreated($event)"
23     ></my-video-comment-add>
24
25     <div *ngIf="commentTree" class="children">
26       <div *ngFor="let commentChild of commentTree.children">
27         <my-video-comment
28           [comment]="commentChild.comment"
29           [video]="video"
30           [inReplyToCommentId]="inReplyToCommentId"
31           [commentTree]="commentChild"
32           (wantedToReply)="onWantToReply($event)"
33           (wantedToDelete)="onWantToDelete($event)"
34           (resetReply)="onResetReply()"
35         ></my-video-comment>
36       </div>
37     </div>
38   </div>
39 </div>