From 78f912ed5733028ec2bf10c06c19f75b07943be2 Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Wed, 27 Jun 2018 14:21:03 +0200 Subject: Improve P2P & Privacy section --- .../about-instance/about-instance.component.ts | 50 ++++++++++++++++++++++ 1 file changed, 50 insertions(+) create mode 100644 client/src/app/+about/about-instance/about-instance.component.ts (limited to 'client/src/app/+about/about-instance/about-instance.component.ts') diff --git a/client/src/app/+about/about-instance/about-instance.component.ts b/client/src/app/+about/about-instance/about-instance.component.ts new file mode 100644 index 000000000..354f52ce7 --- /dev/null +++ b/client/src/app/+about/about-instance/about-instance.component.ts @@ -0,0 +1,50 @@ +import { Component, OnInit } from '@angular/core' +import { ServerService } from '@app/core' +import { MarkdownService } from '@app/videos/shared' +import { NotificationsService } from 'angular2-notifications' +import { I18n } from '@ngx-translate/i18n-polyfill' + +@Component({ + selector: 'my-about-instance', + templateUrl: './about-instance.component.html', + styleUrls: [ './about-instance.component.scss' ] +}) + +export class AboutInstanceComponent implements OnInit { + shortDescription = '' + descriptionHTML = '' + termsHTML = '' + + constructor ( + private notificationsService: NotificationsService, + private serverService: ServerService, + private markdownService: MarkdownService, + private i18n: I18n + ) {} + + get instanceName () { + return this.serverService.getConfig().instance.name + } + + get userVideoQuota () { + return this.serverService.getConfig().user.videoQuota + } + + get isSignupAllowed () { + return this.serverService.getConfig().signup.allowed + } + + ngOnInit () { + this.serverService.getAbout() + .subscribe( + res => { + this.shortDescription = res.instance.shortDescription + this.descriptionHTML = this.markdownService.textMarkdownToHTML(res.instance.description) + this.termsHTML = this.markdownService.textMarkdownToHTML(res.instance.terms) + }, + + err => this.notificationsService.error(this.i18n('Error getting about from server'), err) + ) + } + +} -- cgit v1.2.3