aboutsummaryrefslogtreecommitdiffhomepage
path: root/client/src/app/+admin
diff options
context:
space:
mode:
authorkontrollanten <6680299+kontrollanten@users.noreply.github.com>2021-04-15 10:01:27 +0200
committerGitHub <noreply@github.com>2021-04-15 10:01:27 +0200
commitfbdcd4ec9f549b730f8311512bcc0c0b7bc2db0a (patch)
treee4c4d3a9abdc52afb2443234a57d74f0819b7d08 /client/src/app/+admin
parent266947e5efc7ff30b0020beb5a74e4d4fc696fa5 (diff)
downloadPeerTube-fbdcd4ec9f549b730f8311512bcc0c0b7bc2db0a.tar.gz
PeerTube-fbdcd4ec9f549b730f8311512bcc0c0b7bc2db0a.tar.zst
PeerTube-fbdcd4ec9f549b730f8311512bcc0c0b7bc2db0a.zip
Add AccountAvatarComponent (#3965)
* refactor(client): create account-avatar component * continue implement account-avatar * fix review comments
Diffstat (limited to 'client/src/app/+admin')
-rw-r--r--client/src/app/+admin/admin.module.ts2
-rw-r--r--client/src/app/+admin/moderation/instance-blocklist/instance-account-blocklist.component.html7
-rw-r--r--client/src/app/+admin/moderation/video-comment-list/video-comment-list.component.html8
-rw-r--r--client/src/app/+admin/users/user-list/user-list.component.html9
-rw-r--r--client/src/app/+admin/users/user-list/user-list.component.ts4
5 files changed, 7 insertions, 23 deletions
diff --git a/client/src/app/+admin/admin.module.ts b/client/src/app/+admin/admin.module.ts
index bac65c88e..8d1c3eadb 100644
--- a/client/src/app/+admin/admin.module.ts
+++ b/client/src/app/+admin/admin.module.ts
@@ -39,6 +39,7 @@ import { JobService, LogsComponent, LogsService, SystemComponent } from './syste
39import { DebugComponent, DebugService } from './system/debug' 39import { DebugComponent, DebugService } from './system/debug'
40import { JobsComponent } from './system/jobs/jobs.component' 40import { JobsComponent } from './system/jobs/jobs.component'
41import { UserCreateComponent, UserListComponent, UserPasswordComponent, UsersComponent, UserUpdateComponent } from './users' 41import { UserCreateComponent, UserListComponent, UserPasswordComponent, UsersComponent, UserUpdateComponent } from './users'
42import { SharedAccountAvatarModule } from '../shared/shared-account-avatar/shared-account-avatar.module'
42 43
43@NgModule({ 44@NgModule({
44 imports: [ 45 imports: [
@@ -50,6 +51,7 @@ import { UserCreateComponent, UserListComponent, UserPasswordComponent, UsersCom
50 SharedGlobalIconModule, 51 SharedGlobalIconModule,
51 SharedAbuseListModule, 52 SharedAbuseListModule,
52 SharedVideoCommentModule, 53 SharedVideoCommentModule,
54 SharedAccountAvatarModule,
53 SharedActorImageModule, 55 SharedActorImageModule,
54 56
55 TableModule, 57 TableModule,
diff --git a/client/src/app/+admin/moderation/instance-blocklist/instance-account-blocklist.component.html b/client/src/app/+admin/moderation/instance-blocklist/instance-account-blocklist.component.html
index 128f4962d..f5cf93adb 100644
--- a/client/src/app/+admin/moderation/instance-blocklist/instance-account-blocklist.component.html
+++ b/client/src/app/+admin/moderation/instance-blocklist/instance-account-blocklist.component.html
@@ -34,12 +34,7 @@
34 <td> 34 <td>
35 <a [href]="accountBlock.blockedAccount.url" i18n-title title="Open account in a new tab" target="_blank" rel="noopener noreferrer"> 35 <a [href]="accountBlock.blockedAccount.url" i18n-title title="Open account in a new tab" target="_blank" rel="noopener noreferrer">
36 <div class="chip two-lines"> 36 <div class="chip two-lines">
37 <img 37 <my-account-avatar [account]="accountBlock.blockedAccount"></my-account-avatar>
38 class="avatar"
39 [src]="accountBlock.blockedAccount.avatar?.path"
40 (error)="switchToDefaultAvatar($event)"
41 alt="Avatar"
42 >
43 <div> 38 <div>
44 {{ accountBlock.blockedAccount.displayName }} 39 {{ accountBlock.blockedAccount.displayName }}
45 <span class="text-muted">{{ accountBlock.blockedAccount.nameWithHost }}</span> 40 <span class="text-muted">{{ accountBlock.blockedAccount.nameWithHost }}</span>
diff --git a/client/src/app/+admin/moderation/video-comment-list/video-comment-list.component.html b/client/src/app/+admin/moderation/video-comment-list/video-comment-list.component.html
index d1ecc2834..d360c3c51 100644
--- a/client/src/app/+admin/moderation/video-comment-list/video-comment-list.component.html
+++ b/client/src/app/+admin/moderation/video-comment-list/video-comment-list.component.html
@@ -86,12 +86,8 @@
86 <td> 86 <td>
87 <a [href]="videoComment.account.localUrl" i18n-title title="Open account in a new tab" target="_blank" rel="noopener noreferrer"> 87 <a [href]="videoComment.account.localUrl" i18n-title title="Open account in a new tab" target="_blank" rel="noopener noreferrer">
88 <div class="chip two-lines"> 88 <div class="chip two-lines">
89 <img 89 <my-account-avatar [account]="videoComment.account"></my-account-avatar>
90 class="avatar" 90 <div>
91 [src]="videoComment.accountAvatarUrl"
92 alt=""
93 >
94 <div>
95 {{ videoComment.account.displayName }} 91 {{ videoComment.account.displayName }}
96 <span>{{ videoComment.by }}</span> 92 <span>{{ videoComment.by }}</span>
97 </div> 93 </div>
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 4a09fb392..e114f3425 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
@@ -106,13 +106,8 @@
106 <td *ngIf="isSelected('username')"> 106 <td *ngIf="isSelected('username')">
107 <a i18n-title title="Open account in a new tab" target="_blank" rel="noopener noreferrer" [routerLink]="[ '/accounts/' + user.username ]"> 107 <a i18n-title title="Open account in a new tab" target="_blank" rel="noopener noreferrer" [routerLink]="[ '/accounts/' + user.username ]">
108 <div class="chip two-lines"> 108 <div class="chip two-lines">
109 <img 109 <my-account-avatar [account]="user?.account"></my-account-avatar>
110 class="avatar" 110 <div>
111 [src]="user?.account?.avatar?.path"
112 (error)="switchToDefaultAvatar($event)"
113 alt="Avatar"
114 >
115 <div>
116 <span class="user-table-primary-text">{{ user.account.displayName }}</span> 111 <span class="user-table-primary-text">{{ user.account.displayName }}</span>
117 <span class="text-muted">{{ user.username }}</span> 112 <span class="text-muted">{{ user.username }}</span>
118 </div> 113 </div>
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 7875b74ad..339e18206 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
@@ -163,10 +163,6 @@ export class UserListComponent extends RestTable implements OnInit {
163 this.loadData() 163 this.loadData()
164 } 164 }
165 165
166 switchToDefaultAvatar ($event: Event) {
167 ($event.target as HTMLImageElement).src = Account.GET_DEFAULT_AVATAR_URL()
168 }
169
170 async unbanUsers (users: User[]) { 166 async unbanUsers (users: User[]) {
171 const res = await this.confirmService.confirm($localize`Do you really want to unban ${users.length} users?`, $localize`Unban`) 167 const res = await this.confirmService.confirm($localize`Do you really want to unban ${users.length} users?`, $localize`Unban`)
172 if (res === false) return 168 if (res === false) return