]>
Commit | Line | Data |
---|---|---|
4635f59d | 1 | <div> |
169310b2 | 2 | <div class="title-block"> |
44efbeba | 3 | <div 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> | |
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" | |
c62a34d3 | 49 | [firstInThread]="true" |
b1d40cff C |
50 | (wantedToReply)="onWantedToReply($event)" |
51 | (wantedToDelete)="onWantedToDelete($event)" | |
52 | (threadCreated)="onThreadCreated($event)" | |
53 | (resetReply)="onResetReply()" | |
b29bf61d | 54 | (timestampClicked)="handleTimestampClicked($event)" |
1263fc4e C |
55 | ></my-video-comment> |
56 | </div> | |
57 | ||
c62a34d3 | 58 | <div *ngFor="let comment of comments; index as i"> |
47564bbe | 59 | <my-video-comment |
5b8072ee | 60 | *ngIf="!highlightedThread || comment.id !== highlightedThread.id" |
47564bbe C |
61 | [comment]="comment" |
62 | [video]="video" | |
63 | [inReplyToCommentId]="inReplyToCommentId" | |
64 | [commentTree]="threadComments[comment.id]" | |
c62a34d3 | 65 | [firstInThread]="i + 1 !== comments.length" |
47564bbe | 66 | (wantedToReply)="onWantedToReply($event)" |
4cb6d457 C |
67 | (wantedToDelete)="onWantedToDelete($event)" |
68 | (threadCreated)="onThreadCreated($event)" | |
47564bbe | 69 | (resetReply)="onResetReply()" |
b29bf61d | 70 | (timestampClicked)="handleTimestampClicked($event)" |
c62a34d3 RK |
71 | > |
72 | <div *ngIf="comment.totalReplies !== 0 && !threadComments[comment.id]" (click)="viewReplies(comment.id)" class="view-replies mb-2"> | |
73 | <span class="glyphicon glyphicon-menu-down"></span> | |
74 | ||
75 | <ng-container *ngIf="comment.totalRepliesFromVideoAuthor > 0; then hasAuthorComments; else noAuthorComments"></ng-container> | |
76 | <ng-template #hasAuthorComments> | |
77 | <ng-container *ngIf="comment.totalReplies !== comment.totalRepliesFromVideoAuthor; else onlyAuthorComments" i18n> | |
78 | View {{ comment.totalReplies }} replies from {{ video?.account?.displayName || 'the author' }} and others | |
79 | </ng-container> | |
80 | <ng-template i18n #onlyAuthorComments> | |
81 | View {{ comment.totalReplies }} replies from {{ video?.account?.displayName || 'the author' }} | |
82 | </ng-template> | |
5b0413dd | 83 | </ng-template> |
c62a34d3 RK |
84 | <ng-template i18n #noAuthorComments>View {{ comment.totalReplies }} replies</ng-template> |
85 | ||
86 | <my-small-loader class="comment-thread-loading ml-1" [loading]="threadLoading[comment.id]"></my-small-loader> | |
87 | </div> | |
88 | </my-video-comment> | |
5b0413dd | 89 | |
4635f59d C |
90 | </div> |
91 | </div> | |
47564bbe C |
92 | </ng-template> |
93 | ||
b1d40cff | 94 | <div *ngIf="video.commentsEnabled === false" i18n> |
47564bbe | 95 | Comments are disabled. |
4635f59d C |
96 | </div> |
97 | </div> |