aboutsummaryrefslogblamecommitdiffhomepage
path: root/client/src/app/about/about.component.ts
blob: 3948d5c46bbb022a40dba6b74c38c14a76609163 (plain) (tree)
1
2
3
4
5
6
7
8
9
10
11
12











                                                             
                       












                                                       



                                                         



                                                        



                                 
                                                               

                                                                                                  

          
                                                                                      



       
import { Component, OnInit } from '@angular/core'
import { ServerService } from '@app/core'
import { MarkdownService } from '@app/videos/shared'
import { NotificationsService } from 'angular2-notifications'

@Component({
  selector: 'my-about',
  templateUrl: './about.component.html',
  styleUrls: [ './about.component.scss' ]
})

export class AboutComponent implements OnInit {
  shortDescription = ''
  descriptionHTML = ''
  termsHTML = ''

  constructor (
    private notificationsService: NotificationsService,
    private serverService: ServerService,
    private markdownService: MarkdownService
  ) {}

  get instanceName () {
    return this.serverService.getConfig().instance.name
  }

  get userVideoQuota () {
    return this.serverService.getConfig().user.videoQuota
  }

  get isSignupAllowed () {
    return this.serverService.getConfig().signup.allowed
  }

  ngOnInit () {
    this.serverService.getAbout()
      .subscribe(
        res => {
          this.shortDescription = res.instance.shortDescription
          this.descriptionHTML = this.markdownService.textMarkdownToHTML(res.instance.description)
          this.termsHTML = this.markdownService.textMarkdownToHTML(res.instance.terms)
        },

        err => this.notificationsService.error('Error getting about from server', err)
      )
  }

}