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