]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blame - client/src/app/videos/+video-watch/comment/video-comments.component.html
Add comment filtering by reply count
[github/Chocobozzz/PeerTube.git] / client / src / app / videos / +video-watch / comment / video-comments.component.html
CommitLineData
4635f59d 1<div>
169310b2 2 <div class="title-block">
44efbeba
RK
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>
169310b2 10 </div>
53877968 11
c199c427 12 <my-feed [syndicationItems]="syndicationItems"></my-feed>
c1125bca
RK
13
14 <div ngbDropdown class="d-inline-block ml-4">
15 <button class="btn btn-sm btn-outline-secondary" id="dropdownSortComments" ngbDropdownToggle i18n>
16 Sort by
17 </button>
18 <div ngbDropdownMenu aria-labelledby="dropdownSortComments">
19 <button (click)="handleSortChange('-createdAt')" ngbDropdownItem i18n>Most recent first (default)</button>
20 <button (click)="handleSortChange('-totalReplies')" ngbDropdownItem i18n>Most replies first</button>
21 </div>
22 </div>
4635f59d
C
23 </div>
24
47564bbe
C
25 <ng-template [ngIf]="video.commentsEnabled === true">
26 <my-video-comment-add
47564bbe 27 [video]="video"
cf117aaa 28 [user]="user"
47564bbe
C
29 (commentCreated)="onCommentThreadCreated($event)"
30 ></my-video-comment-add>
4635f59d 31
b1d40cff 32 <div *ngIf="componentPagination.totalItems === 0 && comments.length === 0" i18n>No comments.</div>
4635f59d 33
47564bbe
C
34 <div
35 class="comment-threads"
0cd4344f 36 myInfiniteScroller
aa55a4da 37 [autoInit]="true"
0cd4344f 38 (nearOfBottom)="onNearOfBottom()"
ad453580 39 [dataObservable]="onDataSubject.asObservable()"
47564bbe 40 >
bf079b7b 41 <div #commentHighlightBlock id="highlighted-comment">
1263fc4e 42 <my-video-comment
bf079b7b 43 *ngIf="highlightedThread"
b1d40cff
C
44 [comment]="highlightedThread"
45 [video]="video"
46 [inReplyToCommentId]="inReplyToCommentId"
47 [commentTree]="threadComments[highlightedThread.id]"
48 [highlightedComment]="true"
49 (wantedToReply)="onWantedToReply($event)"
50 (wantedToDelete)="onWantedToDelete($event)"
51 (threadCreated)="onThreadCreated($event)"
52 (resetReply)="onResetReply()"
b29bf61d 53 (timestampClicked)="handleTimestampClicked($event)"
1263fc4e
C
54 ></my-video-comment>
55 </div>
56
47564bbe
C
57 <div *ngFor="let comment of comments">
58 <my-video-comment
5b8072ee 59 *ngIf="!highlightedThread || comment.id !== highlightedThread.id"
47564bbe
C
60 [comment]="comment"
61 [video]="video"
62 [inReplyToCommentId]="inReplyToCommentId"
63 [commentTree]="threadComments[comment.id]"
64 (wantedToReply)="onWantedToReply($event)"
4cb6d457
C
65 (wantedToDelete)="onWantedToDelete($event)"
66 (threadCreated)="onThreadCreated($event)"
47564bbe 67 (resetReply)="onResetReply()"
b29bf61d 68 (timestampClicked)="handleTimestampClicked($event)"
47564bbe 69 ></my-video-comment>
4635f59d 70
1263fc4e 71 <div *ngIf="comment.totalReplies !== 0 && !threadComments[comment.id]" (click)="viewReplies(comment.id)" class="view-replies">
b1d40cff 72 <ng-container i18n>View all {{ comment.totalReplies }} replies</ng-container>
47564bbe
C
73
74 <span *ngIf="!threadLoading[comment.id]" class="glyphicon glyphicon-menu-down"></span>
b28e4e5e 75 <my-small-loader class="comment-thread-loading" [loading]="threadLoading[comment.id]"></my-small-loader>
47564bbe 76 </div>
4635f59d
C
77 </div>
78 </div>
47564bbe
C
79 </ng-template>
80
b1d40cff 81 <div *ngIf="video.commentsEnabled === false" i18n>
47564bbe 82 Comments are disabled.
4635f59d
C
83 </div>
84</div>