Don't display scope fitler on account/channel pages
This commit is contained in:
parent
e874edd9f8
commit
1b20624552
|
@ -13,6 +13,8 @@
|
||||||
[displayModerationBlock]="true"
|
[displayModerationBlock]="true"
|
||||||
[displayAsRow]="displayAsRow()"
|
[displayAsRow]="displayAsRow()"
|
||||||
|
|
||||||
|
[hideScopeFilter]="true"
|
||||||
|
|
||||||
[loadUserVideoPreferences]="true"
|
[loadUserVideoPreferences]="true"
|
||||||
|
|
||||||
[disabled]="disabled"
|
[disabled]="disabled"
|
||||||
|
|
|
@ -14,6 +14,8 @@
|
||||||
[displayOptions]="displayOptions"
|
[displayOptions]="displayOptions"
|
||||||
[displayAsRow]="displayAsRow()"
|
[displayAsRow]="displayAsRow()"
|
||||||
|
|
||||||
|
[hideScopeFilter]="true"
|
||||||
|
|
||||||
[loadUserVideoPreferences]="true"
|
[loadUserVideoPreferences]="true"
|
||||||
|
|
||||||
[disabled]="disabled"
|
[disabled]="disabled"
|
||||||
|
|
|
@ -13,5 +13,7 @@
|
||||||
[groupByDate]="true"
|
[groupByDate]="true"
|
||||||
|
|
||||||
[disabled]="disabled"
|
[disabled]="disabled"
|
||||||
|
|
||||||
|
[headerActions]="actions"
|
||||||
>
|
>
|
||||||
</my-videos-list>
|
</my-videos-list>
|
||||||
|
|
|
@ -23,7 +23,7 @@ export class VideoUserSubscriptionsComponent implements DisableForReuseHook {
|
||||||
{
|
{
|
||||||
routerLink: '/my-library/subscriptions',
|
routerLink: '/my-library/subscriptions',
|
||||||
label: $localize`Subscriptions`,
|
label: $localize`Subscriptions`,
|
||||||
iconName: 'cog'
|
iconName: 'cog' as 'cog'
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
|
|
||||||
|
|
|
@ -77,7 +77,7 @@
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="form-group">
|
<div class="form-group" *ngIf="!hideScope">
|
||||||
<label for="scope" i18n>Scope:</label>
|
<label for="scope" i18n>Scope:</label>
|
||||||
|
|
||||||
<div class="peertube-radio-container">
|
<div class="peertube-radio-container">
|
||||||
|
|
|
@ -24,6 +24,8 @@ export class VideoFiltersHeaderComponent implements OnInit, OnDestroy {
|
||||||
@Input() defaultSort = '-publishedAt'
|
@Input() defaultSort = '-publishedAt'
|
||||||
@Input() nsfwPolicy: NSFWPolicyType
|
@Input() nsfwPolicy: NSFWPolicyType
|
||||||
|
|
||||||
|
@Input() hideScope = false
|
||||||
|
|
||||||
@Output() filtersChanged = new EventEmitter()
|
@Output() filtersChanged = new EventEmitter()
|
||||||
|
|
||||||
areFiltersCollapsed = true
|
areFiltersCollapsed = true
|
||||||
|
|
|
@ -38,10 +38,14 @@ export class VideoFilters {
|
||||||
private onChangeCallbacks: Array<() => void> = []
|
private onChangeCallbacks: Array<() => void> = []
|
||||||
private oldFormObjectString: string
|
private oldFormObjectString: string
|
||||||
|
|
||||||
constructor (defaultSort: string, defaultScope: VideoFilterScope) {
|
private readonly hiddenFields: string[] = []
|
||||||
|
|
||||||
|
constructor (defaultSort: string, defaultScope: VideoFilterScope, hiddenFields: string[] = []) {
|
||||||
this.setDefaultSort(defaultSort)
|
this.setDefaultSort(defaultSort)
|
||||||
this.setDefaultScope(defaultScope)
|
this.setDefaultScope(defaultScope)
|
||||||
|
|
||||||
|
this.hiddenFields = hiddenFields
|
||||||
|
|
||||||
this.reset()
|
this.reset()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -160,6 +164,9 @@ export class VideoFilters {
|
||||||
label: $localize`VOD videos`
|
label: $localize`VOD videos`
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
this.activeFilters = this.activeFilters
|
||||||
|
.filter(a => this.hiddenFields.includes(a.key) === false)
|
||||||
}
|
}
|
||||||
|
|
||||||
getActiveFilters () {
|
getActiveFilters () {
|
||||||
|
|
|
@ -33,7 +33,7 @@
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<my-video-filters-header
|
<my-video-filters-header
|
||||||
*ngIf="displayFilters" [displayModerationBlock]="displayModerationBlock"
|
*ngIf="displayFilters" [displayModerationBlock]="displayModerationBlock" [hideScope]="hideScopeFilter"
|
||||||
[defaultSort]="defaultSort" [filters]="filters"
|
[defaultSort]="defaultSort" [filters]="filters"
|
||||||
(filtersChanged)="onFiltersChanged(true)"
|
(filtersChanged)="onFiltersChanged(true)"
|
||||||
></my-video-filters-header>
|
></my-video-filters-header>
|
||||||
|
|
|
@ -3,6 +3,9 @@
|
||||||
@use '_mixins' as *;
|
@use '_mixins' as *;
|
||||||
@use '_miniature' as *;
|
@use '_miniature' as *;
|
||||||
|
|
||||||
|
// Cannot set margin top to videos-header because of the main header fixed position
|
||||||
|
$margin-top: 30px;
|
||||||
|
|
||||||
.videos-header {
|
.videos-header {
|
||||||
display: grid;
|
display: grid;
|
||||||
grid-template-columns: auto 1fr auto;
|
grid-template-columns: auto 1fr auto;
|
||||||
|
@ -19,7 +22,7 @@
|
||||||
display: inline-block;
|
display: inline-block;
|
||||||
font-weight: $font-semibold;
|
font-weight: $font-semibold;
|
||||||
|
|
||||||
margin-top: 30px;
|
margin-top: $margin-top;
|
||||||
margin-bottom: 0;
|
margin-bottom: 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -35,6 +38,8 @@
|
||||||
|
|
||||||
.action-block {
|
.action-block {
|
||||||
grid-column: 3;
|
grid-column: 3;
|
||||||
|
grid-row: 1/3;
|
||||||
|
margin-top: $margin-top;
|
||||||
}
|
}
|
||||||
|
|
||||||
my-feed {
|
my-feed {
|
||||||
|
|
|
@ -59,6 +59,8 @@ export class VideosListComponent implements OnInit, OnChanges, OnDestroy {
|
||||||
|
|
||||||
@Input() headerActions: HeaderAction[] = []
|
@Input() headerActions: HeaderAction[] = []
|
||||||
|
|
||||||
|
@Input() hideScopeFilter = false
|
||||||
|
|
||||||
@Input() displayOptions: MiniatureDisplayOptions = {
|
@Input() displayOptions: MiniatureDisplayOptions = {
|
||||||
date: true,
|
date: true,
|
||||||
views: true,
|
views: true,
|
||||||
|
@ -109,7 +111,11 @@ export class VideosListComponent implements OnInit, OnChanges, OnDestroy {
|
||||||
}
|
}
|
||||||
|
|
||||||
ngOnInit () {
|
ngOnInit () {
|
||||||
this.filters = new VideoFilters(this.defaultSort, this.defaultScope)
|
const hiddenFilters = this.hideScopeFilter
|
||||||
|
? [ 'scope' ]
|
||||||
|
: []
|
||||||
|
|
||||||
|
this.filters = new VideoFilters(this.defaultSort, this.defaultScope, hiddenFilters)
|
||||||
this.filters.load({ ...this.route.snapshot.queryParams, scope: this.defaultScope })
|
this.filters.load({ ...this.route.snapshot.queryParams, scope: this.defaultScope })
|
||||||
|
|
||||||
this.groupedDateLabels = {
|
this.groupedDateLabels = {
|
||||||
|
|
Loading…
Reference in New Issue