+
+
-
+
+
Next
@@ -38,9 +42,56 @@
-
-
Features found on this instance
-
+
diff --git a/client/src/app/+signup/+register/register.component.scss b/client/src/app/+signup/+register/register.component.scss
index 9405b5293..2f62dd59d 100644
--- a/client/src/app/+signup/+register/register.component.scss
+++ b/client/src/app/+signup/+register/register.component.scss
@@ -1,5 +1,9 @@
@import '_variables';
@import '_mixins';
+@import "./_bootstrap-variables";
+
+@import '~bootstrap/scss/functions';
+@import '~bootstrap/scss/variables';
.alert {
font-size: 15px;
@@ -13,7 +17,32 @@
& > div {
margin-bottom: 40px;
- width: 450px;
+
+ &.register-form {
+ width: 450px;
+ }
+
+ &.instance-information {
+ width: 600px;
+ margin-bottom: 40px;
+
+ .block {
+ font-size: 15px;
+ margin-bottom: 15px;
+ padding: 0 $btn-padding-x;
+ }
+
+ @media screen and (max-width: 1500px) {
+ width: 450px;
+ }
+
+ ngb-accordion ::ng-deep {
+ .btn {
+ font-weight: $font-semibold !important;
+ color: var(--mainForegroundColor) !important;
+ }
+ }
+ }
@media screen and (max-width: 500px) {
width: auto;
@@ -21,12 +50,6 @@
}
}
-my-instance-features-table {
- display: block;
-
- margin-bottom: 40px;
-}
-
.form-group-terms {
margin: 30px 0;
}
diff --git a/client/src/app/+signup/+register/register.component.ts b/client/src/app/+signup/+register/register.component.ts
index cd6059728..d470ef4dc 100644
--- a/client/src/app/+signup/+register/register.component.ts
+++ b/client/src/app/+signup/+register/register.component.ts
@@ -1,21 +1,35 @@
-import { Component } from '@angular/core'
+import { Component, OnInit, ViewChild } from '@angular/core'
import { AuthService, Notifier, RedirectService, ServerService } from '@app/core'
import { UserService, UserValidatorsService } from '@app/shared'
import { I18n } from '@ngx-translate/i18n-polyfill'
import { UserRegister } from '@shared/models/users/user-register.model'
import { FormGroup } from '@angular/forms'
+import { About } from '@shared/models/server'
+import { InstanceService } from '@app/shared/instance/instance.service'
+import { NgbAccordion } from '@ng-bootstrap/ng-bootstrap'
@Component({
selector: 'my-register',
templateUrl: './register.component.html',
styleUrls: [ './register.component.scss' ]
})
-export class RegisterComponent {
+export class RegisterComponent implements OnInit {
+ @ViewChild('accordion', { static: true }) accordion: NgbAccordion
+
info: string = null
error: string = null
success: string = null
signupDone = false
+ about: About
+ aboutHtml = {
+ description: '',
+ terms: '',
+ codeOfConduct: '',
+ moderationInformation: '',
+ administrator: ''
+ }
+
formStepUser: FormGroup
formStepChannel: FormGroup
@@ -26,6 +40,7 @@ export class RegisterComponent {
private userService: UserService,
private serverService: ServerService,
private redirectService: RedirectService,
+ private instanceService: InstanceService,
private i18n: I18n
) {
}
@@ -34,6 +49,19 @@ export class RegisterComponent {
return this.serverService.getConfig().signup.requiresEmailVerification
}
+ ngOnInit (): void {
+ this.instanceService.getAbout()
+ .subscribe(
+ async about => {
+ this.about = about
+
+ this.aboutHtml = await this.instanceService.buildHtml(about)
+ },
+
+ err => this.notifier.error(err.message)
+ )
+ }
+
hasSameChannelAndAccountNames () {
return this.getUsername() === this.getChannelName()
}
@@ -58,6 +86,14 @@ export class RegisterComponent {
this.formStepChannel = form
}
+ onTermsClick () {
+ if (this.accordion) this.accordion.toggle('terms')
+ }
+
+ onCodeOfConductClick () {
+ if (this.accordion) this.accordion.toggle('code-of-conduct')
+ }
+
signup () {
this.error = null
diff --git a/client/src/app/+signup/+register/register.module.ts b/client/src/app/+signup/+register/register.module.ts
index 46336cbd0..e55f83990 100644
--- a/client/src/app/+signup/+register/register.module.ts
+++ b/client/src/app/+signup/+register/register.module.ts
@@ -7,13 +7,15 @@ import { RegisterStepChannelComponent } from './register-step-channel.component'
import { RegisterStepUserComponent } from './register-step-user.component'
import { CustomStepperComponent } from './custom-stepper.component'
import { SignupSharedModule } from '@app/+signup/shared/signup-shared.module'
+import { NgbAccordionModule } from '@ng-bootstrap/ng-bootstrap'
@NgModule({
imports: [
RegisterRoutingModule,
SharedModule,
CdkStepperModule,
- SignupSharedModule
+ SignupSharedModule,
+ NgbAccordionModule
],
declarations: [
diff --git a/client/src/app/login/login.component.html b/client/src/app/login/login.component.html
index 4efe3fb22..683355960 100644
--- a/client/src/app/login/login.component.html
+++ b/client/src/app/login/login.component.html
@@ -23,10 +23,11 @@
or create an account on another instance
-
+
+
+ User registration is not allowed on this instance, but you can register on many others!
+
+
diff --git a/client/src/app/shared/forms/peertube-checkbox.component.ts b/client/src/app/shared/forms/peertube-checkbox.component.ts
index a4b72aa37..3b8f39ed0 100644
--- a/client/src/app/shared/forms/peertube-checkbox.component.ts
+++ b/client/src/app/shared/forms/peertube-checkbox.component.ts
@@ -1,5 +1,6 @@
-import { ChangeDetectorRef, Component, forwardRef, Input, OnChanges, SimpleChanges } from '@angular/core'
+import { AfterContentInit, ChangeDetectorRef, Component, ContentChildren, forwardRef, Input, QueryList, TemplateRef } from '@angular/core'
import { ControlValueAccessor, NG_VALUE_ACCESSOR } from '@angular/forms'
+import { PeerTubeTemplateDirective } from '@app/shared/angular/peertube-template.directive'
@Component({
selector: 'my-peertube-checkbox',
@@ -13,20 +14,35 @@ import { ControlValueAccessor, NG_VALUE_ACCESSOR } from '@angular/forms'
}
]
})
-export class PeertubeCheckboxComponent implements ControlValueAccessor {
+export class PeertubeCheckboxComponent implements ControlValueAccessor, AfterContentInit {
@Input() checked = false
@Input() inputName: string
@Input() labelText: string
- @Input() labelHtml: string
- @Input() helpHtml: string
@Input() helpPlacement = 'top'
@Input() disabled = false
+ @ContentChildren(PeerTubeTemplateDirective) templates: QueryList
>
+
// FIXME: https://github.com/angular/angular/issues/10816#issuecomment-307567836
@Input() onPushWorkaround = false
+ labelTemplate: TemplateRef
+ helpTemplate: TemplateRef
+
constructor (private cdr: ChangeDetectorRef) { }
+ ngAfterContentInit () {
+ {
+ const t = this.templates.find(t => t.name === 'label')
+ if (t) this.labelTemplate = t.template
+ }
+
+ {
+ const t = this.templates.find(t => t.name === 'help')
+ if (t) this.helpTemplate = t.template
+ }
+ }
+
propagateChange = (_: any) => { /* empty */ }
writeValue (checked: boolean) {
diff --git a/client/src/app/shared/instance/instance-features-table.component.html b/client/src/app/shared/instance/instance-features-table.component.html
index 845876f55..d1cb8fcbe 100644
--- a/client/src/app/shared/instance/instance-features-table.component.html
+++ b/client/src/app/shared/instance/instance-features-table.component.html
@@ -43,7 +43,11 @@
{{ initialUserVideoQuota | bytes: 0 }} ({{ dailyUserVideoQuota | bytes: 0 }} per day)
-
+
+
+
+
+
diff --git a/client/src/app/shared/instance/instance.service.ts b/client/src/app/shared/instance/instance.service.ts
index d0c96941d..7c76bc98b 100644
--- a/client/src/app/shared/instance/instance.service.ts
+++ b/client/src/app/shared/instance/instance.service.ts
@@ -4,6 +4,9 @@ import { Injectable } from '@angular/core'
import { environment } from '../../../environments/environment'
import { RestExtractor, RestService } from '../rest'
import { About } from '../../../../../shared/models/server'
+import { MarkdownService } from '@app/shared/renderer'
+import { peertubeTranslate } from '@shared/models'
+import { ServerService } from '@app/core'
@Injectable()
export class InstanceService {
@@ -13,7 +16,9 @@ export class InstanceService {
constructor (
private authHttp: HttpClient,
private restService: RestService,
- private restExtractor: RestExtractor
+ private restExtractor: RestExtractor,
+ private markdownService: MarkdownService,
+ private serverService: ServerService
) {
}
@@ -34,4 +39,42 @@ export class InstanceService {
.pipe(catchError(res => this.restExtractor.handleError(res)))
}
+
+ async buildHtml (about: About) {
+ const html = {
+ description: '',
+ terms: '',
+ codeOfConduct: '',
+ moderationInformation: '',
+ administrator: ''
+ }
+
+ for (const key of [ 'description', 'terms', 'codeOfConduct', 'moderationInformation', 'administrator' ]) {
+ html[ key ] = await this.markdownService.textMarkdownToHTML(about.instance[ key ])
+ }
+
+ return html
+ }
+
+ buildTranslatedLanguages (about: About, translations: any) {
+ const languagesArray = this.serverService.getVideoLanguages()
+
+ return about.instance.languages
+ .map(l => {
+ const languageObj = languagesArray.find(la => la.id === l)
+
+ return peertubeTranslate(languageObj.label, translations)
+ })
+ }
+
+ buildTranslatedCategories (about: About, translations: any) {
+ const categoriesArray = this.serverService.getVideoCategories()
+
+ return about.instance.categories
+ .map(c => {
+ const categoryObj = categoriesArray.find(ca => ca.id === c)
+
+ return peertubeTranslate(categoryObj.label, translations)
+ })
+ }
}
diff --git a/client/src/app/shared/misc/help.component.html b/client/src/app/shared/misc/help.component.html
index e31eef06a..9a6d3e48e 100644
--- a/client/src/app/shared/misc/help.component.html
+++ b/client/src/app/shared/misc/help.component.html
@@ -1,15 +1,25 @@
-
-
-
-
+
+
+
-
+
+
+
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
>
+
isPopoverOpened = false
mainHtml = ''
+ preHtmlTemplate: TemplateRef
+ customHtmlTemplate: TemplateRef
+ postHtmlTemplate: TemplateRef
+
constructor (private i18n: I18n) { }
ngOnInit () {
this.init()
}
+ ngAfterContentInit () {
+ {
+ const t = this.templates.find(t => t.name === 'preHtml')
+ if (t) this.preHtmlTemplate = t.template
+ }
+
+ {
+ const t = this.templates.find(t => t.name === 'customHtml')
+ if (t) this.customHtmlTemplate = t.template
+ }
+
+ {
+ const t = this.templates.find(t => t.name === 'postHtml')
+ if (t) this.postHtmlTemplate = t.template
+ }
+ }
+
ngOnChanges () {
this.init()
}
@@ -37,11 +58,6 @@ export class HelpComponent implements OnInit, OnChanges {
}
private init () {
- if (this.helpType === 'custom') {
- this.mainHtml = this.customHtml
- return
- }
-
if (this.helpType === 'markdownText') {
this.mainHtml = this.formatMarkdownSupport(MarkdownService.TEXT_RULES)
return
diff --git a/client/src/app/shared/user-subscription/remote-subscribe.component.html b/client/src/app/shared/user-subscription/remote-subscribe.component.html
index ec3636b3e..59ee1cb04 100644
--- a/client/src/app/shared/user-subscription/remote-subscribe.component.html
+++ b/client/src/app/shared/user-subscription/remote-subscribe.component.html
@@ -12,13 +12,21 @@
Remote interact
-
+
+
+
+ You can subscribe to the channel via any ActivityPub-capable fediverse instance.
+ For instance with Mastodon or Pleroma you can type the channel URL in the search box and subscribe there.
+
+
-
+
+
+
+ You can interact with this via any ActivityPub-capable fediverse instance.
+ For instance with Mastodon or Pleroma you can type the current URL in the search box and interact with it there.
+
+
-
\ No newline at end of file
+
diff --git a/client/src/app/shared/video/videos-selection.component.ts b/client/src/app/shared/video/videos-selection.component.ts
index 994e0fa1e..064420056 100644
--- a/client/src/app/shared/video/videos-selection.component.ts
+++ b/client/src/app/shared/video/videos-selection.component.ts
@@ -35,7 +35,7 @@ export class VideosSelectionComponent extends AbstractVideoList implements OnIni
@Input() titlePage: string
@Input() miniatureDisplayOptions: MiniatureDisplayOptions
@Input() getVideosObservableFunction: (page: number, sort?: VideoSortField) => Observable>
- @ContentChildren(PeerTubeTemplateDirective) templates: QueryList
+ @ContentChildren(PeerTubeTemplateDirective) templates: QueryList>
@Output() selectionChange = new EventEmitter()
@Output() videosModelChange = new EventEmitter()
diff --git a/client/src/app/videos/+video-edit/shared/video-edit.component.html b/client/src/app/videos/+video-edit/shared/video-edit.component.html
index 217cadc66..245ae42b6 100644
--- a/client/src/app/videos/+video-edit/shared/video-edit.component.html
+++ b/client/src/app/videos/+video-edit/shared/video-edit.component.html
@@ -15,7 +15,16 @@
-
+
+
+ This video contains mature or explicit content
+
-
+
+ Some instances do not list videos containing mature or explicit content by default.
+
+
+
+
+
+ Wait transcoding before publishing the video
+
+
+
+ If you decide not to wait for transcoding before publishing the video, it could be unplayable until transcoding ends.
+
+