add title attribute for exact view counters (#3365)
This commit is contained in:
parent
e6ad431685
commit
992f498e31
|
@ -54,7 +54,9 @@
|
||||||
<div class="video-info-date-views">
|
<div class="video-info-date-views">
|
||||||
<ng-container i18n>Published <my-date-toggle [date]="video.publishedAt"></my-date-toggle></ng-container>
|
<ng-container i18n>Published <my-date-toggle [date]="video.publishedAt"></my-date-toggle></ng-container>
|
||||||
|
|
||||||
<span i18n class="views">
|
<span i18n
|
||||||
|
title="{{ getExactNumberOfViews() }}"
|
||||||
|
class="views">
|
||||||
• {{ video.views | myNumberFormatter }}
|
• {{ video.views | myNumberFormatter }}
|
||||||
<ng-container *ngIf="!video.isLive">views</ng-container>
|
<ng-container *ngIf="!video.isLive">views</ng-container>
|
||||||
<ng-container *ngIf="video.isLive">viewers</ng-container>
|
<ng-container *ngIf="video.isLive">viewers</ng-container>
|
||||||
|
@ -71,7 +73,9 @@
|
||||||
<div class="d-none d-md-block video-info-date-views">
|
<div class="d-none d-md-block video-info-date-views">
|
||||||
<ng-container i18n>Published <my-date-toggle [date]="video.publishedAt"></my-date-toggle></ng-container>
|
<ng-container i18n>Published <my-date-toggle [date]="video.publishedAt"></my-date-toggle></ng-container>
|
||||||
|
|
||||||
<span i18n class="views">
|
<span i18n
|
||||||
|
title="{{ getExactNumberOfViews() }}"
|
||||||
|
class="views">
|
||||||
• {{ video.views | myNumberFormatter }}
|
• {{ video.views | myNumberFormatter }}
|
||||||
<ng-container *ngIf="!video.isLive">views</ng-container>
|
<ng-container *ngIf="!video.isLive">views</ng-container>
|
||||||
<ng-container *ngIf="video.isLive">viewers</ng-container>
|
<ng-container *ngIf="video.isLive">viewers</ng-container>
|
||||||
|
|
|
@ -219,6 +219,12 @@ export class VideoWatchComponent implements OnInit, OnDestroy {
|
||||||
return $localize`You need to be <a href="/login">logged in</a> to rate this video.`
|
return $localize`You need to be <a href="/login">logged in</a> to rate this video.`
|
||||||
}
|
}
|
||||||
|
|
||||||
|
getExactNumberOfViews () {
|
||||||
|
return (this.video.views >= 1000)
|
||||||
|
? `${this.video.views} ${this.video.isLive ? $localize`viewers` : $localize`views`}`
|
||||||
|
: ''
|
||||||
|
}
|
||||||
|
|
||||||
showMoreDescription () {
|
showMoreDescription () {
|
||||||
if (this.completeVideoDescription === undefined) {
|
if (this.completeVideoDescription === undefined) {
|
||||||
return this.loadCompleteDescription()
|
return this.loadCompleteDescription()
|
||||||
|
|
|
@ -26,9 +26,11 @@
|
||||||
<span class="video-miniature-created-at-views">
|
<span class="video-miniature-created-at-views">
|
||||||
<my-date-toggle *ngIf="displayOptions.date" [date]="video.publishedAt"></my-date-toggle>
|
<my-date-toggle *ngIf="displayOptions.date" [date]="video.publishedAt"></my-date-toggle>
|
||||||
|
|
||||||
<span class="views">
|
<span class="views" title="{{ getExactNumberOfViews() }}">
|
||||||
<ng-container *ngIf="displayOptions.date && displayOptions.views"> • </ng-container>
|
<ng-container *ngIf="displayOptions.date && displayOptions.views"> • </ng-container>
|
||||||
<ng-container i18n *ngIf="displayOptions.views">{video.views, plural, =1 {1 view} other {{{ video.views | myNumberFormatter }} views}}</ng-container>
|
<ng-container i18n *ngIf="displayOptions.views">
|
||||||
|
{video.views, plural, =1 {1 view} other {{{ video.views | myNumberFormatter }} views}}
|
||||||
|
</ng-container>
|
||||||
</span>
|
</span>
|
||||||
</span>
|
</span>
|
||||||
|
|
||||||
|
|
|
@ -190,6 +190,12 @@ export class VideoMiniatureComponent implements OnInit {
|
||||||
return this.video.videoChannelAvatarUrl
|
return this.video.videoChannelAvatarUrl
|
||||||
}
|
}
|
||||||
|
|
||||||
|
getExactNumberOfViews () {
|
||||||
|
return (this.video.views >= 1000 && this.displayOptions.views)
|
||||||
|
? `${this.video.views} ${this.video.isLive ? $localize`viewers` : $localize`views`}`
|
||||||
|
: ''
|
||||||
|
}
|
||||||
|
|
||||||
loadActions () {
|
loadActions () {
|
||||||
if (this.displayVideoActions) this.showActions = true
|
if (this.displayVideoActions) this.showActions = true
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue