]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blob - client/src/app/videos/+video-watch/comment/video-comments.component.html
Show number of comments under a video in watch view
[github/Chocobozzz/PeerTube.git] / client / src / app / videos / +video-watch / comment / video-comments.component.html
1 <div>
2 <div class="title-block">
3 <div class="title-page title-page-single">
4 <ng-container *ngIf="comments.length > 0; then hasComments; else noComments"></ng-container>
5 <ng-template #hasComments>
6 <ng-container i18n *ngIf="comments.length === 1; else manyComments">1 Comment</ng-container>
7 <ng-template i18n #manyComments>{{ comments.length }} Comments</ng-template>
8 </ng-template>
9 <ng-template i18n #noComments>Comments</ng-template>
10 </div>
11
12 <my-feed [syndicationItems]="syndicationItems"></my-feed>
13 </div>
14
15 <ng-template [ngIf]="video.commentsEnabled === true">
16 <my-video-comment-add
17 [video]="video"
18 [user]="user"
19 (commentCreated)="onCommentThreadCreated($event)"
20 ></my-video-comment-add>
21
22 <div *ngIf="componentPagination.totalItems === 0 && comments.length === 0" i18n>No comments.</div>
23
24 <div
25 class="comment-threads"
26 myInfiniteScroller
27 [autoInit]="true"
28 (nearOfBottom)="onNearOfBottom()"
29 [dataObservable]="onDataSubject.asObservable()"
30 >
31 <div #commentHighlightBlock id="highlighted-comment">
32 <my-video-comment
33 *ngIf="highlightedThread"
34 [comment]="highlightedThread"
35 [video]="video"
36 [inReplyToCommentId]="inReplyToCommentId"
37 [commentTree]="threadComments[highlightedThread.id]"
38 [highlightedComment]="true"
39 (wantedToReply)="onWantedToReply($event)"
40 (wantedToDelete)="onWantedToDelete($event)"
41 (threadCreated)="onThreadCreated($event)"
42 (resetReply)="onResetReply()"
43 ></my-video-comment>
44 </div>
45
46 <div *ngFor="let comment of comments">
47 <my-video-comment
48 *ngIf="!highlightedThread || comment.id !== highlightedThread.id"
49 [comment]="comment"
50 [video]="video"
51 [inReplyToCommentId]="inReplyToCommentId"
52 [commentTree]="threadComments[comment.id]"
53 (wantedToReply)="onWantedToReply($event)"
54 (wantedToDelete)="onWantedToDelete($event)"
55 (threadCreated)="onThreadCreated($event)"
56 (resetReply)="onResetReply()"
57 ></my-video-comment>
58
59 <div *ngIf="comment.totalReplies !== 0 && !threadComments[comment.id]" (click)="viewReplies(comment.id)" class="view-replies">
60 <ng-container i18n>View all {{ comment.totalReplies }} replies</ng-container>
61
62 <span *ngIf="!threadLoading[comment.id]" class="glyphicon glyphicon-menu-down"></span>
63 <my-small-loader class="comment-thread-loading" [loading]="threadLoading[comment.id]"></my-small-loader>
64 </div>
65 </div>
66 </div>
67 </ng-template>
68
69 <div *ngIf="video.commentsEnabled === false" i18n>
70 Comments are disabled.
71 </div>
72 </div>