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