Skip to content

ActivityPub-federated video streaming platform using P2P directly in your web browser

add username information in profile settings

Rigel Kent52a3f561f535
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 29823bdec0..6d2d7d46e4 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 @@
<div *ngIf="success" class="alert alert-success">{{ success }}</div>
<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 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 818e34ee0f..7e6b45386a 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
@@ -2,6 +2,17 @@
<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">
<label i18n for="display-name">Display name</label>
<input
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 ec3f6029e3..58402a2729 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] {
display: block;
}
+input#user-name {
+ border: none;
+
+ & + div {
+ padding-left: 15px;
+ }
+}
+
input[type=submit] {
@include peertube-button;
@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 000a2c0ac7..957abe5555 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 {
ngOnInit () {
this.buildForm({
+ 'user-name': null,
'display-name': USER_DISPLAY_NAME_REQUIRED_VALIDATOR,
description: USER_DESCRIPTION_VALIDATOR
})
+ this.form.controls['user-name'].disable()
this.userInformationLoaded.subscribe(() => {
this.form.patchValue({
+ 'user-name': this.user.username,
'display-name': this.user.account.displayName,
description: this.user.account.description
})
})
}
+ get instanceHost () {
+ return window.location.host
+ }
+
updateMyProfile () {
const displayName = this.form.value['display-name']
const description = this.form.value['description'] || null