aboutsummaryrefslogtreecommitdiffhomepage
path: root/client/src/app/about
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2018-01-31 17:47:36 +0100
committerChocobozzz <me@florianbigard.com>2018-01-31 17:51:04 +0100
commit36f9424ff192b0584a433bc196bced6fcf265808 (patch)
tree35d9fa5c53b228f5e7fc27bcc82854d035e9dde8 /client/src/app/about
parent66b16cafb380012d3eca14e524d86f2450e04069 (diff)
downloadPeerTube-36f9424ff192b0584a433bc196bced6fcf265808.tar.gz
PeerTube-36f9424ff192b0584a433bc196bced6fcf265808.tar.zst
PeerTube-36f9424ff192b0584a433bc196bced6fcf265808.zip
Add about page
Diffstat (limited to 'client/src/app/about')
-rw-r--r--client/src/app/about/about-routing.module.ts23
-rw-r--r--client/src/app/about/about.component.html17
-rw-r--r--client/src/app/about/about.component.scss12
-rw-r--r--client/src/app/about/about.component.ts38
-rw-r--r--client/src/app/about/about.module.ts24
-rw-r--r--client/src/app/about/index.ts3
6 files changed, 117 insertions, 0 deletions
diff --git a/client/src/app/about/about-routing.module.ts b/client/src/app/about/about-routing.module.ts
new file mode 100644
index 000000000..11a650c80
--- /dev/null
+++ b/client/src/app/about/about-routing.module.ts
@@ -0,0 +1,23 @@
1import { NgModule } from '@angular/core'
2import { RouterModule, Routes } from '@angular/router'
3import { MetaGuard } from '@ngx-meta/core'
4import { AboutComponent } from './about.component'
5
6const aboutRoutes: Routes = [
7 {
8 path: 'about',
9 component: AboutComponent,
10 canActivate: [ MetaGuard ],
11 data: {
12 meta: {
13 title: 'About'
14 }
15 }
16 }
17]
18
19@NgModule({
20 imports: [ RouterModule.forChild(aboutRoutes) ],
21 exports: [ RouterModule ]
22})
23export class AboutRoutingModule {}
diff --git a/client/src/app/about/about.component.html b/client/src/app/about/about.component.html
new file mode 100644
index 000000000..c0be53581
--- /dev/null
+++ b/client/src/app/about/about.component.html
@@ -0,0 +1,17 @@
1<div class="margin-content">
2 <div class="title-page title-page-single">
3 Welcome to the {{ instanceName }} instance
4 </div>
5
6 <div class="description">
7 <div class="section-title">Description</div>
8
9 <div [innerHTML]="descriptionHTML"></div>
10 </div>
11
12 <div class="terms">
13 <div class="section-title">Terms</div>
14
15 <div [innerHTML]="termsHTML"></div>
16 </div>
17</div>
diff --git a/client/src/app/about/about.component.scss b/client/src/app/about/about.component.scss
new file mode 100644
index 000000000..dba4df729
--- /dev/null
+++ b/client/src/app/about/about.component.scss
@@ -0,0 +1,12 @@
1@import '_variables';
2@import '_mixins';
3
4.section-title {
5 font-weight: $font-semibold;
6 font-size: 20px;
7 margin-bottom: 5px;
8}
9
10.description {
11 margin-bottom: 30px;
12}
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 @@
1import { Component, OnInit } from '@angular/core'
2import { ServerService } from '@app/core'
3import { MarkdownService } from '@app/videos/shared'
4import { NotificationsService } from 'angular2-notifications'
5
6@Component({
7 selector: 'my-about',
8 templateUrl: './about.component.html',
9 styleUrls: [ './about.component.scss' ]
10})
11
12export 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}
diff --git a/client/src/app/about/about.module.ts b/client/src/app/about/about.module.ts
new file mode 100644
index 000000000..da3163f43
--- /dev/null
+++ b/client/src/app/about/about.module.ts
@@ -0,0 +1,24 @@
1import { NgModule } from '@angular/core'
2
3import { AboutRoutingModule } from './about-routing.module'
4import { AboutComponent } from './about.component'
5import { SharedModule } from '../shared'
6
7@NgModule({
8 imports: [
9 AboutRoutingModule,
10 SharedModule
11 ],
12
13 declarations: [
14 AboutComponent
15 ],
16
17 exports: [
18 AboutComponent
19 ],
20
21 providers: [
22 ]
23})
24export class AboutModule { }
diff --git a/client/src/app/about/index.ts b/client/src/app/about/index.ts
new file mode 100644
index 000000000..218d09801
--- /dev/null
+++ b/client/src/app/about/index.ts
@@ -0,0 +1,3 @@
1export * from './about-routing.module'
2export * from './about.component'
3export * from './about.module'