aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rw-r--r--client/src/app/core/server/server.service.ts5
-rw-r--r--client/src/app/shared/video/abstract-video-list.html5
-rw-r--r--client/src/app/shared/video/abstract-video-list.scss2
-rw-r--r--client/src/app/shared/video/abstract-video-list.ts2
-rw-r--r--client/src/app/videos/video-list/video-trending.component.ts12
-rw-r--r--server/controllers/api/config.ts5
-rw-r--r--shared/models/server/server-config.model.ts6
7 files changed, 33 insertions, 4 deletions
diff --git a/client/src/app/core/server/server.service.ts b/client/src/app/core/server/server.service.ts
index f33e6f20c..4ae72427b 100644
--- a/client/src/app/core/server/server.service.ts
+++ b/client/src/app/core/server/server.service.ts
@@ -87,6 +87,11 @@ export class ServerService {
87 enabled: false 87 enabled: false
88 } 88 }
89 } 89 }
90 },
91 trending: {
92 videos: {
93 intervalDays: 0
94 }
90 } 95 }
91 } 96 }
92 private videoCategories: Array<VideoConstant<number>> = [] 97 private videoCategories: Array<VideoConstant<number>> = []
diff --git a/client/src/app/shared/video/abstract-video-list.html b/client/src/app/shared/video/abstract-video-list.html
index 29492351b..1f97bc389 100644
--- a/client/src/app/shared/video/abstract-video-list.html
+++ b/client/src/app/shared/video/abstract-video-list.html
@@ -1,8 +1,11 @@
1<div [ngClass]="{ 'margin-content': marginContent }"> 1<div [ngClass]="{ 'margin-content': marginContent }">
2 <div class="videos-header"> 2 <div class="videos-header">
3 <div *ngIf="titlePage" class="title-page title-page-single"> 3 <div *ngIf="titlePage" class="title-page title-page-single">
4 {{ titlePage }} 4 <div placement="bottom" [ngbTooltip]="titleTooltip" container="body">
5 {{ titlePage }}
6 </div>
5 </div> 7 </div>
8
6 <my-feed [syndicationItems]="syndicationItems"></my-feed> 9 <my-feed [syndicationItems]="syndicationItems"></my-feed>
7 10
8 <div class="moderation-block" *ngIf="displayModerationBlock"> 11 <div class="moderation-block" *ngIf="displayModerationBlock">
diff --git a/client/src/app/shared/video/abstract-video-list.scss b/client/src/app/shared/video/abstract-video-list.scss
index 9fb3fd4d6..292ede698 100644
--- a/client/src/app/shared/video/abstract-video-list.scss
+++ b/client/src/app/shared/video/abstract-video-list.scss
@@ -19,8 +19,8 @@
19 19
20 my-feed { 20 my-feed {
21 display: inline-block; 21 display: inline-block;
22 position: relative;
23 top: 1px; 22 top: 1px;
23 min-width: 60px;
24 } 24 }
25 25
26 .moderation-block { 26 .moderation-block {
diff --git a/client/src/app/shared/video/abstract-video-list.ts b/client/src/app/shared/video/abstract-video-list.ts
index d234c8bfa..d74384293 100644
--- a/client/src/app/shared/video/abstract-video-list.ts
+++ b/client/src/app/shared/video/abstract-video-list.ts
@@ -39,6 +39,8 @@ export abstract class AbstractVideoList implements OnInit, OnDestroy {
39 ownerDisplayType: OwnerDisplayType = 'account' 39 ownerDisplayType: OwnerDisplayType = 'account'
40 firstLoadedPage: number 40 firstLoadedPage: number
41 displayModerationBlock = false 41 displayModerationBlock = false
42 trendingDays: number
43 titleTooltip: string
42 44
43 protected baseVideoWidth = 215 45 protected baseVideoWidth = 215
44 protected baseVideoHeight = 205 46 protected baseVideoHeight = 205
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 () {
diff --git a/server/controllers/api/config.ts b/server/controllers/api/config.ts
index dd06a0597..255026f46 100644
--- a/server/controllers/api/config.ts
+++ b/server/controllers/api/config.ts
@@ -120,6 +120,11 @@ async function getConfig (req: express.Request, res: express.Response) {
120 user: { 120 user: {
121 videoQuota: CONFIG.USER.VIDEO_QUOTA, 121 videoQuota: CONFIG.USER.VIDEO_QUOTA,
122 videoQuotaDaily: CONFIG.USER.VIDEO_QUOTA_DAILY 122 videoQuotaDaily: CONFIG.USER.VIDEO_QUOTA_DAILY
123 },
124 trending: {
125 videos: {
126 intervalDays: CONFIG.TRENDING.VIDEOS.INTERVAL_DAYS
127 }
123 } 128 }
124 } 129 }
125 130
diff --git a/shared/models/server/server-config.model.ts b/shared/models/server/server-config.model.ts
index 7031009d9..f4245ed4d 100644
--- a/shared/models/server/server-config.model.ts
+++ b/shared/models/server/server-config.model.ts
@@ -78,4 +78,10 @@ export interface ServerConfig {
78 videoQuota: number 78 videoQuota: number
79 videoQuotaDaily: number 79 videoQuotaDaily: number
80 } 80 }
81
82 trending: {
83 videos: {
84 intervalDays: number
85 }
86 }
81} 87}