diff options
author | Chocobozzz <me@florianbigard.com> | 2018-06-27 14:21:03 +0200 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2018-06-27 14:59:09 +0200 |
commit | 78f912ed5733028ec2bf10c06c19f75b07943be2 (patch) | |
tree | 4bf9692230deabc4e050e5a7de126b38901969e9 /client/src/app/+about/about-instance | |
parent | 61b909b9bf849516f30dab2bf5977acfbbddc5c6 (diff) | |
download | PeerTube-78f912ed5733028ec2bf10c06c19f75b07943be2.tar.gz PeerTube-78f912ed5733028ec2bf10c06c19f75b07943be2.tar.zst PeerTube-78f912ed5733028ec2bf10c06c19f75b07943be2.zip |
Improve P2P & Privacy section
Diffstat (limited to 'client/src/app/+about/about-instance')
3 files changed, 107 insertions, 0 deletions
diff --git a/client/src/app/+about/about-instance/about-instance.component.html b/client/src/app/+about/about-instance/about-instance.component.html new file mode 100644 index 000000000..e433b0016 --- /dev/null +++ b/client/src/app/+about/about-instance/about-instance.component.html | |||
@@ -0,0 +1,39 @@ | |||
1 | <div i18n class="about-instance-title"> | ||
2 | About {{ instanceName }} instance | ||
3 | </div> | ||
4 | |||
5 | <div class="short-description"> | ||
6 | <div>{{ shortDescription }}</div> | ||
7 | </div> | ||
8 | |||
9 | <div class="description"> | ||
10 | <div i18n class="section-title">Description</div> | ||
11 | |||
12 | <div [innerHTML]="descriptionHTML"></div> | ||
13 | </div> | ||
14 | |||
15 | <div class="terms"> | ||
16 | <div i18n class="section-title">Terms</div> | ||
17 | |||
18 | <div [innerHTML]="termsHTML"></div> | ||
19 | </div> | ||
20 | |||
21 | <div class="signup"> | ||
22 | <div i18n class="section-title">Signup</div> | ||
23 | |||
24 | <div *ngIf="isSignupAllowed"> | ||
25 | <ng-container i18n>User registration is allowed and</ng-container> | ||
26 | |||
27 | <ng-container i18n *ngIf="userVideoQuota !== -1"> | ||
28 | this instance provides a baseline quota of {{ userVideoQuota | bytes: 0 }} space for the videos of its users. | ||
29 | </ng-container> | ||
30 | |||
31 | <ng-container i18n *ngIf="userVideoQuota === -1"> | ||
32 | this instance provides unlimited space for the videos of its users. | ||
33 | </ng-container> | ||
34 | </div> | ||
35 | |||
36 | <div i18n *ngIf="isSignupAllowed === false"> | ||
37 | User registration is currently not allowed. | ||
38 | </div> | ||
39 | </div> \ No newline at end of file | ||
diff --git a/client/src/app/+about/about-instance/about-instance.component.scss b/client/src/app/+about/about-instance/about-instance.component.scss new file mode 100644 index 000000000..b451e85aa --- /dev/null +++ b/client/src/app/+about/about-instance/about-instance.component.scss | |||
@@ -0,0 +1,18 @@ | |||
1 | @import '_variables'; | ||
2 | @import '_mixins'; | ||
3 | |||
4 | .about-instance-title { | ||
5 | font-size: 20px; | ||
6 | font-weight: bold; | ||
7 | margin-bottom: 15px; | ||
8 | } | ||
9 | |||
10 | .section-title { | ||
11 | font-weight: $font-semibold; | ||
12 | font-size: 20px; | ||
13 | margin-bottom: 5px; | ||
14 | } | ||
15 | |||
16 | .short-description, .description, .terms, .signup { | ||
17 | margin-bottom: 30px; | ||
18 | } | ||
diff --git a/client/src/app/+about/about-instance/about-instance.component.ts b/client/src/app/+about/about-instance/about-instance.component.ts new file mode 100644 index 000000000..354f52ce7 --- /dev/null +++ b/client/src/app/+about/about-instance/about-instance.component.ts | |||
@@ -0,0 +1,50 @@ | |||
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 | import { I18n } from '@ngx-translate/i18n-polyfill' | ||
6 | |||
7 | @Component({ | ||
8 | selector: 'my-about-instance', | ||
9 | templateUrl: './about-instance.component.html', | ||
10 | styleUrls: [ './about-instance.component.scss' ] | ||
11 | }) | ||
12 | |||
13 | export class AboutInstanceComponent implements OnInit { | ||
14 | shortDescription = '' | ||
15 | descriptionHTML = '' | ||
16 | termsHTML = '' | ||
17 | |||
18 | constructor ( | ||
19 | private notificationsService: NotificationsService, | ||
20 | private serverService: ServerService, | ||
21 | private markdownService: MarkdownService, | ||
22 | private i18n: I18n | ||
23 | ) {} | ||
24 | |||
25 | get instanceName () { | ||
26 | return this.serverService.getConfig().instance.name | ||
27 | } | ||
28 | |||
29 | get userVideoQuota () { | ||
30 | return this.serverService.getConfig().user.videoQuota | ||
31 | } | ||
32 | |||
33 | get isSignupAllowed () { | ||
34 | return this.serverService.getConfig().signup.allowed | ||
35 | } | ||
36 | |||
37 | ngOnInit () { | ||
38 | this.serverService.getAbout() | ||
39 | .subscribe( | ||
40 | res => { | ||
41 | this.shortDescription = res.instance.shortDescription | ||
42 | this.descriptionHTML = this.markdownService.textMarkdownToHTML(res.instance.description) | ||
43 | this.termsHTML = this.markdownService.textMarkdownToHTML(res.instance.terms) | ||
44 | }, | ||
45 | |||
46 | err => this.notificationsService.error(this.i18n('Error getting about from server'), err) | ||
47 | ) | ||
48 | } | ||
49 | |||
50 | } | ||