]>
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' | |
b1d40cff | 5 | import { I18n } from '@ngx-translate/i18n-polyfill' |
36f9424f C |
6 | |
7 | @Component({ | |
78f912ed C |
8 | selector: 'my-about-instance', |
9 | templateUrl: './about-instance.component.html', | |
10 | styleUrls: [ './about-instance.component.scss' ] | |
36f9424f C |
11 | }) |
12 | ||
78f912ed | 13 | export class AboutInstanceComponent 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 | } |