aboutsummaryrefslogtreecommitdiffhomepage
path: root/client
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2019-02-20 15:36:43 +0100
committerChocobozzz <me@florianbigard.com>2019-02-20 15:36:43 +0100
commitf8802489bbc2c0363b5668e47de7c35f573342e1 (patch)
tree526054fad5a7f944b008ac1a6e400dfbe66a1639 /client
parent1aabcae7e36bb113c2887bd7180dad2916ecaaf2 (diff)
downloadPeerTube-f8802489bbc2c0363b5668e47de7c35f573342e1.tar.gz
PeerTube-f8802489bbc2c0363b5668e47de7c35f573342e1.tar.zst
PeerTube-f8802489bbc2c0363b5668e47de7c35f573342e1.zip
Add isNSFW instance configuration key
Diffstat (limited to 'client')
-rw-r--r--client/src/app/+admin/config/edit-custom-config/edit-custom-config.component.html9
-rw-r--r--client/src/app/+admin/config/edit-custom-config/edit-custom-config.component.ts1
-rw-r--r--client/src/app/core/server/server.service.ts2
-rw-r--r--client/src/app/videos/+video-edit/video-add-components/video-upload.component.ts2
4 files changed, 12 insertions, 2 deletions
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 52eb00d93..b7d95bc22 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
@@ -45,6 +45,15 @@
45 </div> 45 </div>
46 46
47 <div class="form-group"> 47 <div class="form-group">
48 <my-peertube-checkbox
49 inputName="instanceIsNSFW" formControlName="isNSFW"
50 i18n-labelText labelText="Dedicated to sensitive or NSFW content"
51 i18n-helpHtml helpHtml="Enabling it will allow other administrators to know that you are mainly federating sensitive content.<br /><br />
52 Moreover, the NSFW checkbox on video upload will be automatically checked by default."
53 ></my-peertube-checkbox>
54 </div>
55
56 <div class="form-group">
48 <label i18n for="instanceDefaultClientRoute">Default client route</label> 57 <label i18n for="instanceDefaultClientRoute">Default client route</label>
49 <div class="peertube-select-container"> 58 <div class="peertube-select-container">
50 <select id="instanceDefaultClientRoute" formControlName="defaultClientRoute"> 59 <select id="instanceDefaultClientRoute" formControlName="defaultClientRoute">
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 654a076b0..45605e0fe 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
@@ -66,6 +66,7 @@ export class EditCustomConfigComponent extends FormReactive implements OnInit {
66 description: null, 66 description: null,
67 terms: null, 67 terms: null,
68 defaultClientRoute: null, 68 defaultClientRoute: null,
69 isNSFW: false,
69 defaultNSFWPolicy: null, 70 defaultNSFWPolicy: null,
70 customizations: { 71 customizations: {
71 javascript: null, 72 javascript: null,
diff --git a/client/src/app/core/server/server.service.ts b/client/src/app/core/server/server.service.ts
index c868ccdcc..10acf6e72 100644
--- a/client/src/app/core/server/server.service.ts
+++ b/client/src/app/core/server/server.service.ts
@@ -4,7 +4,6 @@ import { Inject, Injectable, LOCALE_ID } from '@angular/core'
4import { peertubeLocalStorage } from '@app/shared/misc/peertube-local-storage' 4import { peertubeLocalStorage } from '@app/shared/misc/peertube-local-storage'
5import { Observable, of, ReplaySubject } from 'rxjs' 5import { Observable, of, ReplaySubject } from 'rxjs'
6import { getCompleteLocale, ServerConfig } from '../../../../../shared' 6import { getCompleteLocale, ServerConfig } from '../../../../../shared'
7import { About } from '../../../../../shared/models/server/about.model'
8import { environment } from '../../../environments/environment' 7import { environment } from '../../../environments/environment'
9import { VideoConstant, VideoPrivacy } from '../../../../../shared/models/videos' 8import { VideoConstant, VideoPrivacy } from '../../../../../shared/models/videos'
10import { isDefaultLocale, peertubeTranslate } from '../../../../../shared/models/i18n' 9import { isDefaultLocale, peertubeTranslate } from '../../../../../shared/models/i18n'
@@ -32,6 +31,7 @@ export class ServerService {
32 shortDescription: 'PeerTube, a federated (ActivityPub) video streaming platform ' + 31 shortDescription: 'PeerTube, a federated (ActivityPub) video streaming platform ' +
33 'using P2P (BitTorrent) directly in the web browser with WebTorrent and Angular.', 32 'using P2P (BitTorrent) directly in the web browser with WebTorrent and Angular.',
34 defaultClientRoute: '', 33 defaultClientRoute: '',
34 isNSFW: false,
35 defaultNSFWPolicy: 'do_not_list' as 'do_not_list', 35 defaultNSFWPolicy: 'do_not_list' as 'do_not_list',
36 customizations: { 36 customizations: {
37 javascript: '', 37 javascript: '',
diff --git a/client/src/app/videos/+video-edit/video-add-components/video-upload.component.ts b/client/src/app/videos/+video-edit/video-add-components/video-upload.component.ts
index 9cadf52cb..7399f39ee 100644
--- a/client/src/app/videos/+video-edit/video-add-components/video-upload.component.ts
+++ b/client/src/app/videos/+video-edit/video-add-components/video-upload.component.ts
@@ -163,7 +163,7 @@ export class VideoUploadComponent extends VideoSend implements OnInit, OnDestroy
163 } 163 }
164 164
165 const privacy = this.firstStepPrivacyId.toString() 165 const privacy = this.firstStepPrivacyId.toString()
166 const nsfw = false 166 const nsfw = this.serverService.getConfig().instance.isNSFW
167 const waitTranscoding = true 167 const waitTranscoding = true
168 const commentsEnabled = true 168 const commentsEnabled = true
169 const downloadEnabled = true 169 const downloadEnabled = true