From 8ae03c37181822617418d1fc372982b245ac0a9a Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Tue, 3 Sep 2019 09:49:04 +0200 Subject: [PATCH] Add creation reason --- .../about-instance.component.html | 12 +++-- .../about-instance.component.ts | 2 + .../edit-custom-config.component.html | 26 ++++++--- .../edit-custom-config.component.scss | 4 +- .../edit-custom-config.component.ts | 2 + config/default.yaml | 3 ++ config/production.yaml.example | 54 ++++++++++++++++++- server/controllers/api/config.ts | 2 + server/initializers/config.ts | 2 + server/tests/api/check-params/config.ts | 1 + server/tests/api/server/config.ts | 3 ++ shared/extra-utils/server/config.ts | 1 + shared/models/server/about.model.ts | 1 + shared/models/server/custom-config.model.ts | 1 + 14 files changed, 100 insertions(+), 14 deletions(-) diff --git a/client/src/app/+about/about-instance/about-instance.component.html b/client/src/app/+about/about-instance/about-instance.component.html index 80acfcce0..8b21137af 100644 --- a/client/src/app/+about/about-instance/about-instance.component.html +++ b/client/src/app/+about/about-instance/about-instance.component.html @@ -24,19 +24,25 @@
-
Who are we?
+
Who we are
+
+
Why we created this instance
+ +

{{ creationReason }}

+
+
-
How long do we plan to maintain this instance?
+
How long we plan to maintain this instance

{{ maintenanceLifetime }}

-
How will we pay this instance?
+
How we will pay this instance

{{ businessModel }}

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 e2c448501..b6cade4fe 100644 --- a/client/src/app/+about/about-instance/about-instance.component.ts +++ b/client/src/app/+about/about-instance/about-instance.component.ts @@ -25,6 +25,7 @@ export class AboutInstanceComponent implements OnInit { administrator: '' } + creationReason = '' maintenanceLifetime = '' businessModel = '' @@ -61,6 +62,7 @@ export class AboutInstanceComponent implements OnInit { async ([ about, translations ]) => { this.shortDescription = about.instance.shortDescription + this.creationReason = about.instance.creationReason this.maintenanceLifetime = about.instance.maintenanceLifetime this.businessModel = about.instance.businessModel 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 5aa6fda3c..ef24e5b24 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 @@ -21,7 +21,7 @@
{{ formErrors.instance.shortDescription }}
@@ -130,14 +130,26 @@
You and your instance
- +
A single person? A non profit? A company?
+ + +
{{ formErrors.instance.administrator }}
+
+ +
+ +
To share your personal videos? To open registrations and allow people to upload what they want?
+ -
{{ formErrors.instance.administrator }}
+
{{ formErrors.instance.creationReason }}
@@ -145,7 +157,7 @@
It's important to know for users who want to register on your instance
{{ formErrors.instance.maintenanceLifetime }}
@@ -156,7 +168,7 @@
With you own funds? With users donations? Advertising?
{{ formErrors.instance.businessModel }}
diff --git a/client/src/app/+admin/config/edit-custom-config/edit-custom-config.component.scss b/client/src/app/+admin/config/edit-custom-config/edit-custom-config.component.scss index 68f1b01b7..2b4d0da2c 100644 --- a/client/src/app/+admin/config/edit-custom-config/edit-custom-config.component.scss +++ b/client/src/app/+admin/config/edit-custom-config/edit-custom-config.component.scss @@ -44,8 +44,8 @@ textarea { display: block; - &#instanceShortDescription { - height: 100px; + &.small { + height: 75px; } } diff --git a/client/src/app/+admin/config/edit-custom-config/edit-custom-config.component.ts b/client/src/app/+admin/config/edit-custom-config/edit-custom-config.component.ts index 3119ab040..e6f56bc97 100644 --- a/client/src/app/+admin/config/edit-custom-config/edit-custom-config.component.ts +++ b/client/src/app/+admin/config/edit-custom-config/edit-custom-config.component.ts @@ -100,6 +100,8 @@ export class EditCustomConfigComponent extends FormReactive implements OnInit { terms: null, codeOfConduct: null, + + creationReason: null, moderationInformation: null, administrator: null, maintenanceLifetime: null, diff --git a/config/default.yaml b/config/default.yaml index f84ecfcf9..7ed096dcd 100644 --- a/config/default.yaml +++ b/config/default.yaml @@ -243,6 +243,9 @@ instance: # Who moderates the instance? What is the policy regarding NSFW videos? Political videos? etc moderation_information: '' # Supports markdown + # Why did you create this instance? + creation_reason: '' + # Who is behind the instance? A single person? A non profit? administrator: '' diff --git a/config/production.yaml.example b/config/production.yaml.example index 397e52740..b86068bde 100644 --- a/config/production.yaml.example +++ b/config/production.yaml.example @@ -251,9 +251,58 @@ auto_blacklist: instance: name: 'PeerTube' short_description: 'PeerTube, a federated (ActivityPub) video streaming platform using P2P (BitTorrent) directly in the web browser with WebTorrent and Angular.' - description: '' # Support markdown - terms: '' # Support markdown + description: 'Welcome to this PeerTube instance!' # Support markdown + terms: 'No terms for now.' # Support markdown + code_of_conduct: '' # Supports markdown + + # Who moderates the instance? What is the policy regarding NSFW videos? Political videos? etc + moderation_information: '' # Supports markdown + + # Why did you create this instance? + creation_reason: '' + + # Who is behind the instance? A single person? A non profit? + administrator: '' + + # How long do you plan to maintain this instance? + maintenance_lifetime: '' + + # How will you pay the PeerTube instance server? With you own funds? With users donations? Advertising? + business_model: '' + + # What are the main languages of your instance? To interact with your users for example + # Uncomment or add the languages you want + # List of supported languages: https://peertube.cpy.re/api/v1/videos/languages + languages: +# - en +# - es +# - fr + + # You can specify the main categories of your instance (dedicated to music, gaming or politics etc) + # Uncomment or add the category ids you want + # List of supported categories: https://peertube.cpy.re/api/v1/videos/categories + categories: +# - 1 # Music +# - 2 # Films +# - 3 # Vehicles +# - 4 # Art +# - 5 # Sports +# - 6 # Travels +# - 7 # Gaming +# - 8 # People +# - 9 # Comedy +# - 10 # Entertainment +# - 11 # News & Politics +# - 12 # How To +# - 13 # Education +# - 14 # Activism +# - 15 # Science & Technology +# - 16 # Animals +# - 17 # Kids +# - 18 # Food + default_client_route: '/videos/trending' + # Whether or not the instance is dedicated to 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 @@ -261,6 +310,7 @@ instance: # By default, "do_not_list" or "blur" or "display" NSFW videos # Could be overridden per user with a setting default_nsfw_policy: 'do_not_list' + customizations: javascript: '' # Directly your JavaScript code (without