From 9b4b15f91c485f9a7fe2ed314b4101f4b7506b38 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Aur=C3=A9lien=20B=C3=A9ranger?= <43744761+auberanger@users.noreply.github.com> Date: Mon, 14 Jan 2019 09:06:48 +0100 Subject: WIP : Indicate to users how "trending" works (#1458) * Get the INTERVAL_DAYS const in the video-trending component * Change Trending section title * Add a tooltip to explain how trending section works * Minor CSS fix for the my-feed popover next to the titlepage --- client/src/app/videos/video-list/video-trending.component.ts | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) (limited to 'client/src/app/videos/video-list/video-trending.component.ts') diff --git a/client/src/app/videos/video-list/video-trending.component.ts b/client/src/app/videos/video-list/video-trending.component.ts index accc5bfe5..d3c0f5316 100644 --- a/client/src/app/videos/video-list/video-trending.component.ts +++ b/client/src/app/videos/video-list/video-trending.component.ts @@ -8,7 +8,7 @@ import { VideoSortField } from '../../shared/video/sort-field.type' import { VideoService } from '../../shared/video/video.service' import { I18n } from '@ngx-translate/i18n-polyfill' import { ScreenService } from '@app/shared/misc/screen.service' -import { Notifier } from '@app/core' +import { Notifier, ServerService } from '@app/core' @Component({ selector: 'my-videos-trending', @@ -19,6 +19,7 @@ export class VideoTrendingComponent extends AbstractVideoList implements OnInit, titlePage: string currentRoute = '/videos/trending' defaultSort: VideoSortField = '-trending' + trendingDays: number constructor ( protected router: Router, @@ -27,12 +28,19 @@ export class VideoTrendingComponent extends AbstractVideoList implements OnInit, protected authService: AuthService, protected location: Location, protected screenService: ScreenService, + private serverService: ServerService, protected i18n: I18n, private videoService: VideoService ) { super() - this.titlePage = i18n('Trending') + this.trendingDays = this.serverService.getConfig().trending.videos.intervalDays + + this.titlePage = this.i18n('Trending for the last ') + this.trendingDays === 1 ? this.titlePage += '24 hours' : this.titlePage += this.trendingDays + ' days' + + this.titleTooltip = this.i18n('trending videos are those totalizing the greatest number of views during the last ') + this.trendingDays === 1 ? this.titleTooltip += '24 hours.' : this.titleTooltip += this.trendingDays + ' days.' } ngOnInit () { -- cgit v1.2.3