diff --git a/client/src/app/videos/+video-watch/comment/video-comment.component.html b/client/src/app/videos/+video-watch/comment/video-comment.component.html index d5aacf107f5e6f16fa7c4ddd47f4bda9cf4712e3..4753641bd9da6247f43660f22ec4dc70015564b6 100644 --- a/client/src/app/videos/+video-watch/comment/video-comment.component.html +++ b/client/src/app/videos/+video-watch/comment/video-comment.component.html @@ -11,7 +11,7 @@ <div class="vertical-border"></div> </div> - <div class="right"> + <div class="right" [ngClass]="{ 'mb-3': firstInThread }"> <span *ngIf="comment.isDeleted" class="comment-avatar"></span> <div class="comment"> @@ -81,5 +81,7 @@ </div> </div> </div> + + <ng-content></ng-content> </div> </div> diff --git a/client/src/app/videos/+video-watch/comment/video-comment.component.ts b/client/src/app/videos/+video-watch/comment/video-comment.component.ts index 0d48f0a8205d2bac46482666c42824f82d3b8ac1..8c376d654b87f11f1a905618994db66d456859a5 100644 --- a/client/src/app/videos/+video-watch/comment/video-comment.component.ts +++ b/client/src/app/videos/+video-watch/comment/video-comment.component.ts @@ -22,6 +22,7 @@ export class VideoCommentComponent implements OnInit, OnChanges { @Input() commentTree: VideoCommentThreadTree @Input() inReplyToCommentId: number @Input() highlightedComment = false + @Input() firstInThread = false @Output() wantedToDelete = new EventEmitter<VideoComment>() @Output() wantedToReply = new EventEmitter<VideoComment>() 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 8f5c583d38ef1dbf2e9cbf0ae0f3b2f8f5f44af8..e25efc3ee0cf399e918048234c711c6537b3088f 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 @@ -46,6 +46,7 @@ [inReplyToCommentId]="inReplyToCommentId" [commentTree]="threadComments[highlightedThread.id]" [highlightedComment]="true" + [firstInThread]="true" (wantedToReply)="onWantedToReply($event)" (wantedToDelete)="onWantedToDelete($event)" (threadCreated)="onThreadCreated($event)" @@ -54,36 +55,38 @@ ></my-video-comment> </div> - <div *ngFor="let comment of comments"> + <div *ngFor="let comment of comments; index as i"> <my-video-comment *ngIf="!highlightedThread || comment.id !== highlightedThread.id" [comment]="comment" [video]="video" [inReplyToCommentId]="inReplyToCommentId" [commentTree]="threadComments[comment.id]" + [firstInThread]="i + 1 !== comments.length" (wantedToReply)="onWantedToReply($event)" (wantedToDelete)="onWantedToDelete($event)" (threadCreated)="onThreadCreated($event)" (resetReply)="onResetReply()" (timestampClicked)="handleTimestampClicked($event)" - ></my-video-comment> - - <div *ngIf="comment.totalReplies !== 0 && !threadComments[comment.id]" (click)="viewReplies(comment.id)" class="view-replies"> - <span *ngIf="!threadLoading[comment.id]" 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' }} + > + <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> </ng-template> - </ng-template> - <ng-template i18n #noAuthorComments>View {{ comment.totalReplies }} replies</ng-template> + <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> - <my-small-loader class="comment-thread-loading" [loading]="threadLoading[comment.id]"></my-small-loader> - </div> </div> </div> </ng-template> diff --git a/client/src/app/videos/+video-watch/comment/video-comments.component.scss b/client/src/app/videos/+video-watch/comment/video-comments.component.scss index 600bc1ceee4efc08018b47aa7626a8cc56ce704a..f95ff5aba9e9139ba8946c9bc5a2b23c6d9d654a 100644 --- a/client/src/app/videos/+video-watch/comment/video-comments.component.scss +++ b/client/src/app/videos/+video-watch/comment/video-comments.component.scss @@ -9,8 +9,6 @@ font-weight: $font-semibold; font-size: 15px; cursor: pointer; - margin-left: 46px; - margin-bottom: 10px; } .glyphicon, .comment-thread-loading {