openaire-library/connect/communityGuard/communityErrorPage.componen...

50 lines
1.4 KiB
TypeScript

import {Component, OnInit} from '@angular/core';
import {Location} from '@angular/common';
import {ActivatedRoute} from '@angular/router';
import {Title, Meta} from '@angular/platform-browser';
@Component({
selector: 'community-error',
template: `
<div id="tm-main" class=" uk-section uk-margin-small-top tm-middle" >
<div uk-grid uk-grid>
<div class="tm-main uk-width-1-1@s uk-width-1-1@m uk-width-1-1@l uk-row-first ">
<div class="uk-container">
<h2>
There is no community selected or the requested page is not available at this type of community!
</h2>
<br>
<p>
If you are a community manager, click to manage from user menu.
</p>
</div>
</div>
</div>
</div>
`
})
export class CommunityErrorPageComponent implements OnInit {
public page: string;
constructor (private _location: Location, private _meta: Meta,
private _title: Title, private route: ActivatedRoute) {
const title = 'OpenAIRE | Error page';
this._meta.updateTag({content: title}, "property='og:title'");
this._title.setTitle(title);
this.page = _location.path(true);
}
ngOnInit() {
this.route.queryParams.subscribe(data => {
this.page = data['page'];
if (!this.page) {
this.page = this._location.path(true);
}
});
}
}