diff options
author | Chocobozzz <me@florianbigard.com> | 2021-08-30 09:37:00 +0200 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2021-08-30 09:37:18 +0200 |
commit | 1b20624552501e8c2968853c6d139af568e1eb95 (patch) | |
tree | c9788cbdef6af1ee4997e4a5640c7929e4c6c338 | |
parent | e874edd9f876df7b4020137b3a9b7feb8078b38f (diff) | |
download | PeerTube-1b20624552501e8c2968853c6d139af568e1eb95.tar.gz PeerTube-1b20624552501e8c2968853c6d139af568e1eb95.tar.zst PeerTube-1b20624552501e8c2968853c6d139af568e1eb95.zip |
Don't display scope fitler on account/channel pages
10 files changed, 32 insertions, 6 deletions
diff --git a/client/src/app/+accounts/account-videos/account-videos.component.html b/client/src/app/+accounts/account-videos/account-videos.component.html index 5b4b0937f..f88d141c2 100644 --- a/client/src/app/+accounts/account-videos/account-videos.component.html +++ b/client/src/app/+accounts/account-videos/account-videos.component.html | |||
@@ -13,6 +13,8 @@ | |||
13 | [displayModerationBlock]="true" | 13 | [displayModerationBlock]="true" |
14 | [displayAsRow]="displayAsRow()" | 14 | [displayAsRow]="displayAsRow()" |
15 | 15 | ||
16 | [hideScopeFilter]="true" | ||
17 | |||
16 | [loadUserVideoPreferences]="true" | 18 | [loadUserVideoPreferences]="true" |
17 | 19 | ||
18 | [disabled]="disabled" | 20 | [disabled]="disabled" |
diff --git a/client/src/app/+video-channels/video-channel-videos/video-channel-videos.component.html b/client/src/app/+video-channels/video-channel-videos/video-channel-videos.component.html index 1b6b72f1e..0a6c5fcb2 100644 --- a/client/src/app/+video-channels/video-channel-videos/video-channel-videos.component.html +++ b/client/src/app/+video-channels/video-channel-videos/video-channel-videos.component.html | |||
@@ -14,6 +14,8 @@ | |||
14 | [displayOptions]="displayOptions" | 14 | [displayOptions]="displayOptions" |
15 | [displayAsRow]="displayAsRow()" | 15 | [displayAsRow]="displayAsRow()" |
16 | 16 | ||
17 | [hideScopeFilter]="true" | ||
18 | |||
17 | [loadUserVideoPreferences]="true" | 19 | [loadUserVideoPreferences]="true" |
18 | 20 | ||
19 | [disabled]="disabled" | 21 | [disabled]="disabled" |
diff --git a/client/src/app/+videos/video-list/video-user-subscriptions.component.html b/client/src/app/+videos/video-list/video-user-subscriptions.component.html index 2675b58bf..5536bb945 100644 --- a/client/src/app/+videos/video-list/video-user-subscriptions.component.html +++ b/client/src/app/+videos/video-list/video-user-subscriptions.component.html | |||
@@ -13,5 +13,7 @@ | |||
13 | [groupByDate]="true" | 13 | [groupByDate]="true" |
14 | 14 | ||
15 | [disabled]="disabled" | 15 | [disabled]="disabled" |
16 | |||
17 | [headerActions]="actions" | ||
16 | > | 18 | > |
17 | </my-videos-list> | 19 | </my-videos-list> |
diff --git a/client/src/app/+videos/video-list/video-user-subscriptions.component.ts b/client/src/app/+videos/video-list/video-user-subscriptions.component.ts index 43cbab9f6..04f02c138 100644 --- a/client/src/app/+videos/video-list/video-user-subscriptions.component.ts +++ b/client/src/app/+videos/video-list/video-user-subscriptions.component.ts | |||
@@ -23,7 +23,7 @@ export class VideoUserSubscriptionsComponent implements DisableForReuseHook { | |||
23 | { | 23 | { |
24 | routerLink: '/my-library/subscriptions', | 24 | routerLink: '/my-library/subscriptions', |
25 | label: $localize`Subscriptions`, | 25 | label: $localize`Subscriptions`, |
26 | iconName: 'cog' | 26 | iconName: 'cog' as 'cog' |
27 | } | 27 | } |
28 | ] | 28 | ] |
29 | 29 | ||
diff --git a/client/src/app/shared/shared-video-miniature/video-filters-header.component.html b/client/src/app/shared/shared-video-miniature/video-filters-header.component.html index 44c21c089..604746897 100644 --- a/client/src/app/shared/shared-video-miniature/video-filters-header.component.html +++ b/client/src/app/shared/shared-video-miniature/video-filters-header.component.html | |||
@@ -77,7 +77,7 @@ | |||
77 | </div> | 77 | </div> |
78 | </div> | 78 | </div> |
79 | 79 | ||
80 | <div class="form-group"> | 80 | <div class="form-group" *ngIf="!hideScope"> |
81 | <label for="scope" i18n>Scope:</label> | 81 | <label for="scope" i18n>Scope:</label> |
82 | 82 | ||
83 | <div class="peertube-radio-container"> | 83 | <div class="peertube-radio-container"> |
diff --git a/client/src/app/shared/shared-video-miniature/video-filters-header.component.ts b/client/src/app/shared/shared-video-miniature/video-filters-header.component.ts index 99f133e54..54a7c5dab 100644 --- a/client/src/app/shared/shared-video-miniature/video-filters-header.component.ts +++ b/client/src/app/shared/shared-video-miniature/video-filters-header.component.ts | |||
@@ -24,6 +24,8 @@ export class VideoFiltersHeaderComponent implements OnInit, OnDestroy { | |||
24 | @Input() defaultSort = '-publishedAt' | 24 | @Input() defaultSort = '-publishedAt' |
25 | @Input() nsfwPolicy: NSFWPolicyType | 25 | @Input() nsfwPolicy: NSFWPolicyType |
26 | 26 | ||
27 | @Input() hideScope = false | ||
28 | |||
27 | @Output() filtersChanged = new EventEmitter() | 29 | @Output() filtersChanged = new EventEmitter() |
28 | 30 | ||
29 | areFiltersCollapsed = true | 31 | areFiltersCollapsed = true |
diff --git a/client/src/app/shared/shared-video-miniature/video-filters.model.ts b/client/src/app/shared/shared-video-miniature/video-filters.model.ts index a3b8129f0..920dc826c 100644 --- a/client/src/app/shared/shared-video-miniature/video-filters.model.ts +++ b/client/src/app/shared/shared-video-miniature/video-filters.model.ts | |||
@@ -38,10 +38,14 @@ export class VideoFilters { | |||
38 | private onChangeCallbacks: Array<() => void> = [] | 38 | private onChangeCallbacks: Array<() => void> = [] |
39 | private oldFormObjectString: string | 39 | private oldFormObjectString: string |
40 | 40 | ||
41 | constructor (defaultSort: string, defaultScope: VideoFilterScope) { | 41 | private readonly hiddenFields: string[] = [] |
42 | |||
43 | constructor (defaultSort: string, defaultScope: VideoFilterScope, hiddenFields: string[] = []) { | ||
42 | this.setDefaultSort(defaultSort) | 44 | this.setDefaultSort(defaultSort) |
43 | this.setDefaultScope(defaultScope) | 45 | this.setDefaultScope(defaultScope) |
44 | 46 | ||
47 | this.hiddenFields = hiddenFields | ||
48 | |||
45 | this.reset() | 49 | this.reset() |
46 | } | 50 | } |
47 | 51 | ||
@@ -160,6 +164,9 @@ export class VideoFilters { | |||
160 | label: $localize`VOD videos` | 164 | label: $localize`VOD videos` |
161 | }) | 165 | }) |
162 | } | 166 | } |
167 | |||
168 | this.activeFilters = this.activeFilters | ||
169 | .filter(a => this.hiddenFields.includes(a.key) === false) | ||
163 | } | 170 | } |
164 | 171 | ||
165 | getActiveFilters () { | 172 | getActiveFilters () { |
diff --git a/client/src/app/shared/shared-video-miniature/videos-list.component.html b/client/src/app/shared/shared-video-miniature/videos-list.component.html index 4ccb4092c..08ed7b94c 100644 --- a/client/src/app/shared/shared-video-miniature/videos-list.component.html +++ b/client/src/app/shared/shared-video-miniature/videos-list.component.html | |||
@@ -33,7 +33,7 @@ | |||
33 | </div> | 33 | </div> |
34 | 34 | ||
35 | <my-video-filters-header | 35 | <my-video-filters-header |
36 | *ngIf="displayFilters" [displayModerationBlock]="displayModerationBlock" | 36 | *ngIf="displayFilters" [displayModerationBlock]="displayModerationBlock" [hideScope]="hideScopeFilter" |
37 | [defaultSort]="defaultSort" [filters]="filters" | 37 | [defaultSort]="defaultSort" [filters]="filters" |
38 | (filtersChanged)="onFiltersChanged(true)" | 38 | (filtersChanged)="onFiltersChanged(true)" |
39 | ></my-video-filters-header> | 39 | ></my-video-filters-header> |
diff --git a/client/src/app/shared/shared-video-miniature/videos-list.component.scss b/client/src/app/shared/shared-video-miniature/videos-list.component.scss index e82ef05ba..209201a5c 100644 --- a/client/src/app/shared/shared-video-miniature/videos-list.component.scss +++ b/client/src/app/shared/shared-video-miniature/videos-list.component.scss | |||
@@ -3,6 +3,9 @@ | |||
3 | @use '_mixins' as *; | 3 | @use '_mixins' as *; |
4 | @use '_miniature' as *; | 4 | @use '_miniature' as *; |
5 | 5 | ||
6 | // Cannot set margin top to videos-header because of the main header fixed position | ||
7 | $margin-top: 30px; | ||
8 | |||
6 | .videos-header { | 9 | .videos-header { |
7 | display: grid; | 10 | display: grid; |
8 | grid-template-columns: auto 1fr auto; | 11 | grid-template-columns: auto 1fr auto; |
@@ -19,7 +22,7 @@ | |||
19 | display: inline-block; | 22 | display: inline-block; |
20 | font-weight: $font-semibold; | 23 | font-weight: $font-semibold; |
21 | 24 | ||
22 | margin-top: 30px; | 25 | margin-top: $margin-top; |
23 | margin-bottom: 0; | 26 | margin-bottom: 0; |
24 | } | 27 | } |
25 | 28 | ||
@@ -35,6 +38,8 @@ | |||
35 | 38 | ||
36 | .action-block { | 39 | .action-block { |
37 | grid-column: 3; | 40 | grid-column: 3; |
41 | grid-row: 1/3; | ||
42 | margin-top: $margin-top; | ||
38 | } | 43 | } |
39 | 44 | ||
40 | my-feed { | 45 | my-feed { |
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 10de97298..3db835257 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 | |||
@@ -59,6 +59,8 @@ export class VideosListComponent implements OnInit, OnChanges, OnDestroy { | |||
59 | 59 | ||
60 | @Input() headerActions: HeaderAction[] = [] | 60 | @Input() headerActions: HeaderAction[] = [] |
61 | 61 | ||
62 | @Input() hideScopeFilter = false | ||
63 | |||
62 | @Input() displayOptions: MiniatureDisplayOptions = { | 64 | @Input() displayOptions: MiniatureDisplayOptions = { |
63 | date: true, | 65 | date: true, |
64 | views: true, | 66 | views: true, |
@@ -109,7 +111,11 @@ export class VideosListComponent implements OnInit, OnChanges, OnDestroy { | |||
109 | } | 111 | } |
110 | 112 | ||
111 | ngOnInit () { | 113 | ngOnInit () { |
112 | this.filters = new VideoFilters(this.defaultSort, this.defaultScope) | 114 | const hiddenFilters = this.hideScopeFilter |
115 | ? [ 'scope' ] | ||
116 | : [] | ||
117 | |||
118 | this.filters = new VideoFilters(this.defaultSort, this.defaultScope, hiddenFilters) | ||
113 | this.filters.load({ ...this.route.snapshot.queryParams, scope: this.defaultScope }) | 119 | this.filters.load({ ...this.route.snapshot.queryParams, scope: this.defaultScope }) |
114 | 120 | ||
115 | this.groupedDateLabels = { | 121 | this.groupedDateLabels = { |