aboutsummaryrefslogtreecommitdiffhomepage
path: root/client/src/app/shared/shared-moderation
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/shared/shared-moderation
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/shared/shared-moderation')
-rw-r--r--client/src/app/shared/shared-moderation/account-blocklist.component.html7
-rw-r--r--client/src/app/shared/shared-moderation/account-blocklist.component.ts4
-rw-r--r--client/src/app/shared/shared-moderation/shared-moderation.module.ts4
3 files changed, 4 insertions, 11 deletions
diff --git a/client/src/app/shared/shared-moderation/account-blocklist.component.html b/client/src/app/shared/shared-moderation/account-blocklist.component.html
index fb6f69cd5..3f2f55559 100644
--- a/client/src/app/shared/shared-moderation/account-blocklist.component.html
+++ b/client/src/app/shared/shared-moderation/account-blocklist.component.html
@@ -38,12 +38,7 @@
38 <td> 38 <td>
39 <a [href]="accountBlock.blockedAccount.url" i18n-title title="Open account in a new tab" target="_blank" rel="noopener noreferrer"> 39 <a [href]="accountBlock.blockedAccount.url" i18n-title title="Open account in a new tab" target="_blank" rel="noopener noreferrer">
40 <div class="chip two-lines"> 40 <div class="chip two-lines">
41 <img 41 <my-account-avatar [account]="accountBlock.blockedAccount"></my-account-avatar>
42 class="avatar"
43 [src]="accountBlock.blockedAccount.avatar?.path"
44 (error)="switchToDefaultAvatar($event)"
45 alt="Avatar"
46 >
47 <div> 42 <div>
48 {{ accountBlock.blockedAccount.displayName }} 43 {{ accountBlock.blockedAccount.displayName }}
49 <span class="text-muted">{{ accountBlock.blockedAccount.nameWithHost }}</span> 44 <span class="text-muted">{{ accountBlock.blockedAccount.nameWithHost }}</span>
diff --git a/client/src/app/shared/shared-moderation/account-blocklist.component.ts b/client/src/app/shared/shared-moderation/account-blocklist.component.ts
index 3de9587b8..1bce65bf0 100644
--- a/client/src/app/shared/shared-moderation/account-blocklist.component.ts
+++ b/client/src/app/shared/shared-moderation/account-blocklist.component.ts
@@ -30,10 +30,6 @@ export class GenericAccountBlocklistComponent extends RestTable implements OnIni
30 this.initialize() 30 this.initialize()
31 } 31 }
32 32
33 switchToDefaultAvatar ($event: Event) {
34 ($event.target as HTMLImageElement).src = Account.GET_DEFAULT_AVATAR_URL()
35 }
36
37 unblockAccount (accountBlock: AccountBlock) { 33 unblockAccount (accountBlock: AccountBlock) {
38 const blockedAccount = accountBlock.blockedAccount 34 const blockedAccount = accountBlock.blockedAccount
39 const operation = this.mode === BlocklistComponentType.Account 35 const operation = this.mode === BlocklistComponentType.Account
diff --git a/client/src/app/shared/shared-moderation/shared-moderation.module.ts b/client/src/app/shared/shared-moderation/shared-moderation.module.ts
index b1b98f8d0..c7e201792 100644
--- a/client/src/app/shared/shared-moderation/shared-moderation.module.ts
+++ b/client/src/app/shared/shared-moderation/shared-moderation.module.ts
@@ -13,13 +13,15 @@ import { UserBanModalComponent } from './user-ban-modal.component'
13import { UserModerationDropdownComponent } from './user-moderation-dropdown.component' 13import { UserModerationDropdownComponent } from './user-moderation-dropdown.component'
14import { VideoBlockComponent } from './video-block.component' 14import { VideoBlockComponent } from './video-block.component'
15import { VideoBlockService } from './video-block.service' 15import { VideoBlockService } from './video-block.service'
16import { SharedAccountAvatarModule } from '../shared-account-avatar/shared-account-avatar.module'
16 17
17@NgModule({ 18@NgModule({
18 imports: [ 19 imports: [
19 SharedMainModule, 20 SharedMainModule,
20 SharedFormModule, 21 SharedFormModule,
21 SharedGlobalIconModule, 22 SharedGlobalIconModule,
22 SharedVideoCommentModule 23 SharedVideoCommentModule,
24 SharedAccountAvatarModule
23 ], 25 ],
24 26
25 declarations: [ 27 declarations: [