[displayModerationBlock]="true"
[displayAsRow]="displayAsRow()"
+ [hideScopeFilter]="true"
+
[loadUserVideoPreferences]="true"
[disabled]="disabled"
[displayOptions]="displayOptions"
[displayAsRow]="displayAsRow()"
+ [hideScopeFilter]="true"
+
[loadUserVideoPreferences]="true"
[disabled]="disabled"
[groupByDate]="true"
[disabled]="disabled"
+
+ [headerActions]="actions"
>
</my-videos-list>
{
routerLink: '/my-library/subscriptions',
label: $localize`Subscriptions`,
- iconName: 'cog'
+ iconName: 'cog' as 'cog'
}
]
</div>
</div>
- <div class="form-group">
+ <div class="form-group" *ngIf="!hideScope">
<label for="scope" i18n>Scope:</label>
<div class="peertube-radio-container">
@Input() defaultSort = '-publishedAt'
@Input() nsfwPolicy: NSFWPolicyType
+ @Input() hideScope = false
+
@Output() filtersChanged = new EventEmitter()
areFiltersCollapsed = true
private onChangeCallbacks: Array<() => void> = []
private oldFormObjectString: string
- constructor (defaultSort: string, defaultScope: VideoFilterScope) {
+ private readonly hiddenFields: string[] = []
+
+ constructor (defaultSort: string, defaultScope: VideoFilterScope, hiddenFields: string[] = []) {
this.setDefaultSort(defaultSort)
this.setDefaultScope(defaultScope)
+ this.hiddenFields = hiddenFields
+
this.reset()
}
label: $localize`VOD videos`
})
}
+
+ this.activeFilters = this.activeFilters
+ .filter(a => this.hiddenFields.includes(a.key) === false)
}
getActiveFilters () {
</div>
<my-video-filters-header
- *ngIf="displayFilters" [displayModerationBlock]="displayModerationBlock"
+ *ngIf="displayFilters" [displayModerationBlock]="displayModerationBlock" [hideScope]="hideScopeFilter"
[defaultSort]="defaultSort" [filters]="filters"
(filtersChanged)="onFiltersChanged(true)"
></my-video-filters-header>
@use '_mixins' as *;
@use '_miniature' as *;
+// Cannot set margin top to videos-header because of the main header fixed position
+$margin-top: 30px;
+
.videos-header {
display: grid;
grid-template-columns: auto 1fr auto;
display: inline-block;
font-weight: $font-semibold;
- margin-top: 30px;
+ margin-top: $margin-top;
margin-bottom: 0;
}
.action-block {
grid-column: 3;
+ grid-row: 1/3;
+ margin-top: $margin-top;
}
my-feed {
@Input() headerActions: HeaderAction[] = []
+ @Input() hideScopeFilter = false
+
@Input() displayOptions: MiniatureDisplayOptions = {
date: true,
views: true,
}
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.groupedDateLabels = {