]>
Commit | Line | Data |
---|---|---|
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 | descriptionHTML = '' | |
14 | termsHTML = '' | |
15 | ||
16 | constructor ( | |
17 | private notificationsService: NotificationsService, | |
18 | private serverService: ServerService, | |
19 | private markdownService: MarkdownService | |
20 | ) {} | |
21 | ||
22 | get instanceName () { | |
23 | return this.serverService.getConfig().instance.name | |
24 | } | |
25 | ||
26 | get userVideoQuota () { | |
27 | return this.serverService.getConfig().user.videoQuota | |
28 | } | |
29 | ||
30 | get isSignupAllowed () { | |
31 | return this.serverService.getConfig().signup.allowed | |
32 | } | |
33 | ||
34 | ngOnInit () { | |
35 | this.serverService.getAbout() | |
36 | .subscribe( | |
37 | res => { | |
38 | this.descriptionHTML = this.markdownService.textMarkdownToHTML(res.instance.description) | |
39 | this.termsHTML = this.markdownService.textMarkdownToHTML(res.instance.terms) | |
40 | }, | |
41 | ||
42 | err => this.notificationsService.error('Error getting about from server', err) | |
43 | ) | |
44 | } | |
45 | ||
46 | } |