From: Chocobozzz Date: Tue, 21 May 2019 08:54:38 +0000 (+0200) Subject: Fix pagination in my videos page X-Git-Tag: v1.3.0-rc.2~5 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=8c6781e95641fcb3d4a747ba4a37ef8efb1ad1bc;p=oweals%2Fpeertube.git Fix pagination in my videos page --- diff --git a/client/src/app/+admin/moderation/video-auto-blacklist-list/video-auto-blacklist-list.component.html b/client/src/app/+admin/moderation/video-auto-blacklist-list/video-auto-blacklist-list.component.html index 62dde60bb..e2193b630 100644 --- a/client/src/app/+admin/moderation/video-auto-blacklist-list/video-auto-blacklist-list.component.html +++ b/client/src/app/+admin/moderation/video-auto-blacklist-list/video-auto-blacklist-list.component.html @@ -1,4 +1,5 @@ + {{ label }} diff --git a/client/src/app/shared/buttons/delete-button.component.ts b/client/src/app/shared/buttons/delete-button.component.ts index 8e285d982..39e31900f 100644 --- a/client/src/app/shared/buttons/delete-button.component.ts +++ b/client/src/app/shared/buttons/delete-button.component.ts @@ -1,4 +1,4 @@ -import { Component, Input } from '@angular/core' +import { Component, Input, OnInit } from '@angular/core' import { I18n } from '@ngx-translate/i18n-polyfill' @Component({ @@ -7,12 +7,14 @@ import { I18n } from '@ngx-translate/i18n-polyfill' templateUrl: './delete-button.component.html' }) -export class DeleteButtonComponent { +export class DeleteButtonComponent implements OnInit { @Input() label: string + title: string + constructor (private i18n: I18n) { } - getTitle () { - return this.label || this.i18n('Delete') + ngOnInit () { + this.title = this.label || this.i18n('Delete') } } diff --git a/client/src/app/shared/video/videos-selection.component.html b/client/src/app/shared/video/videos-selection.component.html index 53809b6fd..120c168cd 100644 --- a/client/src/app/shared/video/videos-selection.component.html +++ b/client/src/app/shared/video/videos-selection.component.html @@ -1,7 +1,8 @@
No results.
-
+
+
diff --git a/client/src/app/shared/video/videos-selection.component.ts b/client/src/app/shared/video/videos-selection.component.ts index b6bedafd8..955ebca9f 100644 --- a/client/src/app/shared/video/videos-selection.component.ts +++ b/client/src/app/shared/video/videos-selection.component.ts @@ -19,6 +19,7 @@ import { Observable } from 'rxjs' import { Video } from '@app/shared/video/video.model' import { PeerTubeTemplateDirective } from '@app/shared/angular/peertube-template.directive' import { VideoSortField } from '@app/shared/video/sort-field.type' +import { ComponentPagination } from '@app/shared/rest/component-pagination.model' export type SelectionType = { [ id: number ]: boolean } @@ -28,6 +29,7 @@ export type SelectionType = { [ id: number ]: boolean } styleUrls: [ './videos-selection.component.scss' ] }) export class VideosSelectionComponent extends AbstractVideoList implements OnInit, OnDestroy, AfterContentInit { + @Input() pagination: ComponentPagination @Input() titlePage: string @Input() miniatureDisplayOptions: MiniatureDisplayOptions @Input() getVideosObservableFunction: (page: number, sort?: VideoSortField) => Observable<{ videos: Video[], totalVideos: number }> @@ -52,18 +54,6 @@ export class VideosSelectionComponent extends AbstractVideoList implements OnIni super() } - ngAfterContentInit () { - { - const t = this.templates.find(t => t.name === 'rowButtons') - if (t) this.rowButtonsTemplate = t.template - } - - { - const t = this.templates.find(t => t.name === 'globalButtons') - if (t) this.globalButtonsTemplate = t.template - } - } - @Input() get selection () { return this._selection } @@ -86,6 +76,18 @@ export class VideosSelectionComponent extends AbstractVideoList implements OnIni super.ngOnInit() } + ngAfterContentInit () { + { + const t = this.templates.find(t => t.name === 'rowButtons') + if (t) this.rowButtonsTemplate = t.template + } + + { + const t = this.templates.find(t => t.name === 'globalButtons') + if (t) this.globalButtonsTemplate = t.template + } + } + ngOnDestroy () { super.ngOnDestroy() }