aboutsummaryrefslogtreecommitdiffhomepage
path: root/client/src/app/videos/+video-watch/comment/video-comments.component.html
blob: 9919ac615ef4ec5d57b4fe17d2913d6fc320bda8 (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
67
<div>
  <div class="title-block">
    <div i18n class="title-page title-page-single">
      Comments
    </div>
    <my-help
      *ngIf="video.commentsEnabled === true" helpType="custom" i18n-customHtml
      customHtml="You can either comment on the page of your instance where this video is federated with your PeerTube account, or via any ActivityPub-capable fediverse instance. For instance with Mastodon or Pleroma you can type in the search box <strong>@{{video.account.name}}@{{video.account.host}}</strong> and find back the video. Direct commenting capabilities are being worked on in <a href='https://github.com/Chocobozzz/PeerTube/issues/224'>#224</a>."></my-help>
  </div>

  <ng-template [ngIf]="video.commentsEnabled === true">
    <my-video-comment-add
      [video]="video"
      [user]="user"
      (commentCreated)="onCommentThreadCreated($event)"
    ></my-video-comment-add>

    <div *ngIf="componentPagination.totalItems === 0 && comments.length === 0" i18n>No comments.</div>

    <div
      class="comment-threads"
      myInfiniteScroller
      [autoInit]="true"
      (nearOfBottom)="onNearOfBottom()"
    >
      <div #commentHighlightBlock id="highlighted-comment">
        <my-video-comment
          *ngIf="highlightedThread"
          [comment]="highlightedThread"
          [video]="video"
          [inReplyToCommentId]="inReplyToCommentId"
          [commentTree]="threadComments[highlightedThread.id]"
          [highlightedComment]="true"
          (wantedToReply)="onWantedToReply($event)"
          (wantedToDelete)="onWantedToDelete($event)"
          (threadCreated)="onThreadCreated($event)"
          (resetReply)="onResetReply()"
        ></my-video-comment>
      </div>

      <div *ngFor="let comment of comments">
        <my-video-comment
          *ngIf="!highlightedThread || comment.id !== highlightedThread.id"
          [comment]="comment"
          [video]="video"
          [inReplyToCommentId]="inReplyToCommentId"
          [commentTree]="threadComments[comment.id]"
          (wantedToReply)="onWantedToReply($event)"
          (wantedToDelete)="onWantedToDelete($event)"
          (threadCreated)="onThreadCreated($event)"
          (resetReply)="onResetReply()"
        ></my-video-comment>

        <div *ngIf="comment.totalReplies !== 0 && !threadComments[comment.id]" (click)="viewReplies(comment.id)" class="view-replies">
          <ng-container i18n>View all {{ comment.totalReplies }} replies</ng-container>

          <span *ngIf="!threadLoading[comment.id]" class="glyphicon glyphicon-menu-down"></span>
          <my-loader class="comment-thread-loading" [loading]="threadLoading[comment.id]"></my-loader>
        </div>
      </div>
    </div>
  </ng-template>

  <div *ngIf="video.commentsEnabled === false" i18n>
    Comments are disabled.
  </div>
</div>