diff options
author | Tanguy BERNARD <bernardtanguy1pro@gmail.com> | 2020-11-27 14:27:14 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-11-27 14:27:14 +0100 |
commit | 992f498e312efcde46f818ba719b50f1f958272f (patch) | |
tree | ab7f2e4e4be96097ea450e06243ccebe8acde8fa /client/src/app/+videos | |
parent | e6ad43168587eaa4a6ae1f239df233bc88b723d4 (diff) | |
download | PeerTube-992f498e312efcde46f818ba719b50f1f958272f.tar.gz PeerTube-992f498e312efcde46f818ba719b50f1f958272f.tar.zst PeerTube-992f498e312efcde46f818ba719b50f1f958272f.zip |
add title attribute for exact view counters (#3365)
Diffstat (limited to 'client/src/app/+videos')
-rw-r--r-- | client/src/app/+videos/+video-watch/video-watch.component.html | 8 | ||||
-rw-r--r-- | client/src/app/+videos/+video-watch/video-watch.component.ts | 6 |
2 files changed, 12 insertions, 2 deletions
diff --git a/client/src/app/+videos/+video-watch/video-watch.component.html b/client/src/app/+videos/+video-watch/video-watch.component.html index a90908dbe..d74334b13 100644 --- a/client/src/app/+videos/+video-watch/video-watch.component.html +++ b/client/src/app/+videos/+video-watch/video-watch.component.html | |||
@@ -54,7 +54,9 @@ | |||
54 | <div class="video-info-date-views"> | 54 | <div class="video-info-date-views"> |
55 | <ng-container i18n>Published <my-date-toggle [date]="video.publishedAt"></my-date-toggle></ng-container> | 55 | <ng-container i18n>Published <my-date-toggle [date]="video.publishedAt"></my-date-toggle></ng-container> |
56 | 56 | ||
57 | <span i18n class="views"> | 57 | <span i18n |
58 | title="{{ getExactNumberOfViews() }}" | ||
59 | class="views"> | ||
58 | • {{ video.views | myNumberFormatter }} | 60 | • {{ video.views | myNumberFormatter }} |
59 | <ng-container *ngIf="!video.isLive">views</ng-container> | 61 | <ng-container *ngIf="!video.isLive">views</ng-container> |
60 | <ng-container *ngIf="video.isLive">viewers</ng-container> | 62 | <ng-container *ngIf="video.isLive">viewers</ng-container> |
@@ -71,7 +73,9 @@ | |||
71 | <div class="d-none d-md-block video-info-date-views"> | 73 | <div class="d-none d-md-block video-info-date-views"> |
72 | <ng-container i18n>Published <my-date-toggle [date]="video.publishedAt"></my-date-toggle></ng-container> | 74 | <ng-container i18n>Published <my-date-toggle [date]="video.publishedAt"></my-date-toggle></ng-container> |
73 | 75 | ||
74 | <span i18n class="views"> | 76 | <span i18n |
77 | title="{{ getExactNumberOfViews() }}" | ||
78 | class="views"> | ||
75 | • {{ video.views | myNumberFormatter }} | 79 | • {{ video.views | myNumberFormatter }} |
76 | <ng-container *ngIf="!video.isLive">views</ng-container> | 80 | <ng-container *ngIf="!video.isLive">views</ng-container> |
77 | <ng-container *ngIf="video.isLive">viewers</ng-container> | 81 | <ng-container *ngIf="video.isLive">viewers</ng-container> |
diff --git a/client/src/app/+videos/+video-watch/video-watch.component.ts b/client/src/app/+videos/+video-watch/video-watch.component.ts index 66af9709d..bc047489e 100644 --- a/client/src/app/+videos/+video-watch/video-watch.component.ts +++ b/client/src/app/+videos/+video-watch/video-watch.component.ts | |||
@@ -219,6 +219,12 @@ export class VideoWatchComponent implements OnInit, OnDestroy { | |||
219 | return $localize`You need to be <a href="/login">logged in</a> to rate this video.` | 219 | return $localize`You need to be <a href="/login">logged in</a> to rate this video.` |
220 | } | 220 | } |
221 | 221 | ||
222 | getExactNumberOfViews () { | ||
223 | return (this.video.views >= 1000) | ||
224 | ? `${this.video.views} ${this.video.isLive ? $localize`viewers` : $localize`views`}` | ||
225 | : '' | ||
226 | } | ||
227 | |||
222 | showMoreDescription () { | 228 | showMoreDescription () { |
223 | if (this.completeVideoDescription === undefined) { | 229 | if (this.completeVideoDescription === undefined) { |
224 | return this.loadCompleteDescription() | 230 | return this.loadCompleteDescription() |