From 421d935d256db5b77a652d8da0c9a38cb57147ba Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Tue, 27 Aug 2019 17:09:43 +0200 Subject: [PATCH] Add about information in registration page --- .../about-instance.component.ts | 31 +--- .../edit-custom-config.component.html | 147 +++++++++++------- .../my-account-video-settings.component.html | 19 ++- .../register-step-user.component.html | 15 +- .../+register/register-step-user.component.ts | 16 +- .../+signup/+register/register.component.html | 63 +++++++- .../+signup/+register/register.component.scss | 37 ++++- .../+signup/+register/register.component.ts | 40 ++++- .../app/+signup/+register/register.module.ts | 4 +- client/src/app/login/login.component.html | 9 +- .../angular/peertube-template.directive.ts | 4 +- .../forms/peertube-checkbox.component.html | 11 +- .../forms/peertube-checkbox.component.ts | 24 ++- .../instance-features-table.component.html | 6 +- .../app/shared/instance/instance.service.ts | 45 +++++- .../src/app/shared/misc/help.component.html | 28 ++-- client/src/app/shared/misc/help.component.ts | 36 +++-- .../remote-subscribe.component.html | 22 ++- .../video/videos-selection.component.ts | 2 +- .../shared/video-edit.component.html | 54 +++++-- .../video-import-torrent.component.html | 12 +- .../video-import-url.component.html | 14 +- 22 files changed, 467 insertions(+), 172 deletions(-) diff --git a/client/src/app/+about/about-instance/about-instance.component.ts b/client/src/app/+about/about-instance/about-instance.component.ts index 0af1dca9c..e2c448501 100644 --- a/client/src/app/+about/about-instance/about-instance.component.ts +++ b/client/src/app/+about/about-instance/about-instance.component.ts @@ -6,7 +6,6 @@ import { InstanceService } from '@app/shared/instance/instance.service' import { MarkdownService } from '@app/shared/renderer' import { forkJoin } from 'rxjs' import { first } from 'rxjs/operators' -import { peertubeTranslate } from '@shared/models' @Component({ selector: 'my-about-instance', @@ -59,32 +58,16 @@ export class AboutInstanceComponent implements OnInit { this.serverService.videoLanguagesLoaded.pipe(first()), this.serverService.videoCategoriesLoaded.pipe(first()) ]).subscribe( - async ([ res, translations ]) => { - this.shortDescription = res.instance.shortDescription + async ([ about, translations ]) => { + this.shortDescription = about.instance.shortDescription - this.maintenanceLifetime = res.instance.maintenanceLifetime - this.businessModel = res.instance.businessModel + this.maintenanceLifetime = about.instance.maintenanceLifetime + this.businessModel = about.instance.businessModel - for (const key of [ 'description', 'terms', 'codeOfConduct', 'moderationInformation', 'administrator' ]) { - this.html[ key ] = await this.markdownService.textMarkdownToHTML(res.instance[ key ]) - } + this.html = await this.instanceService.buildHtml(about) - const languagesArray = this.serverService.getVideoLanguages() - const categoriesArray = this.serverService.getVideoCategories() - - this.languages = res.instance.languages - .map(l => { - const languageObj = languagesArray.find(la => la.id === l) - - return peertubeTranslate(languageObj.label, translations) - }) - - this.categories = res.instance.categories - .map(c => { - const categoryObj = categoriesArray.find(ca => ca.id === c) - - return peertubeTranslate(categoryObj.label, translations) - }) + this.languages = this.instanceService.buildTranslatedLanguages(about, translations) + this.categories = this.instanceService.buildTranslatedCategories(about, translations) }, () => this.notifier.error(this.i18n('Cannot get about information from server')) diff --git a/client/src/app/+admin/config/edit-custom-config/edit-custom-config.component.html b/client/src/app/+admin/config/edit-custom-config/edit-custom-config.component.html index 50df8a8ac..5aa6fda3c 100644 --- a/client/src/app/+admin/config/edit-custom-config/edit-custom-config.component.html +++ b/client/src/app/+admin/config/edit-custom-config/edit-custom-config.component.html @@ -63,20 +63,30 @@
Moderation & NSFW
- + + + This instance is dedicated to sensitive or NSFW content + + + + + Enabling it will allow other administrators to know that you are mainly federating sensitive content.

+ Moreover, the NSFW checkbox on video upload will be automatically checked by default. +
+
+
- + + + + + With Do not list or Blur thumbnails, a confirmation will be requested to watch the video. + + +
- + + + Instance whitelisted by Twitter + + + + + If your instance is whitelisted by Twitter, a video player will be embedded in the Twitter feed on PeerTube video share.
+ If the instance is not whitelisted, we use an image link card that will redirect on your PeerTube instance.

+ Check this checkbox, save the configuration and test with a video URL of your instance (https://example.com/videos/watch/blabla) on + https://cards-dev.twitter.com/validator + to see if you instance is whitelisted. +
+
+
@@ -408,11 +429,15 @@
- + + + Transcoding enabled + + + + If you disable transcoding, many videos from your users will not work! + +
@@ -421,16 +446,22 @@ + > + + Allow your users to upload .mkv, .mov, .avi, .flv videos + +
+ > + + Allow your users to upload audio files that will be merged with the preview file on upload + +
@@ -460,10 +491,11 @@
Cache - + + + Some files are not federated (previews, captions). We fetch them directly from the origin instance and cache them. + +
@@ -492,38 +524,45 @@
- + + + + Write directly JavaScript code.
Example:
console.log('my instance is amazing');
+
+
+
+ +
{{ formErrors.instance.customizations.javascript }}
- + Write directly CSS code. Example:

-
-  #custom-css {{ '{' }}
-    color: red;
-  {{ '}' }}
-                    
+
+#custom-css {{ '{' }}
+  color: red;
+{{ '}' }}
+
Prepend with #custom-css to override styles. Example:

-
-  #custom-css .logged-in-email {{ '{' }}
-    color: red;
-  {{ '}' }}
-                    
- " - >
+
+#custom-css .logged-in-email {{ '{' }}
+  color: red;
+{{ '}' }}
+
+ + + +