aboutsummaryrefslogtreecommitdiffhomepage
path: root/client
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2019-02-21 15:44:12 +0100
committerChocobozzz <me@florianbigard.com>2019-02-21 15:51:28 +0100
commitc8000975d361fae166a6ebecac5005238e14d4c9 (patch)
tree67d7da38abc6c4d9ceb4d120088d499309f69e30 /client
parente359e88b08476041c3c52db02fb3ca4e5ee296ea (diff)
downloadPeerTube-c8000975d361fae166a6ebecac5005238e14d4c9.tar.gz
PeerTube-c8000975d361fae166a6ebecac5005238e14d4c9.tar.zst
PeerTube-c8000975d361fae166a6ebecac5005238e14d4c9.zip
Add NSFW info in about page
Diffstat (limited to 'client')
-rw-r--r--client/src/app/+about/about-instance/about-instance.component.html2
-rw-r--r--client/src/app/+about/about-instance/about-instance.component.scss5
-rw-r--r--client/src/app/+about/about-instance/about-instance.component.ts4
-rw-r--r--client/src/app/shared/instance/instance-features-table.component.html6
-rw-r--r--client/src/app/shared/instance/instance-features-table.component.ts10
5 files changed, 26 insertions, 1 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 83376b6f6..7c27ec760 100644
--- a/client/src/app/+about/about-instance/about-instance.component.html
+++ b/client/src/app/+about/about-instance/about-instance.component.html
@@ -8,6 +8,8 @@
8 8
9 <div class="short-description"> 9 <div class="short-description">
10 <div>{{ shortDescription }}</div> 10 <div>{{ shortDescription }}</div>
11
12 <div *ngIf="isNSFW" class="dedicated-to-nsfw">This instance is dedicated to sensitive/NSFW content.</div>
11 </div> 13 </div>
12 14
13 <div class="description"> 15 <div class="description">
diff --git a/client/src/app/+about/about-instance/about-instance.component.scss b/client/src/app/+about/about-instance/about-instance.component.scss
index 75cf57322..3aba7fe42 100644
--- a/client/src/app/+about/about-instance/about-instance.component.scss
+++ b/client/src/app/+about/about-instance/about-instance.component.scss
@@ -26,3 +26,8 @@
26.short-description, .description, .terms, .signup { 26.short-description, .description, .terms, .signup {
27 margin-bottom: 30px; 27 margin-bottom: 30px;
28} 28}
29
30.short-description .dedicated-to-nsfw {
31 margin-top: 20px;
32 font-weight: $font-semibold;
33}
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 c9eab44ab..4a63f5e38 100644
--- a/client/src/app/+about/about-instance/about-instance.component.ts
+++ b/client/src/app/+about/about-instance/about-instance.component.ts
@@ -33,6 +33,10 @@ export class AboutInstanceComponent implements OnInit {
33 return this.serverService.getConfig().email.enabled && this.serverService.getConfig().contactForm.enabled 33 return this.serverService.getConfig().email.enabled && this.serverService.getConfig().contactForm.enabled
34 } 34 }
35 35
36 get isNSFW () {
37 return this.serverService.getConfig().instance.isNSFW
38 }
39
36 ngOnInit () { 40 ngOnInit () {
37 this.instanceService.getAbout() 41 this.instanceService.getAbout()
38 .subscribe( 42 .subscribe(
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 90046f409..2885f97e3 100644
--- a/client/src/app/shared/instance/instance-features-table.component.html
+++ b/client/src/app/shared/instance/instance-features-table.component.html
@@ -1,6 +1,12 @@
1<div class="feature-table"> 1<div class="feature-table">
2 2
3 <table class="table"> 3 <table class="table">
4 <tr>
5 <td i18n class="label">Default NSFW/sensitive videos policy (can be redefined by the users)</td>
6
7 <td class="value">{{ buildNSFWLabel() }}</td>
8 </tr>
9
4 <tr *ngFor="let feature of features"> 10 <tr *ngFor="let feature of features">
5 <td class="label">{{ feature.label }}</td> 11 <td class="label">{{ feature.label }}</td>
6 <td> 12 <td>
diff --git a/client/src/app/shared/instance/instance-features-table.component.ts b/client/src/app/shared/instance/instance-features-table.component.ts
index aaf0a6960..a4924a0d5 100644
--- a/client/src/app/shared/instance/instance-features-table.component.ts
+++ b/client/src/app/shared/instance/instance-features-table.component.ts
@@ -1,6 +1,7 @@
1import { Component, OnInit } from '@angular/core' 1import { Component, OnInit } from '@angular/core'
2import { ServerService } from '@app/core' 2import { ServerService } from '@app/core'
3import { I18n } from '@ngx-translate/i18n-polyfill' 3import { I18n } from '@ngx-translate/i18n-polyfill'
4import { ServerConfig } from '../../../../../shared'
4 5
5@Component({ 6@Component({
6 selector: 'my-instance-features-table', 7 selector: 'my-instance-features-table',
@@ -33,6 +34,14 @@ export class InstanceFeaturesTableComponent implements OnInit {
33 }) 34 })
34 } 35 }
35 36
37 buildNSFWLabel () {
38 const policy = this.serverService.getConfig().instance.defaultNSFWPolicy
39
40 if (policy === 'do_not_list') return this.i18n('Hidden')
41 if (policy === 'blur') return this.i18n('Blurred with confirmation request')
42 if (policy === 'display') return this.i18n('Displayed')
43 }
44
36 private buildFeatures () { 45 private buildFeatures () {
37 const config = this.serverService.getConfig() 46 const config = this.serverService.getConfig()
38 47
@@ -87,5 +96,4 @@ export class InstanceFeaturesTableComponent implements OnInit {
87 96
88 this.quotaHelpIndication = lines.join('<br />') 97 this.quotaHelpIndication = lines.join('<br />')
89 } 98 }
90
91} 99}