2017-12-27 16:11:53 +01:00
|
|
|
<div>
|
2018-05-07 17:40:46 +02:00
|
|
|
<div class="title-block">
|
2019-12-13 22:23:13 +01:00
|
|
|
<div class="title-page title-page-single">
|
2020-01-08 23:28:03 +01:00
|
|
|
<ng-container *ngIf="componentPagination.totalItems > 0; then hasComments; else noComments"></ng-container>
|
2019-12-13 22:23:13 +01:00
|
|
|
<ng-template #hasComments>
|
2020-01-08 23:28:03 +01:00
|
|
|
<ng-container i18n *ngIf="componentPagination.totalItems === 1; else manyComments">1 Comment</ng-container>
|
|
|
|
<ng-template i18n #manyComments>{{ componentPagination.totalItems }} Comments</ng-template>
|
2019-12-13 22:23:13 +01:00
|
|
|
</ng-template>
|
|
|
|
<ng-template i18n #noComments>Comments</ng-template>
|
2018-05-07 17:40:46 +02:00
|
|
|
</div>
|
2018-10-02 11:14:59 +02:00
|
|
|
|
2018-10-18 14:35:31 +02:00
|
|
|
<my-feed [syndicationItems]="syndicationItems"></my-feed>
|
2019-12-27 17:02:34 +01:00
|
|
|
|
|
|
|
<div ngbDropdown class="d-inline-block ml-4">
|
|
|
|
<button class="btn btn-sm btn-outline-secondary" id="dropdownSortComments" ngbDropdownToggle i18n>
|
|
|
|
Sort by
|
|
|
|
</button>
|
|
|
|
<div ngbDropdownMenu aria-labelledby="dropdownSortComments">
|
|
|
|
<button (click)="handleSortChange('-createdAt')" ngbDropdownItem i18n>Most recent first (default)</button>
|
|
|
|
<button (click)="handleSortChange('-totalReplies')" ngbDropdownItem i18n>Most replies first</button>
|
|
|
|
</div>
|
|
|
|
</div>
|
2017-12-27 16:11:53 +01:00
|
|
|
</div>
|
|
|
|
|
2018-01-03 10:12:36 +01:00
|
|
|
<ng-template [ngIf]="video.commentsEnabled === true">
|
|
|
|
<my-video-comment-add
|
|
|
|
[video]="video"
|
2018-01-03 17:25:47 +01:00
|
|
|
[user]="user"
|
2018-01-03 10:12:36 +01:00
|
|
|
(commentCreated)="onCommentThreadCreated($event)"
|
|
|
|
></my-video-comment-add>
|
2017-12-27 16:11:53 +01:00
|
|
|
|
2018-06-04 16:21:17 +02:00
|
|
|
<div *ngIf="componentPagination.totalItems === 0 && comments.length === 0" i18n>No comments.</div>
|
2017-12-27 16:11:53 +01:00
|
|
|
|
2018-01-03 10:12:36 +01:00
|
|
|
<div
|
|
|
|
class="comment-threads"
|
2018-02-13 14:11:05 +01:00
|
|
|
myInfiniteScroller
|
2018-08-24 10:31:56 +02:00
|
|
|
[autoInit]="true"
|
2018-02-13 14:11:05 +01:00
|
|
|
(nearOfBottom)="onNearOfBottom()"
|
2019-08-02 14:49:25 +02:00
|
|
|
[dataObservable]="onDataSubject.asObservable()"
|
2018-01-03 10:12:36 +01:00
|
|
|
>
|
2018-06-14 11:25:49 +02:00
|
|
|
<div #commentHighlightBlock id="highlighted-comment">
|
2018-02-19 10:38:24 +01:00
|
|
|
<my-video-comment
|
2018-06-14 11:25:49 +02:00
|
|
|
*ngIf="highlightedThread"
|
2018-06-04 16:21:17 +02:00
|
|
|
[comment]="highlightedThread"
|
|
|
|
[video]="video"
|
|
|
|
[inReplyToCommentId]="inReplyToCommentId"
|
|
|
|
[commentTree]="threadComments[highlightedThread.id]"
|
|
|
|
[highlightedComment]="true"
|
2019-12-28 12:41:04 +01:00
|
|
|
[firstInThread]="true"
|
2018-06-04 16:21:17 +02:00
|
|
|
(wantedToReply)="onWantedToReply($event)"
|
|
|
|
(wantedToDelete)="onWantedToDelete($event)"
|
|
|
|
(threadCreated)="onThreadCreated($event)"
|
|
|
|
(resetReply)="onResetReply()"
|
2019-12-16 16:21:42 +01:00
|
|
|
(timestampClicked)="handleTimestampClicked($event)"
|
2018-02-19 10:38:24 +01:00
|
|
|
></my-video-comment>
|
|
|
|
</div>
|
|
|
|
|
2019-12-28 12:41:04 +01:00
|
|
|
<div *ngFor="let comment of comments; index as i">
|
2018-01-03 10:12:36 +01:00
|
|
|
<my-video-comment
|
2018-02-21 17:46:04 +01:00
|
|
|
*ngIf="!highlightedThread || comment.id !== highlightedThread.id"
|
2018-01-03 10:12:36 +01:00
|
|
|
[comment]="comment"
|
|
|
|
[video]="video"
|
|
|
|
[inReplyToCommentId]="inReplyToCommentId"
|
|
|
|
[commentTree]="threadComments[comment.id]"
|
2019-12-28 12:41:04 +01:00
|
|
|
[firstInThread]="i + 1 !== comments.length"
|
2018-01-03 10:12:36 +01:00
|
|
|
(wantedToReply)="onWantedToReply($event)"
|
2018-01-04 11:19:16 +01:00
|
|
|
(wantedToDelete)="onWantedToDelete($event)"
|
|
|
|
(threadCreated)="onThreadCreated($event)"
|
2018-01-03 10:12:36 +01:00
|
|
|
(resetReply)="onResetReply()"
|
2019-12-16 16:21:42 +01:00
|
|
|
(timestampClicked)="handleTimestampClicked($event)"
|
2019-12-28 12:41:04 +01:00
|
|
|
>
|
|
|
|
<div *ngIf="comment.totalReplies !== 0 && !threadComments[comment.id]" (click)="viewReplies(comment.id)" class="view-replies mb-2">
|
|
|
|
<span class="glyphicon glyphicon-menu-down"></span>
|
|
|
|
|
|
|
|
<ng-container *ngIf="comment.totalRepliesFromVideoAuthor > 0; then hasAuthorComments; else noAuthorComments"></ng-container>
|
|
|
|
<ng-template #hasAuthorComments>
|
|
|
|
<ng-container *ngIf="comment.totalReplies !== comment.totalRepliesFromVideoAuthor; else onlyAuthorComments" i18n>
|
|
|
|
View {{ comment.totalReplies }} replies from {{ video?.account?.displayName || 'the author' }} and others
|
|
|
|
</ng-container>
|
|
|
|
<ng-template i18n #onlyAuthorComments>
|
|
|
|
View {{ comment.totalReplies }} replies from {{ video?.account?.displayName || 'the author' }}
|
|
|
|
</ng-template>
|
2019-12-28 11:27:31 +01:00
|
|
|
</ng-template>
|
2019-12-28 12:41:04 +01:00
|
|
|
<ng-template i18n #noAuthorComments>View {{ comment.totalReplies }} replies</ng-template>
|
|
|
|
|
|
|
|
<my-small-loader class="comment-thread-loading ml-1" [loading]="threadLoading[comment.id]"></my-small-loader>
|
|
|
|
</div>
|
|
|
|
</my-video-comment>
|
2019-12-28 11:27:31 +01:00
|
|
|
|
2017-12-27 16:11:53 +01:00
|
|
|
</div>
|
|
|
|
</div>
|
2018-01-03 10:12:36 +01:00
|
|
|
</ng-template>
|
|
|
|
|
2018-06-04 16:21:17 +02:00
|
|
|
<div *ngIf="video.commentsEnabled === false" i18n>
|
2018-01-03 10:12:36 +01:00
|
|
|
Comments are disabled.
|
2017-12-27 16:11:53 +01:00
|
|
|
</div>
|
|
|
|
</div>
|