1
|
import {Component, Input} 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!
|
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 {
|
29
|
public page: string;
|
30
|
|
31
|
constructor (private _location: Location, private _meta: Meta,
|
32
|
private _title: Title, private route: ActivatedRoute) {
|
33
|
|
34
|
var 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
|
//this.page = _router.url;
|
40
|
//this.page = location.href;
|
41
|
}
|
42
|
|
43
|
ngOnInit() {
|
44
|
this.route.queryParams.subscribe(data => {
|
45
|
this.page = data['page'];
|
46
|
if (!this.page) {
|
47
|
this.page = this._location.path(true);
|
48
|
}
|
49
|
});
|
50
|
}
|
51
|
}
|