aboutsummaryrefslogtreecommitdiffhomepage
path: root/client/src/app/videos/+video-watch/comment/video-comment.component.html
blob: 6ec35d63b89f931dc228f4e94a7a26c275a78573 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
<div class="root-comment">
  <img
    *ngIf="!comment.isDeleted"
    class="comment-avatar"
    [src]="comment.accountAvatarUrl"
    alt="Avatar"
  />

  <span
    *ngIf="comment.isDeleted"
    class="comment-avatar"
  ></span>

  <div class="comment">
    <ng-container *ngIf="!comment.isDeleted">
      <div *ngIf="highlightedComment === true" class="highlighted-comment" i18n>Highlighted comment</div>

      <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-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>

    <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)"
    ></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()"
        ></my-video-comment>
      </div>
    </div>
  </div>
</div>