Comments
</div>
- <my-video-comment-add
- *ngIf="isUserLoggedIn()"
- [video]="video"
- (commentCreated)="onCommentThreadCreated($event)"
- ></my-video-comment-add>
+ <ng-template [ngIf]="video.commentsEnabled === true">
+ <my-video-comment-add
+ *ngIf="isUserLoggedIn()"
+ [video]="video"
+ [user]="user"
+ (commentCreated)="onCommentThreadCreated($event)"
+ ></my-video-comment-add>
- <div class="comment-threads">
- <div *ngFor="let comment of comments">
- <my-video-comment
- [comment]="comment"
- [video]="video"
- [inReplyToCommentId]="inReplyToCommentId"
- [commentTree]="threadComments[comment.id]"
- (wantedToReply)="onWantedToReply($event)"
- (resetReply)="onResetReply()"
- ></my-video-comment>
+ <div *ngIf="componentPagination.totalItems === 0 && comments.length === 0">No comments.</div>
- <div *ngIf="comment.totalReplies !== 0 && !threadComments[comment.id]" (click)="viewReplies(comment)" class="view-replies">
- View all {{ comment.totalReplies }} replies
+ <div
+ class="comment-threads"
+ myInfiniteScroller
+ [autoLoading]="true"
+ (nearOfBottom)="onNearOfBottom()"
+ >
+ <div *ngIf="highlightedThread" id="highlighted-comment">
+ <my-video-comment
+ [comment]="highlightedThread"
+ [video]="video"
+ [inReplyToCommentId]="inReplyToCommentId"
+ [commentTree]="threadComments[highlightedThread.id]"
+ [highlightedComment]="true"
+ (wantedToReply)="onWantedToReply($event)"
+ (wantedToDelete)="onWantedToDelete($event)"
+ (threadCreated)="onThreadCreated($event)"
+ (resetReply)="onResetReply()"
+ ></my-video-comment>
+ </div>
+
+ <div *ngFor="let comment of comments">
+ <my-video-comment
+ *ngIf="!highlightedThread || comment.id !== highlightedThread.id"
+ [comment]="comment"
+ [video]="video"
+ [inReplyToCommentId]="inReplyToCommentId"
+ [commentTree]="threadComments[comment.id]"
+ (wantedToReply)="onWantedToReply($event)"
+ (wantedToDelete)="onWantedToDelete($event)"
+ (threadCreated)="onThreadCreated($event)"
+ (resetReply)="onResetReply()"
+ ></my-video-comment>
- <span *ngIf="!threadLoading[comment.id]" class="glyphicon glyphicon-menu-down"></span>
- <my-loader class="comment-thread-loading" [loading]="threadLoading[comment.id]"></my-loader>
+ <div *ngIf="comment.totalReplies !== 0 && !threadComments[comment.id]" (click)="viewReplies(comment.id)" class="view-replies">
+ View all {{ comment.totalReplies }} replies
+
+ <span *ngIf="!threadLoading[comment.id]" class="glyphicon glyphicon-menu-down"></span>
+ <my-loader class="comment-thread-loading" [loading]="threadLoading[comment.id]"></my-loader>
+ </div>
</div>
</div>
+ </ng-template>
+
+ <div *ngIf="video.commentsEnabled === false">
+ Comments are disabled.
</div>
</div>