diff options
author | Chocobozzz <me@florianbigard.com> | 2018-08-08 17:36:10 +0200 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2018-08-08 17:44:22 +0200 |
commit | eacb25c4366bcc8fba20f98f93f004fabc6d5578 (patch) | |
tree | d006c6ef3358ec8c3e3deda643dc9b70068f2515 /client/src/app/shared/users | |
parent | a6ce68673ace5b94a81eda3ba198f0a4170eb05e (diff) | |
download | PeerTube-eacb25c4366bcc8fba20f98f93f004fabc6d5578.tar.gz PeerTube-eacb25c4366bcc8fba20f98f93f004fabc6d5578.tar.zst PeerTube-eacb25c4366bcc8fba20f98f93f004fabc6d5578.zip |
Add reason when banning a user
Diffstat (limited to 'client/src/app/shared/users')
-rw-r--r-- | client/src/app/shared/users/user.model.ts | 35 |
1 files changed, 14 insertions, 21 deletions
diff --git a/client/src/app/shared/users/user.model.ts b/client/src/app/shared/users/user.model.ts index 581ea7859..2748001d0 100644 --- a/client/src/app/shared/users/user.model.ts +++ b/client/src/app/shared/users/user.model.ts | |||
@@ -7,7 +7,6 @@ import { | |||
7 | VideoChannel | 7 | VideoChannel |
8 | } from '../../../../../shared' | 8 | } from '../../../../../shared' |
9 | import { NSFWPolicyType } from '../../../../../shared/models/videos/nsfw-policy.type' | 9 | import { NSFWPolicyType } from '../../../../../shared/models/videos/nsfw-policy.type' |
10 | import { Actor } from '@app/shared/actor/actor.model' | ||
11 | import { Account } from '@app/shared/account/account.model' | 10 | import { Account } from '@app/shared/account/account.model' |
12 | import { Avatar } from '../../../../../shared/models/avatars/avatar.model' | 11 | import { Avatar } from '../../../../../shared/models/avatars/avatar.model' |
13 | 12 | ||
@@ -22,6 +21,9 @@ export type UserConstructorHash = { | |||
22 | createdAt?: Date, | 21 | createdAt?: Date, |
23 | account?: AccountServerModel, | 22 | account?: AccountServerModel, |
24 | videoChannels?: VideoChannel[] | 23 | videoChannels?: VideoChannel[] |
24 | |||
25 | blocked?: boolean | ||
26 | blockedReason?: string | ||
25 | } | 27 | } |
26 | export class User implements UserServerModel { | 28 | export class User implements UserServerModel { |
27 | id: number | 29 | id: number |
@@ -35,35 +37,26 @@ export class User implements UserServerModel { | |||
35 | videoChannels: VideoChannel[] | 37 | videoChannels: VideoChannel[] |
36 | createdAt: Date | 38 | createdAt: Date |
37 | 39 | ||
40 | blocked: boolean | ||
41 | blockedReason?: string | ||
42 | |||
38 | constructor (hash: UserConstructorHash) { | 43 | constructor (hash: UserConstructorHash) { |
39 | this.id = hash.id | 44 | this.id = hash.id |
40 | this.username = hash.username | 45 | this.username = hash.username |
41 | this.email = hash.email | 46 | this.email = hash.email |
42 | this.role = hash.role | 47 | this.role = hash.role |
43 | 48 | ||
49 | this.videoChannels = hash.videoChannels | ||
50 | this.videoQuota = hash.videoQuota | ||
51 | this.nsfwPolicy = hash.nsfwPolicy | ||
52 | this.autoPlayVideo = hash.autoPlayVideo | ||
53 | this.createdAt = hash.createdAt | ||
54 | this.blocked = hash.blocked | ||
55 | this.blockedReason = hash.blockedReason | ||
56 | |||
44 | if (hash.account !== undefined) { | 57 | if (hash.account !== undefined) { |
45 | this.account = new Account(hash.account) | 58 | this.account = new Account(hash.account) |
46 | } | 59 | } |
47 | |||
48 | if (hash.videoChannels !== undefined) { | ||
49 | this.videoChannels = hash.videoChannels | ||
50 | } | ||
51 | |||
52 | if (hash.videoQuota !== undefined) { | ||
53 | this.videoQuota = hash.videoQuota | ||
54 | } | ||
55 | |||
56 | if (hash.nsfwPolicy !== undefined) { | ||
57 | this.nsfwPolicy = hash.nsfwPolicy | ||
58 | } | ||
59 | |||
60 | if (hash.autoPlayVideo !== undefined) { | ||
61 | this.autoPlayVideo = hash.autoPlayVideo | ||
62 | } | ||
63 | |||
64 | if (hash.createdAt !== undefined) { | ||
65 | this.createdAt = hash.createdAt | ||
66 | } | ||
67 | } | 60 | } |
68 | 61 | ||
69 | get accountAvatarUrl () { | 62 | get accountAvatarUrl () { |