]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/commitdiff
Add help to understand what is a view
authorChocobozzz <me@florianbigard.com>
Fri, 6 May 2022 12:56:34 +0000 (14:56 +0200)
committerChocobozzz <me@florianbigard.com>
Fri, 6 May 2022 12:56:34 +0000 (14:56 +0200)
client/src/app/+stats/video/video-stats.component.html
client/src/app/+stats/video/video-stats.component.ts

index e5412f1b818cac308443491b1dbce43e2ad3a7ac..2cd47bb26d12fcc22fcc5dd0d46abc06c6bd7ce7 100644 (file)
@@ -4,7 +4,13 @@
   <div class="stats-embed">
     <div class="global-stats">
       <div *ngFor="let card of globalStatsCards" class="card stats-card">
-        <div class="label">{{ card.label }}</div>
+        <div class="label">
+          {{ card.label }}
+
+          <my-help *ngIf="card.help">
+            <ng-template ptTemplate="customHtml">{{ card.help }}</ng-template>
+          </my-help>
+        </div>
         <div class="value">{{ card.value }}</div>
         <div *ngIf="card.moreInfo" class="more-info">{{ card.moreInfo }}</div>
       </div>
index f433259ef93ceba1803df0d89f66d76ce0fe59ba..b6b71d46307517344adafe71515d984ba32f2bff 100644 (file)
@@ -30,7 +30,7 @@ type ChartBuilderResult = {
   displayLegend: boolean
 }
 
-type Card = { label: string, value: string | number, moreInfo?: string }
+type Card = { label: string, value: string | number, moreInfo?: string, help?: string }
 
 @Component({
   templateUrl: './video-stats.component.html',
@@ -252,7 +252,8 @@ export class VideoStatsComponent implements OnInit {
     this.globalStatsCards = [
       {
         label: $localize`Views`,
-        value: this.numberFormatter.transform(this.video.views)
+        value: this.numberFormatter.transform(this.video.views),
+        help: $localize`A view means that someone watched the video for at least 30 seconds`
       },
       {
         label: $localize`Likes`,