]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blobdiff - client/src/app/shared/shared-moderation/user-moderation-dropdown.component.ts
Add video-playlist-element.created hook (#4196)
[github/Chocobozzz/PeerTube.git] / client / src / app / shared / shared-moderation / user-moderation-dropdown.component.ts
index 44aefa853b2b4428ddb145865303ef906c31d9df..8c5a48d42ee4120a6498dd0797da88c5ab9b70ff 100644 (file)
@@ -1,7 +1,7 @@
 import { Component, EventEmitter, Input, OnChanges, OnInit, Output, ViewChild } from '@angular/core'
 import { AuthService, ConfirmService, Notifier, ServerService, UserService } from '@app/core'
 import { Account, DropdownAction } from '@app/shared/shared-main'
-import { BulkRemoveCommentsOfBody, ServerConfig, User, UserRight } from '@shared/models'
+import { BulkRemoveCommentsOfBody, User, UserRight } from '@shared/models'
 import { BlocklistService } from './blocklist.service'
 import { BulkService } from './bulk.service'
 import { UserBanModalComponent } from './user-ban-modal.component'
@@ -18,6 +18,7 @@ export class UserModerationDropdownComponent implements OnInit, OnChanges {
   @Input() prependActions: DropdownAction<{ user: User, account: Account }>[]
 
   @Input() buttonSize: 'normal' | 'small' = 'normal'
+  @Input() buttonStyled = true
   @Input() placement = 'right-top right-bottom auto'
   @Input() label: string
   @Input() container: 'body' | undefined = undefined
@@ -27,7 +28,7 @@ export class UserModerationDropdownComponent implements OnInit, OnChanges {
 
   userActions: DropdownAction<{ user: User, account: Account }>[][] = []
 
-  private serverConfig: ServerConfig
+  requiresEmailVerification = false
 
   constructor (
     private authService: AuthService,
@@ -39,14 +40,9 @@ export class UserModerationDropdownComponent implements OnInit, OnChanges {
     private bulkService: BulkService
   ) { }
 
-  get requiresEmailVerification () {
-    return this.serverConfig.signup.requiresEmailVerification
-  }
-
-  ngOnInit (): void {
-    this.serverConfig = this.serverService.getTmpConfig()
+  ngOnInit () {
     this.serverService.getConfig()
-      .subscribe(config => this.serverConfig = config)
+      .subscribe(config => this.requiresEmailVerification = config.signup.requiresEmailVerification)
   }
 
   ngOnChanges () {
@@ -295,7 +291,7 @@ export class UserModerationDropdownComponent implements OnInit, OnChanges {
         this.userActions.push([
           {
             label: $localize`Mute this account`,
-            description: $localize`Hide any content from that user for you.`,
+            description: $localize`Hide any content from that user from you.`,
             isDisplayed: ({ account }) => account.mutedByUser === false,
             handler: ({ account }) => this.blockAccountByUser(account)
           },
@@ -319,7 +315,7 @@ export class UserModerationDropdownComponent implements OnInit, OnChanges {
           },
           {
             label: $localize`Remove comments from your videos`,
-            description: $localize`Remove comments of this account from your videos.`,
+            description: $localize`Remove comments made by this account on your videos.`,
             handler: ({ account }) => this.bulkRemoveCommentsOf({ accountName: account.nameWithHost, scope: 'my-videos' })
           }
         ])
@@ -331,13 +327,13 @@ export class UserModerationDropdownComponent implements OnInit, OnChanges {
           instanceActions = instanceActions.concat([
             {
               label: $localize`Mute this account by your instance`,
-              description: $localize`Hide any content from that user for you, your instance and its users.`,
+              description: $localize`Hide any content from that user from you, your instance and its users.`,
               isDisplayed: ({ account }) => account.mutedByInstance === false,
               handler: ({ account }) => this.blockAccountByInstance(account)
             },
             {
               label: $localize`Unmute this account by your instance`,
-              description: $localize`Show back content from that user for you, your instance and its users.`,
+              description: $localize`Show this user's content to the users of this instance again.`,
               isDisplayed: ({ account }) => account.mutedByInstance === true,
               handler: ({ account }) => this.unblockAccountByInstance(account)
             }
@@ -349,7 +345,7 @@ export class UserModerationDropdownComponent implements OnInit, OnChanges {
           instanceActions = instanceActions.concat([
             {
               label: $localize`Mute the instance by your instance`,
-              description: $localize`Hide any content from that instance for you, your instance and its users.`,
+              description: $localize`Hide any content from that instance from you, your instance and its users.`,
               isDisplayed: ({ account }) => !account.userId && account.mutedServerByInstance === false,
               handler: ({ account }) => this.blockServerByInstance(account.host)
             },
@@ -366,7 +362,7 @@ export class UserModerationDropdownComponent implements OnInit, OnChanges {
           instanceActions = instanceActions.concat([
             {
               label: $localize`Remove comments from your instance`,
-              description: $localize`Remove comments of this account from your instance.`,
+              description: $localize`Remove comments made by this account from your instance.`,
               handler: ({ account }) => this.bulkRemoveCommentsOf({ accountName: account.nameWithHost, scope: 'instance' })
             }
           ])