aboutsummaryrefslogtreecommitdiffhomepage
path: root/client/src/app/videos/+video-watch
diff options
context:
space:
mode:
Diffstat (limited to 'client/src/app/videos/+video-watch')
-rw-r--r--client/src/app/videos/+video-watch/comment/video-comments.component.html58
-rw-r--r--client/src/app/videos/+video-watch/comment/video-comments.component.ts7
2 files changed, 38 insertions, 27 deletions
diff --git a/client/src/app/videos/+video-watch/comment/video-comments.component.html b/client/src/app/videos/+video-watch/comment/video-comments.component.html
index 5c6908150..078900e06 100644
--- a/client/src/app/videos/+video-watch/comment/video-comments.component.html
+++ b/client/src/app/videos/+video-watch/comment/video-comments.component.html
@@ -3,35 +3,43 @@
3 Comments 3 Comments
4 </div> 4 </div>
5 5
6 <my-video-comment-add 6 <ng-template [ngIf]="video.commentsEnabled === true">
7 *ngIf="isUserLoggedIn()" 7 <my-video-comment-add
8 [video]="video" 8 *ngIf="isUserLoggedIn()"
9 (commentCreated)="onCommentThreadCreated($event)" 9 [video]="video"
10 ></my-video-comment-add> 10 (commentCreated)="onCommentThreadCreated($event)"
11 ></my-video-comment-add>
11 12
12 <div 13 <div *ngIf="componentPagination.totalItems === 0 && comments.length === 0">No comments.</div>
13 class="comment-threads"
14 infiniteScroll
15 [infiniteScrollUpDistance]="1.5"
16 [infiniteScrollDistance]="0.5"
17 (scrolled)="onNearOfBottom()"
18 >
19 <div *ngFor="let comment of comments">
20 <my-video-comment
21 [comment]="comment"
22 [video]="video"
23 [inReplyToCommentId]="inReplyToCommentId"
24 [commentTree]="threadComments[comment.id]"
25 (wantedToReply)="onWantedToReply($event)"
26 (resetReply)="onResetReply()"
27 ></my-video-comment>
28 14
29 <div *ngIf="comment.totalReplies !== 0 && !threadComments[comment.id]" (click)="viewReplies(comment)" class="view-replies"> 15 <div
30 View all {{ comment.totalReplies }} replies 16 class="comment-threads"
17 infiniteScroll
18 [infiniteScrollUpDistance]="1.5"
19 [infiniteScrollDistance]="0.5"
20 (scrolled)="onNearOfBottom()"
21 >
22 <div *ngFor="let comment of comments">
23 <my-video-comment
24 [comment]="comment"
25 [video]="video"
26 [inReplyToCommentId]="inReplyToCommentId"
27 [commentTree]="threadComments[comment.id]"
28 (wantedToReply)="onWantedToReply($event)"
29 (resetReply)="onResetReply()"
30 ></my-video-comment>
31 31
32 <span *ngIf="!threadLoading[comment.id]" class="glyphicon glyphicon-menu-down"></span> 32 <div *ngIf="comment.totalReplies !== 0 && !threadComments[comment.id]" (click)="viewReplies(comment)" class="view-replies">
33 <my-loader class="comment-thread-loading" [loading]="threadLoading[comment.id]"></my-loader> 33 View all {{ comment.totalReplies }} replies
34
35 <span *ngIf="!threadLoading[comment.id]" class="glyphicon glyphicon-menu-down"></span>
36 <my-loader class="comment-thread-loading" [loading]="threadLoading[comment.id]"></my-loader>
37 </div>
34 </div> 38 </div>
35 </div> 39 </div>
40 </ng-template>
41
42 <div *ngIf="video.commentsEnabled === false">
43 Comments are disabled.
36 </div> 44 </div>
37</div> 45</div>
diff --git a/client/src/app/videos/+video-watch/comment/video-comments.component.ts b/client/src/app/videos/+video-watch/comment/video-comments.component.ts
index f4dda9089..4d801c970 100644
--- a/client/src/app/videos/+video-watch/comment/video-comments.component.ts
+++ b/client/src/app/videos/+video-watch/comment/video-comments.component.ts
@@ -5,6 +5,7 @@ import { AuthService } from '../../../core/auth'
5import { ComponentPagination } from '../../../shared/rest/component-pagination.model' 5import { ComponentPagination } from '../../../shared/rest/component-pagination.model'
6import { User } from '../../../shared/users' 6import { User } from '../../../shared/users'
7import { SortField } from '../../../shared/video/sort-field.type' 7import { SortField } from '../../../shared/video/sort-field.type'
8import { VideoDetails } from '../../../shared/video/video-details.model'
8import { Video } from '../../../shared/video/video.model' 9import { Video } from '../../../shared/video/video.model'
9import { VideoComment } from './video-comment.model' 10import { VideoComment } from './video-comment.model'
10import { VideoCommentService } from './video-comment.service' 11import { VideoCommentService } from './video-comment.service'
@@ -15,7 +16,7 @@ import { VideoCommentService } from './video-comment.service'
15 styleUrls: ['./video-comments.component.scss'] 16 styleUrls: ['./video-comments.component.scss']
16}) 17})
17export class VideoCommentsComponent implements OnInit { 18export class VideoCommentsComponent implements OnInit {
18 @Input() video: Video 19 @Input() video: VideoDetails
19 @Input() user: User 20 @Input() user: User
20 21
21 comments: VideoComment[] = [] 22 comments: VideoComment[] = []
@@ -36,7 +37,9 @@ export class VideoCommentsComponent implements OnInit {
36 ) {} 37 ) {}
37 38
38 ngOnInit () { 39 ngOnInit () {
39 this.loadMoreComments() 40 if (this.video.commentsEnabled === true) {
41 this.loadMoreComments()
42 }
40 } 43 }
41 44
42 viewReplies (comment: VideoComment) { 45 viewReplies (comment: VideoComment) {