add username information in profile settings
This commit is contained in:
parent
111e6c1807
commit
52a3f561f5
|
@ -2,7 +2,8 @@
|
||||||
<div *ngIf="success" class="alert alert-success">{{ success }}</div>
|
<div *ngIf="success" class="alert alert-success">{{ success }}</div>
|
||||||
|
|
||||||
<div i18n class="current-email">
|
<div i18n class="current-email">
|
||||||
Your current email is <span class="email">{{ user.email }}</span>
|
Your current email is <span class="email">{{ user.email }}</span>.
|
||||||
|
It is never shown to the public.
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div i18n class="pending-email" *ngIf="user.pendingEmail">
|
<div i18n class="pending-email" *ngIf="user.pendingEmail">
|
||||||
|
|
|
@ -2,6 +2,17 @@
|
||||||
|
|
||||||
<form role="form" (ngSubmit)="updateMyProfile()" [formGroup]="form">
|
<form role="form" (ngSubmit)="updateMyProfile()" [formGroup]="form">
|
||||||
|
|
||||||
|
<div class="form-group">
|
||||||
|
<label i18n for="user-name">User name</label>
|
||||||
|
<input
|
||||||
|
type="text" id="user-name" class="form-control"
|
||||||
|
formControlName="user-name"
|
||||||
|
>
|
||||||
|
<div class="text-muted" i18n>
|
||||||
|
People can find you @{{ user.username }}@{{ instanceHost }}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<label i18n for="display-name">Display name</label>
|
<label i18n for="display-name">Display name</label>
|
||||||
<input
|
<input
|
||||||
|
|
|
@ -16,6 +16,14 @@ input[type=text] {
|
||||||
display: block;
|
display: block;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
input#user-name {
|
||||||
|
border: none;
|
||||||
|
|
||||||
|
& + div {
|
||||||
|
padding-left: 15px;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
input[type=submit] {
|
input[type=submit] {
|
||||||
@include peertube-button;
|
@include peertube-button;
|
||||||
@include orange-button;
|
@include orange-button;
|
||||||
|
|
|
@ -25,18 +25,25 @@ export class MyAccountProfileComponent extends FormReactive implements OnInit {
|
||||||
|
|
||||||
ngOnInit () {
|
ngOnInit () {
|
||||||
this.buildForm({
|
this.buildForm({
|
||||||
|
'user-name': null,
|
||||||
'display-name': USER_DISPLAY_NAME_REQUIRED_VALIDATOR,
|
'display-name': USER_DISPLAY_NAME_REQUIRED_VALIDATOR,
|
||||||
description: USER_DESCRIPTION_VALIDATOR
|
description: USER_DESCRIPTION_VALIDATOR
|
||||||
})
|
})
|
||||||
|
this.form.controls['user-name'].disable()
|
||||||
|
|
||||||
this.userInformationLoaded.subscribe(() => {
|
this.userInformationLoaded.subscribe(() => {
|
||||||
this.form.patchValue({
|
this.form.patchValue({
|
||||||
|
'user-name': this.user.username,
|
||||||
'display-name': this.user.account.displayName,
|
'display-name': this.user.account.displayName,
|
||||||
description: this.user.account.description
|
description: this.user.account.description
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
get instanceHost () {
|
||||||
|
return window.location.host
|
||||||
|
}
|
||||||
|
|
||||||
updateMyProfile () {
|
updateMyProfile () {
|
||||||
const displayName = this.form.value['display-name']
|
const displayName = this.form.value['display-name']
|
||||||
const description = this.form.value['description'] || null
|
const description = this.form.value['description'] || null
|
||||||
|
|
Loading…
Reference in New Issue