diff options
Diffstat (limited to 'client/src/app/shared/shared-custom-markup/peertube-custom-tags/videos-list-markup.component.ts')
-rw-r--r-- | client/src/app/shared/shared-custom-markup/peertube-custom-tags/videos-list-markup.component.ts | 17 |
1 files changed, 13 insertions, 4 deletions
diff --git a/client/src/app/shared/shared-custom-markup/peertube-custom-tags/videos-list-markup.component.ts b/client/src/app/shared/shared-custom-markup/peertube-custom-tags/videos-list-markup.component.ts index c3710484e..fe084afd9 100644 --- a/client/src/app/shared/shared-custom-markup/peertube-custom-tags/videos-list-markup.component.ts +++ b/client/src/app/shared/shared-custom-markup/peertube-custom-tags/videos-list-markup.component.ts | |||
@@ -1,6 +1,6 @@ | |||
1 | import { Component, Input, OnInit } from '@angular/core' | 1 | import { Component, Input, OnInit } from '@angular/core' |
2 | import { AuthService } from '@app/core' | 2 | import { AuthService } from '@app/core' |
3 | import { VideoSortField } from '@shared/models' | 3 | import { VideoFilter, VideoSortField } from '@shared/models' |
4 | import { Video, VideoService } from '../../shared-main' | 4 | import { Video, VideoService } from '../../shared-main' |
5 | import { MiniatureDisplayOptions } from '../../shared-video-miniature' | 5 | import { MiniatureDisplayOptions } from '../../shared-video-miniature' |
6 | 6 | ||
@@ -14,15 +14,17 @@ import { MiniatureDisplayOptions } from '../../shared-video-miniature' | |||
14 | styleUrls: [ 'videos-list-markup.component.scss' ] | 14 | styleUrls: [ 'videos-list-markup.component.scss' ] |
15 | }) | 15 | }) |
16 | export class VideosListMarkupComponent implements OnInit { | 16 | export class VideosListMarkupComponent implements OnInit { |
17 | @Input() sort = '-publishedAt' | 17 | @Input() sort: string |
18 | @Input() categoryOneOf: number[] | 18 | @Input() categoryOneOf: number[] |
19 | @Input() languageOneOf: string[] | 19 | @Input() languageOneOf: string[] |
20 | @Input() count = 10 | 20 | @Input() count: number |
21 | @Input() onlyDisplayTitle: boolean | ||
22 | @Input() filter: VideoFilter | ||
21 | 23 | ||
22 | videos: Video[] | 24 | videos: Video[] |
23 | 25 | ||
24 | displayOptions: MiniatureDisplayOptions = { | 26 | displayOptions: MiniatureDisplayOptions = { |
25 | date: true, | 27 | date: false, |
26 | views: true, | 28 | views: true, |
27 | by: true, | 29 | by: true, |
28 | avatar: false, | 30 | avatar: false, |
@@ -42,6 +44,12 @@ export class VideosListMarkupComponent implements OnInit { | |||
42 | } | 44 | } |
43 | 45 | ||
44 | ngOnInit () { | 46 | ngOnInit () { |
47 | if (this.onlyDisplayTitle) { | ||
48 | for (const key of Object.keys(this.displayOptions)) { | ||
49 | this.displayOptions[key] = false | ||
50 | } | ||
51 | } | ||
52 | |||
45 | const options = { | 53 | const options = { |
46 | videoPagination: { | 54 | videoPagination: { |
47 | currentPage: 1, | 55 | currentPage: 1, |
@@ -49,6 +57,7 @@ export class VideosListMarkupComponent implements OnInit { | |||
49 | }, | 57 | }, |
50 | categoryOneOf: this.categoryOneOf, | 58 | categoryOneOf: this.categoryOneOf, |
51 | languageOneOf: this.languageOneOf, | 59 | languageOneOf: this.languageOneOf, |
60 | filter: this.filter, | ||
52 | sort: this.sort as VideoSortField | 61 | sort: this.sort as VideoSortField |
53 | } | 62 | } |
54 | 63 | ||