diff options
author | Chocobozzz <me@florianbigard.com> | 2021-05-03 14:33:34 +0200 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2021-05-03 16:42:15 +0200 |
commit | 2e46eb97154da909b82d5efe1d336a3412594ff0 (patch) | |
tree | a86b6ca6439f62c8498887c4e1c3ece9a302d116 /client/src/app/+admin/follows/following-list | |
parent | 514e8168fbad08e70ce12dab587f720b4e91b19e (diff) | |
download | PeerTube-2e46eb97154da909b82d5efe1d336a3412594ff0.tar.gz PeerTube-2e46eb97154da909b82d5efe1d336a3412594ff0.tar.zst PeerTube-2e46eb97154da909b82d5efe1d336a3412594ff0.zip |
Refactor search filters
Diffstat (limited to 'client/src/app/+admin/follows/following-list')
3 files changed, 7 insertions, 19 deletions
diff --git a/client/src/app/+admin/follows/following-list/following-list.component.html b/client/src/app/+admin/follows/following-list/following-list.component.html index f4e6a60fe..e7c0c9088 100644 --- a/client/src/app/+admin/follows/following-list/following-list.component.html +++ b/client/src/app/+admin/follows/following-list/following-list.component.html | |||
@@ -4,8 +4,9 @@ | |||
4 | </h1> | 4 | </h1> |
5 | 5 | ||
6 | <p-table | 6 | <p-table |
7 | [value]="following" [lazy]="true" [paginator]="totalRecords > 0" [totalRecords]="totalRecords" [rows]="rowsPerPage" [rowsPerPageOptions]="rowsPerPageOptions" | 7 | [value]="following" [paginator]="totalRecords > 0" [totalRecords]="totalRecords" [rows]="rowsPerPage" [rowsPerPageOptions]="rowsPerPageOptions" |
8 | [sortField]="sort.field" [sortOrder]="sort.order" (onLazyLoad)="loadLazy($event)" (onPage)="onPage($event)" | 8 | [sortField]="sort.field" [sortOrder]="sort.order" (onLazyLoad)="loadLazy($event)" (onPage)="onPage($event)" |
9 | [lazy]="true" (onLazyLoad)="loadLazy($event)" [lazyLoadOnInit]="false" | ||
9 | [showCurrentPageReport]="true" i18n-currentPageReportTemplate | 10 | [showCurrentPageReport]="true" i18n-currentPageReportTemplate |
10 | currentPageReportTemplate="Showing {{'{first}'}} to {{'{last}'}} of {{'{totalRecords}'}} hosts" | 11 | currentPageReportTemplate="Showing {{'{first}'}} to {{'{last}'}} of {{'{totalRecords}'}} hosts" |
11 | > | 12 | > |
@@ -18,13 +19,8 @@ | |||
18 | </a> | 19 | </a> |
19 | </div> | 20 | </div> |
20 | 21 | ||
21 | <div class="ml-auto has-feedback has-clear"> | 22 | <div class="ml-auto"> |
22 | <input | 23 | <my-advanced-input-filter (search)="onSearch($event)"></my-advanced-input-filter> |
23 | type="text" name="table-filter" id="table-filter" i18n-placeholder placeholder="Filter..." | ||
24 | (keyup)="onSearch($event)" | ||
25 | > | ||
26 | <a class="glyphicon glyphicon-remove-sign form-control-feedback form-control-clear" (click)="resetSearch()"></a> | ||
27 | <span class="sr-only" i18n>Clear filters</span> | ||
28 | </div> | 24 | </div> |
29 | </div> | 25 | </div> |
30 | </ng-template> | 26 | </ng-template> |
diff --git a/client/src/app/+admin/follows/following-list/following-list.component.scss b/client/src/app/+admin/follows/following-list/following-list.component.scss index 797882d9a..9474b0a23 100644 --- a/client/src/app/+admin/follows/following-list/following-list.component.scss +++ b/client/src/app/+admin/follows/following-list/following-list.component.scss | |||
@@ -16,14 +16,6 @@ a { | |||
16 | } | 16 | } |
17 | } | 17 | } |
18 | 18 | ||
19 | .caption { | ||
20 | justify-content: flex-end; | ||
21 | |||
22 | input { | ||
23 | @include peertube-input-text(250px); | ||
24 | } | ||
25 | } | ||
26 | |||
27 | .follow-button { | 19 | .follow-button { |
28 | @include create-button; | 20 | @include create-button; |
29 | } | 21 | } |
diff --git a/client/src/app/+admin/follows/following-list/following-list.component.ts b/client/src/app/+admin/follows/following-list/following-list.component.ts index f34490cc8..b63fe08c0 100644 --- a/client/src/app/+admin/follows/following-list/following-list.component.ts +++ b/client/src/app/+admin/follows/following-list/following-list.component.ts | |||
@@ -45,7 +45,7 @@ export class FollowingListComponent extends RestTable implements OnInit { | |||
45 | this.followService.follow(hosts).subscribe( | 45 | this.followService.follow(hosts).subscribe( |
46 | () => { | 46 | () => { |
47 | this.notifier.success($localize`Follow request(s) sent!`) | 47 | this.notifier.success($localize`Follow request(s) sent!`) |
48 | this.loadData() | 48 | this.reloadData() |
49 | }, | 49 | }, |
50 | 50 | ||
51 | err => this.notifier.error(err.message) | 51 | err => this.notifier.error(err.message) |
@@ -62,14 +62,14 @@ export class FollowingListComponent extends RestTable implements OnInit { | |||
62 | this.followService.unfollow(follow).subscribe( | 62 | this.followService.unfollow(follow).subscribe( |
63 | () => { | 63 | () => { |
64 | this.notifier.success($localize`You are not following ${follow.following.host} anymore.`) | 64 | this.notifier.success($localize`You are not following ${follow.following.host} anymore.`) |
65 | this.loadData() | 65 | this.reloadData() |
66 | }, | 66 | }, |
67 | 67 | ||
68 | err => this.notifier.error(err.message) | 68 | err => this.notifier.error(err.message) |
69 | ) | 69 | ) |
70 | } | 70 | } |
71 | 71 | ||
72 | protected loadData () { | 72 | protected reloadData () { |
73 | this.followService.getFollowing({ pagination: this.pagination, sort: this.sort, search: this.search }) | 73 | this.followService.getFollowing({ pagination: this.pagination, sort: this.sort, search: this.search }) |
74 | .subscribe( | 74 | .subscribe( |
75 | resultList => { | 75 | resultList => { |