]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blobdiff - client/src/app/videos/+video-watch/comment/video-comments.component.html
Merge branch 'release/2.1.0' into develop
[github/Chocobozzz/PeerTube.git] / client / src / app / videos / +video-watch / comment / video-comments.component.html
index e284eab0a1e3203bb30c78d9356217de1cc4d9e3..2bf52ab86aea3886d9b39d42677581079ee86af1 100644 (file)
@@ -1,10 +1,10 @@
 <div>
   <div class="title-block">
     <div class="title-page title-page-single">
-      <ng-container *ngIf="comments.length > 0; then hasComments; else noComments"></ng-container>
+      <ng-container *ngIf="componentPagination.totalItems > 0; then hasComments; else noComments"></ng-container>
       <ng-template #hasComments>
-        <ng-container i18n *ngIf="comments.length === 1; else manyComments">1 Comment</ng-container>
-        <ng-template i18n #manyComments>{{ comments.length }} Comments</ng-template>
+        <ng-container i18n *ngIf="componentPagination.totalItems === 1; else manyComments">1 Comment</ng-container>
+        <ng-template i18n #manyComments>{{ componentPagination.totalItems }} Comments</ng-template>
       </ng-template>
       <ng-template i18n #noComments>Comments</ng-template>
     </div>
@@ -46,6 +46,7 @@
           [inReplyToCommentId]="inReplyToCommentId"
           [commentTree]="threadComments[highlightedThread.id]"
           [highlightedComment]="true"
+          [firstInThread]="true"
           (wantedToReply)="onWantedToReply($event)"
           (wantedToDelete)="onWantedToDelete($event)"
           (threadCreated)="onThreadCreated($event)"
         ></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">
-          <ng-container i18n>View all {{ comment.totalReplies }} replies</ng-container>
+        >
+          <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 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>
 
-          <span *ngIf="!threadLoading[comment.id]" class="glyphicon glyphicon-menu-down"></span>
-          <my-small-loader class="comment-thread-loading" [loading]="threadLoading[comment.id]"></my-small-loader>
-        </div>
       </div>
     </div>
   </ng-template>