]>
Commit | Line | Data |
---|---|---|
36f9424f C |
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 { | |
45c0fb35 | 13 | shortDescription = '' |
36f9424f C |
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 | ||
1869c875 RK |
27 | get userVideoQuota () { |
28 | return this.serverService.getConfig().user.videoQuota | |
29 | } | |
30 | ||
be1fc4bc C |
31 | get isSignupAllowed () { |
32 | return this.serverService.getConfig().signup.allowed | |
33 | } | |
34 | ||
36f9424f C |
35 | ngOnInit () { |
36 | this.serverService.getAbout() | |
37 | .subscribe( | |
38 | res => { | |
45c0fb35 | 39 | this.shortDescription = res.instance.shortDescription |
07fa4c97 C |
40 | this.descriptionHTML = this.markdownService.textMarkdownToHTML(res.instance.description) |
41 | this.termsHTML = this.markdownService.textMarkdownToHTML(res.instance.terms) | |
36f9424f C |
42 | }, |
43 | ||
1869c875 | 44 | err => this.notificationsService.error('Error getting about from server', err) |
36f9424f C |
45 | ) |
46 | } | |
47 | ||
48 | } |