Show number of comments under a video in watch view
authorRigel Kent <sendmemail@rigelk.eu>
Fri, 13 Dec 2019 21:23:13 +0000 (22:23 +0100)
committerRigel Kent <sendmemail@rigelk.eu>
Fri, 13 Dec 2019 21:23:26 +0000 (22:23 +0100)
resolves #2338

client/src/app/videos/+video-watch/comment/video-comments.component.html

index be20a84906afc5f989b4950a48bc799c39525c94..844263ddd3e1d9d083951c4e514747a936271aa6 100644 (file)
@@ -1,7 +1,12 @@
 <div>
   <div class="title-block">
-    <div i18n class="title-page title-page-single">
-      Comments
+    <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>