]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blob - client/src/app/about/about.component.ts
Prepare i18n files
[github/Chocobozzz/PeerTube.git] / client / src / app / about / about.component.ts
1 import { Component, OnInit } from '@angular/core'
2 import { ServerService } from '@app/core'
3 import { MarkdownService } from '@app/videos/shared'
4 import { NotificationsService } from 'angular2-notifications'
5
6 @Component({
7 selector: 'my-about',
8 templateUrl: './about.component.html',
9 styleUrls: [ './about.component.scss' ]
10 })
11
12 export class AboutComponent implements OnInit {
13 shortDescription = ''
14 descriptionHTML = ''
15 termsHTML = ''
16
17 constructor (
18 private notificationsService: NotificationsService,
19 private serverService: ServerService,
20 private markdownService: MarkdownService
21 ) {}
22
23 get instanceName () {
24 return this.serverService.getConfig().instance.name
25 }
26
27 get userVideoQuota () {
28 return this.serverService.getConfig().user.videoQuota
29 }
30
31 get isSignupAllowed () {
32 return this.serverService.getConfig().signup.allowed
33 }
34
35 ngOnInit () {
36 this.serverService.getAbout()
37 .subscribe(
38 res => {
39 this.shortDescription = res.instance.shortDescription
40 this.descriptionHTML = this.markdownService.textMarkdownToHTML(res.instance.description)
41 this.termsHTML = this.markdownService.textMarkdownToHTML(res.instance.terms)
42 },
43
44 err => this.notificationsService.error('Error getting about from server', err)
45 )
46 }
47
48 }