aboutsummaryrefslogtreecommitdiffhomepage
path: root/client/src/app/+admin
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2018-08-08 17:36:10 +0200
committerChocobozzz <me@florianbigard.com>2018-08-08 17:44:22 +0200
commiteacb25c4366bcc8fba20f98f93f004fabc6d5578 (patch)
treed006c6ef3358ec8c3e3deda643dc9b70068f2515 /client/src/app/+admin
parenta6ce68673ace5b94a81eda3ba198f0a4170eb05e (diff)
downloadPeerTube-eacb25c4366bcc8fba20f98f93f004fabc6d5578.tar.gz
PeerTube-eacb25c4366bcc8fba20f98f93f004fabc6d5578.tar.zst
PeerTube-eacb25c4366bcc8fba20f98f93f004fabc6d5578.zip
Add reason when banning a user
Diffstat (limited to 'client/src/app/+admin')
-rw-r--r--client/src/app/+admin/users/user-list/user-list.component.html5
-rw-r--r--client/src/app/+admin/users/user-list/user-list.component.ts13
2 files changed, 16 insertions, 2 deletions
diff --git a/client/src/app/+admin/users/user-list/user-list.component.html b/client/src/app/+admin/users/user-list/user-list.component.html
index 166fafef0..ef5a6c648 100644
--- a/client/src/app/+admin/users/user-list/user-list.component.html
+++ b/client/src/app/+admin/users/user-list/user-list.component.html
@@ -30,8 +30,9 @@
30 <td>{{ user.roleLabel }}</td> 30 <td>{{ user.roleLabel }}</td>
31 <td>{{ user.createdAt }}</td> 31 <td>{{ user.createdAt }}</td>
32 <td class="action-cell"> 32 <td class="action-cell">
33 <my-edit-button [routerLink]="getRouterUserEditLink(user)"></my-edit-button> 33 <my-action-dropdown i18n-label label="Actions" [actions]="userActions" [entry]="user"></my-action-dropdown>
34 <my-delete-button (click)="removeUser(user)"></my-delete-button> 34 <!--<my-edit-button [routerLink]="getRouterUserEditLink(user)"></my-edit-button>-->
35 <!--<my-delete-button (click)="removeUser(user)"></my-delete-button>-->
35 </td> 36 </td>
36 </tr> 37 </tr>
37 </ng-template> 38 </ng-template>
diff --git a/client/src/app/+admin/users/user-list/user-list.component.ts b/client/src/app/+admin/users/user-list/user-list.component.ts
index ab25608c1..3c83859e0 100644
--- a/client/src/app/+admin/users/user-list/user-list.component.ts
+++ b/client/src/app/+admin/users/user-list/user-list.component.ts
@@ -5,6 +5,7 @@ import { ConfirmService } from '../../../core'
5import { RestPagination, RestTable, User } from '../../../shared' 5import { RestPagination, RestTable, User } from '../../../shared'
6import { UserService } from '../shared' 6import { UserService } from '../shared'
7import { I18n } from '@ngx-translate/i18n-polyfill' 7import { I18n } from '@ngx-translate/i18n-polyfill'
8import { DropdownAction } from '@app/shared/buttons/action-dropdown.component'
8 9
9@Component({ 10@Component({
10 selector: 'my-user-list', 11 selector: 'my-user-list',
@@ -17,6 +18,7 @@ export class UserListComponent extends RestTable implements OnInit {
17 rowsPerPage = 10 18 rowsPerPage = 10
18 sort: SortMeta = { field: 'createdAt', order: 1 } 19 sort: SortMeta = { field: 'createdAt', order: 1 }
19 pagination: RestPagination = { count: this.rowsPerPage, start: 0 } 20 pagination: RestPagination = { count: this.rowsPerPage, start: 0 }
21 userActions: DropdownAction<User>[] = []
20 22
21 constructor ( 23 constructor (
22 private notificationsService: NotificationsService, 24 private notificationsService: NotificationsService,
@@ -25,6 +27,17 @@ export class UserListComponent extends RestTable implements OnInit {
25 private i18n: I18n 27 private i18n: I18n
26 ) { 28 ) {
27 super() 29 super()
30
31 this.userActions = [
32 {
33 type: 'edit',
34 linkBuilder: this.getRouterUserEditLink
35 },
36 {
37 type: 'delete',
38 handler: user => this.removeUser(user)
39 }
40 ]
28 } 41 }
29 42
30 ngOnInit () { 43 ngOnInit () {