aboutsummaryrefslogtreecommitdiffhomepage
path: root/client/src/app/+admin/users
diff options
context:
space:
mode:
Diffstat (limited to 'client/src/app/+admin/users')
-rw-r--r--client/src/app/+admin/users/user-list/user-list.component.html19
-rw-r--r--client/src/app/+admin/users/user-list/user-list.component.scss4
-rw-r--r--client/src/app/+admin/users/user-list/user-list.component.ts5
3 files changed, 24 insertions, 4 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 15bdb6398..e9ff61283 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
@@ -51,19 +51,30 @@
51 <ng-template pTemplate="body" let-expanded="expanded" let-user> 51 <ng-template pTemplate="body" let-expanded="expanded" let-user>
52 52
53 <tr [pSelectableRow]="user" [ngClass]="{ banned: user.blocked }"> 53 <tr [pSelectableRow]="user" [ngClass]="{ banned: user.blocked }">
54 <td class="expand-cell"> 54 <td>
55 <p-tableCheckbox [value]="user"></p-tableCheckbox> 55 <p-tableCheckbox [value]="user"></p-tableCheckbox>
56 </td> 56 </td>
57 57
58 <td> 58 <td class="expand-cell">
59 <span *ngIf="user.blockedReason" class="expander" [pRowToggler]="user"> 59 <span *ngIf="user.blockedReason" class="expander" [pRowToggler]="user">
60 <i [ngClass]="expanded ? 'glyphicon glyphicon-menu-down' : 'glyphicon glyphicon-menu-right'"></i> 60 <i [ngClass]="expanded ? 'glyphicon glyphicon-menu-down' : 'glyphicon glyphicon-menu-right'"></i>
61 </span> 61 </span>
62 </td> 62 </td>
63 63
64 <td> 64 <td>
65 <a i18n-title title="Go to the account page" target="_blank" rel="noopener noreferrer" [routerLink]="[ '/accounts/' + user.username ]"> 65 <a i18n-title title="Open account in a new tab" target="_blank" rel="noopener noreferrer" [routerLink]="[ '/accounts/' + user.username ]">
66 {{ user.username }} 66 <div class="chip two-lines">
67 <img
68 class="avatar"
69 [src]="user?.account?.avatar?.path"
70 (error)="switchToDefaultAvatar($event)"
71 alt="Avatar"
72 >
73 <div>
74 {{ user.account.displayName }}
75 <span class="text-muted">{{ user.username }}</span>
76 </div>
77 </div>
67 <span i18n *ngIf="user.blocked" class="banned-info">(banned)</span> 78 <span i18n *ngIf="user.blocked" class="banned-info">(banned)</span>
68 </a> 79 </a>
69 </td> 80 </td>
diff --git a/client/src/app/+admin/users/user-list/user-list.component.scss b/client/src/app/+admin/users/user-list/user-list.component.scss
index 40f08027f..99b22aaea 100644
--- a/client/src/app/+admin/users/user-list/user-list.component.scss
+++ b/client/src/app/+admin/users/user-list/user-list.component.scss
@@ -29,3 +29,7 @@ p-tableCheckbox {
29 position: relative; 29 position: relative;
30 top: -2.5px; 30 top: -2.5px;
31} 31}
32
33.chip {
34 @include chip;
35}
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 0de123e93..667a0e1fd 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
@@ -7,6 +7,7 @@ import { I18n } from '@ngx-translate/i18n-polyfill'
7import { ServerConfig, User } from '../../../../../../shared' 7import { ServerConfig, User } from '../../../../../../shared'
8import { UserBanModalComponent } from '@app/shared/moderation' 8import { UserBanModalComponent } from '@app/shared/moderation'
9import { DropdownAction } from '@app/shared/buttons/action-dropdown.component' 9import { DropdownAction } from '@app/shared/buttons/action-dropdown.component'
10import { Actor } from '@app/shared/actor/actor.model'
10 11
11@Component({ 12@Component({
12 selector: 'my-user-list', 13 selector: 'my-user-list',
@@ -105,6 +106,10 @@ export class UserListComponent extends RestTable implements OnInit {
105 this.loadData() 106 this.loadData()
106 } 107 }
107 108
109 switchToDefaultAvatar ($event: Event) {
110 ($event.target as HTMLImageElement).src = Actor.GET_DEFAULT_AVATAR_URL()
111 }
112
108 async unbanUsers (users: User[]) { 113 async unbanUsers (users: User[]) {
109 const message = this.i18n('Do you really want to unban {{num}} users?', { num: users.length }) 114 const message = this.i18n('Do you really want to unban {{num}} users?', { num: users.length })
110 115