diff options
Diffstat (limited to 'client/src/app')
-rw-r--r-- | client/src/app/shared/shared-video-miniature/videos-list.component.ts | 43 |
1 files changed, 31 insertions, 12 deletions
diff --git a/client/src/app/shared/shared-video-miniature/videos-list.component.ts b/client/src/app/shared/shared-video-miniature/videos-list.component.ts index 9a7ec7efa..38a80b973 100644 --- a/client/src/app/shared/shared-video-miniature/videos-list.component.ts +++ b/client/src/app/shared/shared-video-miniature/videos-list.component.ts | |||
@@ -3,7 +3,16 @@ import { fromEvent, Observable, Subject, Subscription } from 'rxjs' | |||
3 | import { debounceTime, switchMap } from 'rxjs/operators' | 3 | import { debounceTime, switchMap } from 'rxjs/operators' |
4 | import { Component, EventEmitter, Input, OnChanges, OnDestroy, OnInit, Output, SimpleChanges } from '@angular/core' | 4 | import { Component, EventEmitter, Input, OnChanges, OnDestroy, OnInit, Output, SimpleChanges } from '@angular/core' |
5 | import { ActivatedRoute } from '@angular/router' | 5 | import { ActivatedRoute } from '@angular/router' |
6 | import { AuthService, ComponentPaginationLight, Notifier, PeerTubeRouterService, ScreenService, User, UserService } from '@app/core' | 6 | import { |
7 | AuthService, | ||
8 | ComponentPaginationLight, | ||
9 | Notifier, | ||
10 | PeerTubeRouterService, | ||
11 | ScreenService, | ||
12 | ServerService, | ||
13 | User, | ||
14 | UserService | ||
15 | } from '@app/core' | ||
7 | import { GlobalIconName } from '@app/shared/shared-icons' | 16 | import { GlobalIconName } from '@app/shared/shared-icons' |
8 | import { isLastMonth, isLastWeek, isThisMonth, isToday, isYesterday } from '@shared/core-utils' | 17 | import { isLastMonth, isLastWeek, isThisMonth, isToday, isYesterday } from '@shared/core-utils' |
9 | import { ResultList, UserRight, VideoSortField } from '@shared/models' | 18 | import { ResultList, UserRight, VideoSortField } from '@shared/models' |
@@ -61,16 +70,7 @@ export class VideosListComponent implements OnInit, OnChanges, OnDestroy { | |||
61 | 70 | ||
62 | @Input() hideScopeFilter = false | 71 | @Input() hideScopeFilter = false |
63 | 72 | ||
64 | @Input() displayOptions: MiniatureDisplayOptions = { | 73 | @Input() displayOptions: MiniatureDisplayOptions |
65 | date: true, | ||
66 | views: true, | ||
67 | by: true, | ||
68 | avatar: false, | ||
69 | privacyLabel: true, | ||
70 | privacyText: false, | ||
71 | state: false, | ||
72 | blacklistInfo: false | ||
73 | } | ||
74 | 74 | ||
75 | @Input() disabled = false | 75 | @Input() disabled = false |
76 | 76 | ||
@@ -85,6 +85,16 @@ export class VideosListComponent implements OnInit, OnChanges, OnDestroy { | |||
85 | 85 | ||
86 | userMiniature: User | 86 | userMiniature: User |
87 | 87 | ||
88 | private defaultDisplayOptions: MiniatureDisplayOptions = { | ||
89 | date: true, | ||
90 | views: true, | ||
91 | by: true, | ||
92 | avatar: false, | ||
93 | privacyLabel: true, | ||
94 | privacyText: false, | ||
95 | state: false, | ||
96 | blacklistInfo: false | ||
97 | } | ||
88 | private routeSub: Subscription | 98 | private routeSub: Subscription |
89 | private userSub: Subscription | 99 | private userSub: Subscription |
90 | private resizeSub: Subscription | 100 | private resizeSub: Subscription |
@@ -105,7 +115,8 @@ export class VideosListComponent implements OnInit, OnChanges, OnDestroy { | |||
105 | private userService: UserService, | 115 | private userService: UserService, |
106 | private route: ActivatedRoute, | 116 | private route: ActivatedRoute, |
107 | private screenService: ScreenService, | 117 | private screenService: ScreenService, |
108 | private peertubeRouter: PeerTubeRouterService | 118 | private peertubeRouter: PeerTubeRouterService, |
119 | private serverService: ServerService | ||
109 | ) { | 120 | ) { |
110 | 121 | ||
111 | } | 122 | } |
@@ -161,6 +172,14 @@ export class VideosListComponent implements OnInit, OnChanges, OnDestroy { | |||
161 | } | 172 | } |
162 | 173 | ||
163 | ngOnChanges (changes: SimpleChanges) { | 174 | ngOnChanges (changes: SimpleChanges) { |
175 | if (changes['displayOptions'] || !this.displayOptions) { | ||
176 | this.displayOptions = { | ||
177 | ...this.defaultDisplayOptions, | ||
178 | avatar: this.serverService.getHTMLConfig().client.videos.miniature.displayAuthorAvatar, | ||
179 | ...changes['displayOptions'] | ||
180 | } | ||
181 | } | ||
182 | |||
164 | if (!this.filters) return | 183 | if (!this.filters) return |
165 | 184 | ||
166 | let updated = false | 185 | let updated = false |