]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blobdiff - client/src/app/videos/+video-watch/comment/video-comments.component.html
Add commentor name alongside fid for video comments
[github/Chocobozzz/PeerTube.git] / client / src / app / videos / +video-watch / comment / video-comments.component.html
index 4a424807302564646db1e7d812cfe013045323a8..5fabb7dfe70a62df015e88980eeb70b239532bd7 100644 (file)
@@ -1,46 +1,74 @@
 <div>
-  <div class="title-page title-page-single">
-    Comments
+  <div class="title-block">
+    <div class="title-page title-page-single">
+      <ng-container *ngIf="comments.length > 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-template>
+      <ng-template i18n #noComments>Comments</ng-template>
+    </div>
+
+    <my-feed [syndicationItems]="syndicationItems"></my-feed>
   </div>
 
   <ng-template [ngIf]="video.commentsEnabled === true">
     <my-video-comment-add
-      *ngIf="isUserLoggedIn()"
       [video]="video"
       [user]="user"
       (commentCreated)="onCommentThreadCreated($event)"
     ></my-video-comment-add>
 
-    <div *ngIf="componentPagination.totalItems === 0 && comments.length === 0">No comments.</div>
+    <div *ngIf="componentPagination.totalItems === 0 && comments.length === 0" i18n>No comments.</div>
 
     <div
       class="comment-threads"
-      infiniteScroll
-      [infiniteScrollUpDistance]="1.5"
-      [infiniteScrollDistance]="0.5"
-      (scrolled)="onNearOfBottom()"
+      myInfiniteScroller
+      [autoInit]="true"
+      (nearOfBottom)="onNearOfBottom()"
+      [dataObservable]="onDataSubject.asObservable()"
     >
+      <div #commentHighlightBlock id="highlighted-comment">
+        <my-video-comment
+          *ngIf="highlightedThread"
+          [comment]="highlightedThread"
+          [video]="video"
+          [inReplyToCommentId]="inReplyToCommentId"
+          [commentTree]="threadComments[highlightedThread.id]"
+          [highlightedComment]="true"
+          (wantedToReply)="onWantedToReply($event)"
+          (wantedToDelete)="onWantedToDelete($event)"
+          (threadCreated)="onThreadCreated($event)"
+          (resetReply)="onResetReply()"
+          (timestampClicked)="handleTimestampClicked($event)"
+        ></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()"
+          (timestampClicked)="handleTimestampClicked($event)"
         ></my-video-comment>
 
-        <div *ngIf="comment.totalReplies !== 0 && !threadComments[comment.id]" (click)="viewReplies(comment)" class="view-replies">
-          View all {{ comment.totalReplies }} replies
+        <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>
 
           <span *ngIf="!threadLoading[comment.id]" class="glyphicon glyphicon-menu-down"></span>
-          <my-loader class="comment-thread-loading" [loading]="threadLoading[comment.id]"></my-loader>
+          <my-small-loader class="comment-thread-loading" [loading]="threadLoading[comment.id]"></my-small-loader>
         </div>
       </div>
     </div>
   </ng-template>
 
-  <div *ngIf="video.commentsEnabled === false">
+  <div *ngIf="video.commentsEnabled === false" i18n>
     Comments are disabled.
   </div>
 </div>