From 8be1afa12b700b93ed92365cab05c0ef81d643aa Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Thu, 10 May 2018 12:26:47 +0200 Subject: Add ability to embed a video in Twitter The instance should be whitelisted first --- .../edit-custom-config.component.html | 471 +++++++++++---------- .../edit-custom-config.component.ts | 14 +- 2 files changed, 267 insertions(+), 218 deletions(-) (limited to 'client/src/app/+admin') 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 021252456..252d43c8f 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 @@ -1,222 +1,259 @@ -
Update PeerTube configuration
-
-
Instance
- -
- - -
- {{ formErrors.instanceName }} -
-
- -
- - -
- {{ formErrors.instanceShortDescription }} -
-
- -
- - -
- {{ formErrors.instanceDescription }} -
-
- -
- - -
- {{ formErrors.instanceTerms }} -
-
- -
- -
- -
-
- {{ formErrors.instanceDefaultClientRoute }} -
-
- -
- - - -
- -
-
- {{ formErrors.instanceDefaultNSFWPolicy }} -
-
- -
Cache
- -
- - -
- {{ formErrors.cachePreviewsSize }} -
-
- -
Signup
- -
- - - - -
- -
- - -
- {{ formErrors.signupLimit }} -
-
- -
Administrator
- -
- - -
- {{ formErrors.adminEmail }} -
-
- -
Users
- -
- -
- -
-
- {{ formErrors.userVideoQuota }} -
-
- -
Transcoding
- -
- - - - -
- - - -
- -
- -
-
- {{ formErrors.transcodingThreads }} -
-
- -
- - - -
-
- -
Customizations
- -
- - - -
- {{ formErrors.customizationJavascript }} -
-
- -
- - - -
- {{ formErrors.customizationCSS }} -
-
+ + + + +
Instance
+ +
+ + +
+ {{ formErrors.instanceName }} +
+
+ +
+ + +
+ {{ formErrors.instanceShortDescription }} +
+
+ +
+ + +
+ {{ formErrors.instanceDescription }} +
+
+ +
+ + +
+ {{ formErrors.instanceTerms }} +
+
+ +
+ +
+ +
+
+ {{ formErrors.instanceDefaultClientRoute }} +
+
+ +
+ + + +
+ +
+
+ {{ formErrors.instanceDefaultNSFWPolicy }} +
+
+ +
Signup
+ +
+ + + + +
+ +
+ + +
+ {{ formErrors.signupLimit }} +
+
+ +
Administrator
+ +
+ + +
+ {{ formErrors.adminEmail }} +
+
+ +
Users
+ +
+ +
+ +
+
+ {{ formErrors.userVideoQuota }} +
+
+
+ + + +
Twitter
+ +
+ + + +
+ {{ formErrors.servicesTwitterUsername }} +
+
+ +
+ + + + + + +
+
+ + + +
Transcoding
+ +
+ + + + +
+ + + +
+ +
+ +
+
+ {{ formErrors.transcodingThreads }} +
+
+ +
+ + + +
+
+ +
Cache
+ +
+ + + + +
+ {{ formErrors.cachePreviewsSize }} +
+
+ +
Customizations
+ +
+ + + +
+ {{ formErrors.customizationJavascript }} +
+
+ +
+ + + +
+ {{ formErrors.customizationCSS }} +
+
+
+
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 2ab371cbb..a1e334a74 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 @@ -8,7 +8,7 @@ import { FormReactive, USER_VIDEO_QUOTA } from '@app/shared' import { ADMIN_EMAIL, CACHE_PREVIEWS_SIZE, - INSTANCE_NAME, INSTANCE_SHORT_DESCRIPTION, + INSTANCE_NAME, INSTANCE_SHORT_DESCRIPTION, SERVICES_TWITTER_USERNAME, SIGNUP_LIMIT, TRANSCODING_THREADS } from '@app/shared/forms/form-validators/custom-config' @@ -49,6 +49,7 @@ export class EditCustomConfigComponent extends FormReactive implements OnInit { instanceTerms: '', instanceDefaultClientRoute: '', instanceDefaultNSFWPolicy: '', + servicesTwitterUsername: '', cachePreviewsSize: '', signupLimit: '', adminEmail: '', @@ -60,6 +61,7 @@ export class EditCustomConfigComponent extends FormReactive implements OnInit { validationMessages = { instanceShortDescription: INSTANCE_SHORT_DESCRIPTION.MESSAGES, instanceName: INSTANCE_NAME.MESSAGES, + servicesTwitterUsername: SERVICES_TWITTER_USERNAME, cachePreviewsSize: CACHE_PREVIEWS_SIZE.MESSAGES, signupLimit: SIGNUP_LIMIT.MESSAGES, adminEmail: ADMIN_EMAIL.MESSAGES, @@ -92,6 +94,8 @@ export class EditCustomConfigComponent extends FormReactive implements OnInit { instanceTerms: [ '' ], instanceDefaultClientRoute: [ '' ], instanceDefaultNSFWPolicy: [ '' ], + servicesTwitterUsername: [ '', SERVICES_TWITTER_USERNAME.VALIDATORS ], + servicesTwitterWhitelisted: [ ], cachePreviewsSize: [ '', CACHE_PREVIEWS_SIZE.VALIDATORS ], signupEnabled: [ ], signupLimit: [ '', SIGNUP_LIMIT.VALIDATORS ], @@ -175,6 +179,12 @@ export class EditCustomConfigComponent extends FormReactive implements OnInit { css: this.form.value['customizationCSS'] } }, + services: { + twitter: { + username: this.form.value['servicesTwitterUsername'], + whitelisted: this.form.value['servicesTwitterWhitelisted'] + } + }, cache: { previews: { size: this.form.value['cachePreviewsSize'] @@ -228,6 +238,8 @@ export class EditCustomConfigComponent extends FormReactive implements OnInit { instanceTerms: this.customConfig.instance.terms, instanceDefaultClientRoute: this.customConfig.instance.defaultClientRoute, instanceDefaultNSFWPolicy: this.customConfig.instance.defaultNSFWPolicy, + servicesTwitterUsername: this.customConfig.services.twitter.username, + servicesTwitterWhitelisted: this.customConfig.services.twitter.whitelisted, cachePreviewsSize: this.customConfig.cache.previews.size, signupEnabled: this.customConfig.signup.enabled, signupLimit: this.customConfig.signup.limit, -- cgit v1.2.3