aboutsummaryrefslogtreecommitdiffhomepage
path: root/client/src/app/videos
diff options
context:
space:
mode:
authorAurélien Béranger <43744761+auberanger@users.noreply.github.com>2019-01-14 09:06:48 +0100
committerChocobozzz <chocobozzz@cpy.re>2019-01-14 09:06:48 +0100
commit9b4b15f91c485f9a7fe2ed314b4101f4b7506b38 (patch)
tree6ab137f0d309da68ab357602ddd7f56390280a72 /client/src/app/videos
parente902e03f0fd2eded99d635b1f9d2c59f417c4721 (diff)
downloadPeerTube-9b4b15f91c485f9a7fe2ed314b4101f4b7506b38.tar.gz
PeerTube-9b4b15f91c485f9a7fe2ed314b4101f4b7506b38.tar.zst
PeerTube-9b4b15f91c485f9a7fe2ed314b4101f4b7506b38.zip
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
Diffstat (limited to 'client/src/app/videos')
-rw-r--r--client/src/app/videos/video-list/video-trending.component.ts12
1 files changed, 10 insertions, 2 deletions
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'
8import { VideoService } from '../../shared/video/video.service' 8import { VideoService } from '../../shared/video/video.service'
9import { I18n } from '@ngx-translate/i18n-polyfill' 9import { I18n } from '@ngx-translate/i18n-polyfill'
10import { ScreenService } from '@app/shared/misc/screen.service' 10import { ScreenService } from '@app/shared/misc/screen.service'
11import { Notifier } from '@app/core' 11import { Notifier, ServerService } from '@app/core'
12 12
13@Component({ 13@Component({
14 selector: 'my-videos-trending', 14 selector: 'my-videos-trending',
@@ -19,6 +19,7 @@ export class VideoTrendingComponent extends AbstractVideoList implements OnInit,
19 titlePage: string 19 titlePage: string
20 currentRoute = '/videos/trending' 20 currentRoute = '/videos/trending'
21 defaultSort: VideoSortField = '-trending' 21 defaultSort: VideoSortField = '-trending'
22 trendingDays: number
22 23
23 constructor ( 24 constructor (
24 protected router: Router, 25 protected router: Router,
@@ -27,12 +28,19 @@ export class VideoTrendingComponent extends AbstractVideoList implements OnInit,
27 protected authService: AuthService, 28 protected authService: AuthService,
28 protected location: Location, 29 protected location: Location,
29 protected screenService: ScreenService, 30 protected screenService: ScreenService,
31 private serverService: ServerService,
30 protected i18n: I18n, 32 protected i18n: I18n,
31 private videoService: VideoService 33 private videoService: VideoService
32 ) { 34 ) {
33 super() 35 super()
34 36
35 this.titlePage = i18n('Trending') 37 this.trendingDays = this.serverService.getConfig().trending.videos.intervalDays
38
39 this.titlePage = this.i18n('Trending for the last ')
40 this.trendingDays === 1 ? this.titlePage += '24 hours' : this.titlePage += this.trendingDays + ' days'
41
42 this.titleTooltip = this.i18n('trending videos are those totalizing the greatest number of views during the last ')
43 this.trendingDays === 1 ? this.titleTooltip += '24 hours.' : this.titleTooltip += this.trendingDays + ' days.'
36 } 44 }
37 45
38 ngOnInit () { 46 ngOnInit () {