From c8000975d361fae166a6ebecac5005238e14d4c9 Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Thu, 21 Feb 2019 15:44:12 +0100 Subject: Add NSFW info in about page --- .../app/+about/about-instance/about-instance.component.html | 2 ++ .../app/+about/about-instance/about-instance.component.scss | 5 +++++ .../src/app/+about/about-instance/about-instance.component.ts | 4 ++++ .../app/shared/instance/instance-features-table.component.html | 6 ++++++ .../app/shared/instance/instance-features-table.component.ts | 10 +++++++++- 5 files changed, 26 insertions(+), 1 deletion(-) (limited to 'client/src/app') 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 @@
{{ shortDescription }}
+ +
This instance is dedicated to sensitive/NSFW content.
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 @@ .short-description, .description, .terms, .signup { margin-bottom: 30px; } + +.short-description .dedicated-to-nsfw { + margin-top: 20px; + font-weight: $font-semibold; +} 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 { return this.serverService.getConfig().email.enabled && this.serverService.getConfig().contactForm.enabled } + get isNSFW () { + return this.serverService.getConfig().instance.isNSFW + } + ngOnInit () { this.instanceService.getAbout() .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 @@
+ + + + + +
Default NSFW/sensitive videos policy (can be redefined by the users){{ buildNSFWLabel() }}
{{ feature.label }} 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 @@ import { Component, OnInit } from '@angular/core' import { ServerService } from '@app/core' import { I18n } from '@ngx-translate/i18n-polyfill' +import { ServerConfig } from '../../../../../shared' @Component({ selector: 'my-instance-features-table', @@ -33,6 +34,14 @@ export class InstanceFeaturesTableComponent implements OnInit { }) } + buildNSFWLabel () { + const policy = this.serverService.getConfig().instance.defaultNSFWPolicy + + if (policy === 'do_not_list') return this.i18n('Hidden') + if (policy === 'blur') return this.i18n('Blurred with confirmation request') + if (policy === 'display') return this.i18n('Displayed') + } + private buildFeatures () { const config = this.serverService.getConfig() @@ -87,5 +96,4 @@ export class InstanceFeaturesTableComponent implements OnInit { this.quotaHelpIndication = lines.join('
') } - } -- cgit v1.2.3