]>
Commit | Line | Data |
---|---|---|
4635f59d | 1 | <div> |
169310b2 | 2 | <div class="title-block"> |
c9e3565d | 3 | <h2 class="title-page title-page-single"> |
ae689853 | 4 | <ng-container *ngIf="componentPagination.totalItems > 0; then hasComments; else noComments"></ng-container> |
44efbeba | 5 | <ng-template #hasComments> |
ae689853 RK |
6 | <ng-container i18n *ngIf="componentPagination.totalItems === 1; else manyComments">1 Comment</ng-container> |
7 | <ng-template i18n #manyComments>{{ componentPagination.totalItems }} Comments</ng-template> | |
44efbeba RK |
8 | </ng-template> |
9 | <ng-template i18n #noComments>Comments</ng-template> | |
c9e3565d | 10 | </h2> |
53877968 | 11 | |
c199c427 | 12 | <my-feed [syndicationItems]="syndicationItems"></my-feed> |
c1125bca RK |
13 | |
14 | <div ngbDropdown class="d-inline-block ml-4"> | |
e0433a5f | 15 | <button class="btn btn-sm btn-outline-secondary" id="dropdown-sort-comments" ngbDropdownToggle i18n> |
14571f19 | 16 | SORT BY |
c1125bca | 17 | </button> |
e0433a5f | 18 | <div ngbDropdownMenu aria-labelledby="dropdown-sort-comments"> |
c1125bca RK |
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 | 29 | (commentCreated)="onCommentThreadCreated($event)" |
f63c03fb | 30 | [textValue]="commentThreadRedraftValue" |
47564bbe | 31 | ></my-video-comment-add> |
4635f59d | 32 | |
b1d40cff | 33 | <div *ngIf="componentPagination.totalItems === 0 && comments.length === 0" i18n>No comments.</div> |
4635f59d | 34 | |
47564bbe C |
35 | <div |
36 | class="comment-threads" | |
0cd4344f | 37 | myInfiniteScroller |
aa55a4da | 38 | [autoInit]="true" |
0cd4344f | 39 | (nearOfBottom)="onNearOfBottom()" |
ad453580 | 40 | [dataObservable]="onDataSubject.asObservable()" |
47564bbe | 41 | > |
b7e21681 RK |
42 | <div> |
43 | <div class="anchor" #commentHighlightBlock id="highlighted-comment"></div> | |
1263fc4e | 44 | <my-video-comment |
bf079b7b | 45 | *ngIf="highlightedThread" |
b1d40cff C |
46 | [comment]="highlightedThread" |
47 | [video]="video" | |
48 | [inReplyToCommentId]="inReplyToCommentId" | |
49 | [commentTree]="threadComments[highlightedThread.id]" | |
50 | [highlightedComment]="true" | |
c62a34d3 | 51 | [firstInThread]="true" |
b1d40cff C |
52 | (wantedToReply)="onWantedToReply($event)" |
53 | (wantedToDelete)="onWantedToDelete($event)" | |
f63c03fb | 54 | (wantedToRedraft)="onWantedToRedraft($event)" |
b1d40cff C |
55 | (threadCreated)="onThreadCreated($event)" |
56 | (resetReply)="onResetReply()" | |
b29bf61d | 57 | (timestampClicked)="handleTimestampClicked($event)" |
f63c03fb | 58 | [redraftValue]="commentReplyRedraftValue" |
1263fc4e C |
59 | ></my-video-comment> |
60 | </div> | |
61 | ||
c62a34d3 | 62 | <div *ngFor="let comment of comments; index as i"> |
47564bbe | 63 | <my-video-comment |
5b8072ee | 64 | *ngIf="!highlightedThread || comment.id !== highlightedThread.id" |
47564bbe C |
65 | [comment]="comment" |
66 | [video]="video" | |
67 | [inReplyToCommentId]="inReplyToCommentId" | |
68 | [commentTree]="threadComments[comment.id]" | |
c62a34d3 | 69 | [firstInThread]="i + 1 !== comments.length" |
47564bbe | 70 | (wantedToReply)="onWantedToReply($event)" |
4cb6d457 | 71 | (wantedToDelete)="onWantedToDelete($event)" |
f63c03fb | 72 | (wantedToRedraft)="onWantedToRedraft($event)" |
4cb6d457 | 73 | (threadCreated)="onThreadCreated($event)" |
47564bbe | 74 | (resetReply)="onResetReply()" |
b29bf61d | 75 | (timestampClicked)="handleTimestampClicked($event)" |
f63c03fb | 76 | [redraftValue]="commentReplyRedraftValue" |
c62a34d3 RK |
77 | > |
78 | <div *ngIf="comment.totalReplies !== 0 && !threadComments[comment.id]" (click)="viewReplies(comment.id)" class="view-replies mb-2"> | |
79 | <span class="glyphicon glyphicon-menu-down"></span> | |
e0433a5f | 80 | |
c62a34d3 RK |
81 | <ng-container *ngIf="comment.totalRepliesFromVideoAuthor > 0; then hasAuthorComments; else noAuthorComments"></ng-container> |
82 | <ng-template #hasAuthorComments> | |
83 | <ng-container *ngIf="comment.totalReplies !== comment.totalRepliesFromVideoAuthor; else onlyAuthorComments" i18n> | |
84 | View {{ comment.totalReplies }} replies from {{ video?.account?.displayName || 'the author' }} and others | |
85 | </ng-container> | |
86 | <ng-template i18n #onlyAuthorComments> | |
87 | View {{ comment.totalReplies }} replies from {{ video?.account?.displayName || 'the author' }} | |
88 | </ng-template> | |
5b0413dd | 89 | </ng-template> |
c62a34d3 | 90 | <ng-template i18n #noAuthorComments>View {{ comment.totalReplies }} replies</ng-template> |
e0433a5f | 91 | |
c62a34d3 RK |
92 | <my-small-loader class="comment-thread-loading ml-1" [loading]="threadLoading[comment.id]"></my-small-loader> |
93 | </div> | |
94 | </my-video-comment> | |
5b0413dd | 95 | |
4635f59d C |
96 | </div> |
97 | </div> | |
47564bbe C |
98 | </ng-template> |
99 | ||
b1d40cff | 100 | <div *ngIf="video.commentsEnabled === false" i18n> |
47564bbe | 101 | Comments are disabled. |
4635f59d C |
102 | </div> |
103 | </div> |