diff options
author | Rigel Kent <sendmemail@rigelk.eu> | 2021-01-17 18:13:05 +0100 |
---|---|---|
committer | Rigel Kent <sendmemail@rigelk.eu> | 2021-01-17 18:13:05 +0100 |
commit | 52a3f561f5357d076ddc36897d5e1d0fc60a8730 (patch) | |
tree | 318450ec74b2d1ccfb872617d23d152042dd86de /client/src | |
parent | 111e6c1807dac4230014bd295118c6b3a51be8f5 (diff) | |
download | PeerTube-52a3f561f5357d076ddc36897d5e1d0fc60a8730.tar.gz PeerTube-52a3f561f5357d076ddc36897d5e1d0fc60a8730.tar.zst PeerTube-52a3f561f5357d076ddc36897d5e1d0fc60a8730.zip |
add username information in profile settings
Diffstat (limited to 'client/src')
4 files changed, 28 insertions, 1 deletions
diff --git a/client/src/app/+my-account/my-account-settings/my-account-change-email/my-account-change-email.component.html b/client/src/app/+my-account/my-account-settings/my-account-change-email/my-account-change-email.component.html index 29823bdec..6d2d7d46e 100644 --- a/client/src/app/+my-account/my-account-settings/my-account-change-email/my-account-change-email.component.html +++ b/client/src/app/+my-account/my-account-settings/my-account-change-email/my-account-change-email.component.html | |||
@@ -2,7 +2,8 @@ | |||
2 | <div *ngIf="success" class="alert alert-success">{{ success }}</div> | 2 | <div *ngIf="success" class="alert alert-success">{{ success }}</div> |
3 | 3 | ||
4 | <div i18n class="current-email"> | 4 | <div i18n class="current-email"> |
5 | Your current email is <span class="email">{{ user.email }}</span> | 5 | Your current email is <span class="email">{{ user.email }}</span>. |
6 | It is never shown to the public. | ||
6 | </div> | 7 | </div> |
7 | 8 | ||
8 | <div i18n class="pending-email" *ngIf="user.pendingEmail"> | 9 | <div i18n class="pending-email" *ngIf="user.pendingEmail"> |
diff --git a/client/src/app/+my-account/my-account-settings/my-account-profile/my-account-profile.component.html b/client/src/app/+my-account/my-account-settings/my-account-profile/my-account-profile.component.html index 818e34ee0..7e6b45386 100644 --- a/client/src/app/+my-account/my-account-settings/my-account-profile/my-account-profile.component.html +++ b/client/src/app/+my-account/my-account-settings/my-account-profile/my-account-profile.component.html | |||
@@ -3,6 +3,17 @@ | |||
3 | <form role="form" (ngSubmit)="updateMyProfile()" [formGroup]="form"> | 3 | <form role="form" (ngSubmit)="updateMyProfile()" [formGroup]="form"> |
4 | 4 | ||
5 | <div class="form-group"> | 5 | <div class="form-group"> |
6 | <label i18n for="user-name">User name</label> | ||
7 | <input | ||
8 | type="text" id="user-name" class="form-control" | ||
9 | formControlName="user-name" | ||
10 | > | ||
11 | <div class="text-muted" i18n> | ||
12 | People can find you @{{ user.username }}@{{ instanceHost }} | ||
13 | </div> | ||
14 | </div> | ||
15 | |||
16 | <div class="form-group"> | ||
6 | <label i18n for="display-name">Display name</label> | 17 | <label i18n for="display-name">Display name</label> |
7 | <input | 18 | <input |
8 | type="text" id="display-name" class="form-control" | 19 | type="text" id="display-name" class="form-control" |
diff --git a/client/src/app/+my-account/my-account-settings/my-account-profile/my-account-profile.component.scss b/client/src/app/+my-account/my-account-settings/my-account-profile/my-account-profile.component.scss index ec3f6029e..58402a272 100644 --- a/client/src/app/+my-account/my-account-settings/my-account-profile/my-account-profile.component.scss +++ b/client/src/app/+my-account/my-account-settings/my-account-profile/my-account-profile.component.scss | |||
@@ -16,6 +16,14 @@ input[type=text] { | |||
16 | display: block; | 16 | display: block; |
17 | } | 17 | } |
18 | 18 | ||
19 | input#user-name { | ||
20 | border: none; | ||
21 | |||
22 | & + div { | ||
23 | padding-left: 15px; | ||
24 | } | ||
25 | } | ||
26 | |||
19 | input[type=submit] { | 27 | input[type=submit] { |
20 | @include peertube-button; | 28 | @include peertube-button; |
21 | @include orange-button; | 29 | @include orange-button; |
diff --git a/client/src/app/+my-account/my-account-settings/my-account-profile/my-account-profile.component.ts b/client/src/app/+my-account/my-account-settings/my-account-profile/my-account-profile.component.ts index 000a2c0ac..957abe555 100644 --- a/client/src/app/+my-account/my-account-settings/my-account-profile/my-account-profile.component.ts +++ b/client/src/app/+my-account/my-account-settings/my-account-profile/my-account-profile.component.ts | |||
@@ -25,18 +25,25 @@ export class MyAccountProfileComponent extends FormReactive implements OnInit { | |||
25 | 25 | ||
26 | ngOnInit () { | 26 | ngOnInit () { |
27 | this.buildForm({ | 27 | this.buildForm({ |
28 | 'user-name': null, | ||
28 | 'display-name': USER_DISPLAY_NAME_REQUIRED_VALIDATOR, | 29 | 'display-name': USER_DISPLAY_NAME_REQUIRED_VALIDATOR, |
29 | description: USER_DESCRIPTION_VALIDATOR | 30 | description: USER_DESCRIPTION_VALIDATOR |
30 | }) | 31 | }) |
32 | this.form.controls['user-name'].disable() | ||
31 | 33 | ||
32 | this.userInformationLoaded.subscribe(() => { | 34 | this.userInformationLoaded.subscribe(() => { |
33 | this.form.patchValue({ | 35 | this.form.patchValue({ |
36 | 'user-name': this.user.username, | ||
34 | 'display-name': this.user.account.displayName, | 37 | 'display-name': this.user.account.displayName, |
35 | description: this.user.account.description | 38 | description: this.user.account.description |
36 | }) | 39 | }) |
37 | }) | 40 | }) |
38 | } | 41 | } |
39 | 42 | ||
43 | get instanceHost () { | ||
44 | return window.location.host | ||
45 | } | ||
46 | |||
40 | updateMyProfile () { | 47 | updateMyProfile () { |
41 | const displayName = this.form.value['display-name'] | 48 | const displayName = this.form.value['display-name'] |
42 | const description = this.form.value['description'] || null | 49 | const description = this.form.value['description'] || null |