Project

General

Profile

1
import {Component, OnInit} from '@angular/core';
2
import {Location} from '@angular/common';
3
import {ActivatedRoute} from '@angular/router';
4
import {Title, Meta} from '@angular/platform-browser';
5

    
6
@Component({
7
    selector: 'community-error',
8
    template: `
9
    <div id="tm-main" class=" uk-section  uk-margin-small-top tm-middle"   >
10
      <div uk-grid uk-grid>
11
       <div class="tm-main uk-width-1-1@s uk-width-1-1@m  uk-width-1-1@l uk-row-first ">
12

    
13
        <div class="uk-container">
14
            <h2>
15
                There is no community selected or the requested page is not available at this type of community!
16
            </h2>
17
            <br>
18
            <p>
19
                If you are a community manager, click to manage from user menu.
20
            </p>
21
        </div>
22
      </div>
23
     </div>
24
  </div>
25
    `
26
})
27

    
28
export class CommunityErrorPageComponent implements OnInit {
29
    public page: string;
30

    
31
    constructor (private _location: Location, private _meta: Meta,
32
                 private _title: Title, private route: ActivatedRoute) {
33

    
34
        const title = 'OpenAIRE | Error page';
35

    
36
        this._meta.updateTag({content: title}, "property='og:title'");
37
        this._title.setTitle(title);
38
        this.page = _location.path(true);
39
    }
40

    
41
    ngOnInit() {
42
         this.route.queryParams.subscribe(data => {
43
            this.page = data['page'];
44
            if (!this.page) {
45
              this.page = this._location.path(true);
46
            }
47
          });
48
    }
49
}
(2-2/8)