diff options
author | Chocobozzz <me@florianbigard.com> | 2018-01-31 17:47:36 +0100 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2018-01-31 17:51:04 +0100 |
commit | 36f9424ff192b0584a433bc196bced6fcf265808 (patch) | |
tree | 35d9fa5c53b228f5e7fc27bcc82854d035e9dde8 /client/src/app/about/about.component.ts | |
parent | 66b16cafb380012d3eca14e524d86f2450e04069 (diff) | |
download | PeerTube-36f9424ff192b0584a433bc196bced6fcf265808.tar.gz PeerTube-36f9424ff192b0584a433bc196bced6fcf265808.tar.zst PeerTube-36f9424ff192b0584a433bc196bced6fcf265808.zip |
Add about page
Diffstat (limited to 'client/src/app/about/about.component.ts')
-rw-r--r-- | client/src/app/about/about.component.ts | 38 |
1 files changed, 38 insertions, 0 deletions
diff --git a/client/src/app/about/about.component.ts b/client/src/app/about/about.component.ts new file mode 100644 index 000000000..6a2e59be1 --- /dev/null +++ b/client/src/app/about/about.component.ts | |||
@@ -0,0 +1,38 @@ | |||
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 | ngOnInit () { | ||
27 | this.serverService.getAbout() | ||
28 | .subscribe( | ||
29 | res => { | ||
30 | this.descriptionHTML = this.markdownService.markdownToHTML(res.instance.description) | ||
31 | this.termsHTML = this.markdownService.markdownToHTML(res.instance.terms) | ||
32 | }, | ||
33 | |||
34 | err => this.notificationsService.error('Error', err) | ||
35 | ) | ||
36 | } | ||
37 | |||
38 | } | ||