]>
Commit | Line | Data |
---|---|---|
4635f59d | 1 | <div> |
169310b2 | 2 | <div class="title-block"> |
c4a05171 | 3 | <h2 class="title-page"> |
db8b2f56 | 4 | {totalNotDeletedComments, plural, =0 {Comments} =1 {1 Comment} other {{{totalNotDeletedComments}} Comments}} |
c9e3565d | 5 | </h2> |
53877968 | 6 | |
c199c427 | 7 | <my-feed [syndicationItems]="syndicationItems"></my-feed> |
c1125bca | 8 | |
4c8749cb | 9 | <div ngbDropdown class="d-inline-block ms-4 dropdown-root"> |
e0433a5f | 10 | <button class="btn btn-sm btn-outline-secondary" id="dropdown-sort-comments" ngbDropdownToggle i18n> |
14571f19 | 11 | SORT BY |
c1125bca | 12 | </button> |
e0433a5f | 13 | <div ngbDropdownMenu aria-labelledby="dropdown-sort-comments"> |
c1125bca RK |
14 | <button (click)="handleSortChange('-createdAt')" ngbDropdownItem i18n>Most recent first (default)</button> |
15 | <button (click)="handleSortChange('-totalReplies')" ngbDropdownItem i18n>Most replies first</button> | |
16 | </div> | |
17 | </div> | |
4635f59d C |
18 | </div> |
19 | ||
47564bbe C |
20 | <ng-template [ngIf]="video.commentsEnabled === true"> |
21 | <my-video-comment-add | |
47564bbe | 22 | [video]="video" |
cf117aaa | 23 | [user]="user" |
47564bbe | 24 | (commentCreated)="onCommentThreadCreated($event)" |
f63c03fb | 25 | [textValue]="commentThreadRedraftValue" |
47564bbe | 26 | ></my-video-comment-add> |
4635f59d | 27 | |
9d6b9d10 | 28 | <div *ngIf="totalNotDeletedComments === 0 && comments.length === 0" i18n>No comments.</div> |
4635f59d | 29 | |
dd24f1bb | 30 | <div class="comment-threads" myInfiniteScroller (nearOfBottom)="onNearOfBottom()" [dataObservable]="onDataSubject.asObservable()"> |
b7e21681 RK |
31 | <div> |
32 | <div class="anchor" #commentHighlightBlock id="highlighted-comment"></div> | |
1263fc4e | 33 | <my-video-comment |
bf079b7b | 34 | *ngIf="highlightedThread" |
b1d40cff C |
35 | [comment]="highlightedThread" |
36 | [video]="video" | |
37 | [inReplyToCommentId]="inReplyToCommentId" | |
38 | [commentTree]="threadComments[highlightedThread.id]" | |
39 | [highlightedComment]="true" | |
c62a34d3 | 40 | [firstInThread]="true" |
b1d40cff C |
41 | (wantedToReply)="onWantedToReply($event)" |
42 | (wantedToDelete)="onWantedToDelete($event)" | |
f63c03fb | 43 | (wantedToRedraft)="onWantedToRedraft($event)" |
b1d40cff C |
44 | (threadCreated)="onThreadCreated($event)" |
45 | (resetReply)="onResetReply()" | |
b29bf61d | 46 | (timestampClicked)="handleTimestampClicked($event)" |
f63c03fb | 47 | [redraftValue]="commentReplyRedraftValue" |
1263fc4e C |
48 | ></my-video-comment> |
49 | </div> | |
50 | ||
c62a34d3 | 51 | <div *ngFor="let comment of comments; index as i"> |
47564bbe | 52 | <my-video-comment |
5b8072ee | 53 | *ngIf="!highlightedThread || comment.id !== highlightedThread.id" |
47564bbe C |
54 | [comment]="comment" |
55 | [video]="video" | |
56 | [inReplyToCommentId]="inReplyToCommentId" | |
57 | [commentTree]="threadComments[comment.id]" | |
c62a34d3 | 58 | [firstInThread]="i + 1 !== comments.length" |
47564bbe | 59 | (wantedToReply)="onWantedToReply($event)" |
4cb6d457 | 60 | (wantedToDelete)="onWantedToDelete($event)" |
f63c03fb | 61 | (wantedToRedraft)="onWantedToRedraft($event)" |
4cb6d457 | 62 | (threadCreated)="onThreadCreated($event)" |
47564bbe | 63 | (resetReply)="onResetReply()" |
b29bf61d | 64 | (timestampClicked)="handleTimestampClicked($event)" |
f63c03fb | 65 | [redraftValue]="commentReplyRedraftValue" |
c62a34d3 | 66 | > |
d0fbc9fd | 67 | <button *ngIf="comment.totalReplies !== 0 && !threadComments[comment.id]" (click)="viewReplies(comment.id)" class="view-replies mb-2 button-unstyle"> |
93c728a2 | 68 | <span class="chevron-down"></span> |
e0433a5f | 69 | |
c62a34d3 | 70 | <ng-container *ngIf="comment.totalRepliesFromVideoAuthor > 0; then hasAuthorComments; else noAuthorComments"></ng-container> |
db8b2f56 | 71 | |
c62a34d3 RK |
72 | <ng-template #hasAuthorComments> |
73 | <ng-container *ngIf="comment.totalReplies !== comment.totalRepliesFromVideoAuthor; else onlyAuthorComments" i18n> | |
db8b2f56 | 74 | View {comment.totalReplies, plural, =1 {1 reply} other {{{ comment.totalReplies }} replies}} from {{ video?.account?.displayName || 'the author' }} and others |
c62a34d3 RK |
75 | </ng-container> |
76 | <ng-template i18n #onlyAuthorComments> | |
db8b2f56 | 77 | View {comment.totalReplies, plural, =1 {1 reply} other {{{ comment.totalReplies }} replies}} from {{ video?.account?.displayName || 'the author' }} |
c62a34d3 | 78 | </ng-template> |
5b0413dd | 79 | </ng-template> |
db8b2f56 C |
80 | |
81 | <ng-template i18n #noAuthorComments>View {comment.totalReplies, plural, =1 {1 reply} other {{{ comment.totalReplies }} replies}}</ng-template> | |
e0433a5f | 82 | |
93c728a2 | 83 | <my-loader size="sm" class="ms-1" [loading]="threadLoading[comment.id]"></my-loader> |
d0fbc9fd | 84 | </button> |
c62a34d3 | 85 | </my-video-comment> |
5b0413dd | 86 | |
4635f59d C |
87 | </div> |
88 | </div> | |
47564bbe C |
89 | </ng-template> |
90 | ||
b1d40cff | 91 | <div *ngIf="video.commentsEnabled === false" i18n> |
47564bbe | 92 | Comments are disabled. |
4635f59d C |
93 | </div> |
94 | </div> |