diff options
Diffstat (limited to 'client/src/app/+about/about-instance/about-instance.component.ts')
-rw-r--r-- | client/src/app/+about/about-instance/about-instance.component.ts | 17 |
1 files changed, 15 insertions, 2 deletions
diff --git a/client/src/app/+about/about-instance/about-instance.component.ts b/client/src/app/+about/about-instance/about-instance.component.ts index 36e7a8e5b..d3ee8a1e4 100644 --- a/client/src/app/+about/about-instance/about-instance.component.ts +++ b/client/src/app/+about/about-instance/about-instance.component.ts | |||
@@ -1,7 +1,9 @@ | |||
1 | import { Component, OnInit } from '@angular/core' | 1 | import { Component, OnInit, ViewChild } from '@angular/core' |
2 | import { Notifier, ServerService } from '@app/core' | 2 | import { Notifier, ServerService } from '@app/core' |
3 | import { MarkdownService } from '@app/videos/shared' | 3 | import { MarkdownService } from '@app/videos/shared' |
4 | import { I18n } from '@ngx-translate/i18n-polyfill' | 4 | import { I18n } from '@ngx-translate/i18n-polyfill' |
5 | import { ContactAdminModalComponent } from '@app/+about/about-instance/contact-admin-modal.component' | ||
6 | import { InstanceService } from '@app/shared/instance/instance.service' | ||
5 | 7 | ||
6 | @Component({ | 8 | @Component({ |
7 | selector: 'my-about-instance', | 9 | selector: 'my-about-instance', |
@@ -9,6 +11,8 @@ import { I18n } from '@ngx-translate/i18n-polyfill' | |||
9 | styleUrls: [ './about-instance.component.scss' ] | 11 | styleUrls: [ './about-instance.component.scss' ] |
10 | }) | 12 | }) |
11 | export class AboutInstanceComponent implements OnInit { | 13 | export class AboutInstanceComponent implements OnInit { |
14 | @ViewChild('contactAdminModal') contactAdminModal: ContactAdminModalComponent | ||
15 | |||
12 | shortDescription = '' | 16 | shortDescription = '' |
13 | descriptionHTML = '' | 17 | descriptionHTML = '' |
14 | termsHTML = '' | 18 | termsHTML = '' |
@@ -16,6 +20,7 @@ export class AboutInstanceComponent implements OnInit { | |||
16 | constructor ( | 20 | constructor ( |
17 | private notifier: Notifier, | 21 | private notifier: Notifier, |
18 | private serverService: ServerService, | 22 | private serverService: ServerService, |
23 | private instanceService: InstanceService, | ||
19 | private markdownService: MarkdownService, | 24 | private markdownService: MarkdownService, |
20 | private i18n: I18n | 25 | private i18n: I18n |
21 | ) {} | 26 | ) {} |
@@ -32,8 +37,12 @@ export class AboutInstanceComponent implements OnInit { | |||
32 | return this.serverService.getConfig().signup.allowed | 37 | return this.serverService.getConfig().signup.allowed |
33 | } | 38 | } |
34 | 39 | ||
40 | get isContactFormEnabled () { | ||
41 | return this.serverService.getConfig().email.enabled && this.serverService.getConfig().contactForm.enabled | ||
42 | } | ||
43 | |||
35 | ngOnInit () { | 44 | ngOnInit () { |
36 | this.serverService.getAbout() | 45 | this.instanceService.getAbout() |
37 | .subscribe( | 46 | .subscribe( |
38 | res => { | 47 | res => { |
39 | this.shortDescription = res.instance.shortDescription | 48 | this.shortDescription = res.instance.shortDescription |
@@ -45,4 +54,8 @@ export class AboutInstanceComponent implements OnInit { | |||
45 | ) | 54 | ) |
46 | } | 55 | } |
47 | 56 | ||
57 | openContactModal () { | ||
58 | return this.contactAdminModal.show() | ||
59 | } | ||
60 | |||
48 | } | 61 | } |