Add twitter tab on community page - development only
This commit is contained in:
parent
57b662809f
commit
66ccc04808
|
@ -536,6 +536,15 @@
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</ng-template>
|
</ng-template>
|
||||||
|
<ng-template #twitter_tab *ngIf="properties.environment == 'development'">
|
||||||
|
<div>
|
||||||
|
<div>
|
||||||
|
<a href="https://twitter.com/{{ communityInfo.twitterAccount }}?ref_src=twsrc%5Etfw" class="twitter-timeline" data-height="900">
|
||||||
|
Tweets by {{ communityInfo.twitterAccount }}
|
||||||
|
</a>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</ng-template>
|
||||||
<my-tabs (selectedActiveTab)="onSelectActiveTab($event)">
|
<my-tabs (selectedActiveTab)="onSelectActiveTab($event)">
|
||||||
<my-tab
|
<my-tab
|
||||||
[tabTitle]="'Summary'" [tabId]="'summary'" class="uk-active">
|
[tabTitle]="'Summary'" [tabId]="'summary'" class="uk-active">
|
||||||
|
@ -572,6 +581,9 @@
|
||||||
[tabTitle]="'Featured datasets'" [tabId]="'enermaps'" [tabNumber]="fetchFeaturedDatasets.searchUtils.totalResults">
|
[tabTitle]="'Featured datasets'" [tabId]="'enermaps'" [tabNumber]="fetchFeaturedDatasets.searchUtils.totalResults">
|
||||||
<ng-container *ngTemplateOutlet="enermaps_tab;"></ng-container>
|
<ng-container *ngTemplateOutlet="enermaps_tab;"></ng-container>
|
||||||
</my-tab>
|
</my-tab>
|
||||||
|
<my-tab *ngIf="properties.environment == 'development' && communityInfo.twitterAccount" [tabTitle]="'Twitter'" [tabId]="'twitter'">
|
||||||
|
<ng-container *ngTemplateOutlet="twitter_tab;"></ng-container>
|
||||||
|
</my-tab>
|
||||||
</my-tabs>
|
</my-tabs>
|
||||||
|
|
||||||
<my-small-tabs (selectedActiveTab)="onSelectActiveTab($event)">
|
<my-small-tabs (selectedActiveTab)="onSelectActiveTab($event)">
|
||||||
|
@ -610,6 +622,9 @@
|
||||||
[tabTitle]="'Featured datasets'" [tabId]="'enermaps'" [tabNumber]="fetchFeaturedDatasets.searchUtils.totalResults">
|
[tabTitle]="'Featured datasets'" [tabId]="'enermaps'" [tabNumber]="fetchFeaturedDatasets.searchUtils.totalResults">
|
||||||
<ng-container *ngTemplateOutlet="enermaps_tab;"></ng-container>
|
<ng-container *ngTemplateOutlet="enermaps_tab;"></ng-container>
|
||||||
</my-tab>
|
</my-tab>
|
||||||
|
<my-tab *ngIf="properties.environment == 'development' && communityInfo.twitterAccount" [tabTitle]="'Twitter'" [tabId]="'twitter'">
|
||||||
|
<ng-container *ngTemplateOutlet="twitter_tab;"></ng-container>
|
||||||
|
</my-tab>
|
||||||
</my-small-tabs>
|
</my-small-tabs>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
import {Component, ElementRef, Input, ViewChild} from '@angular/core';
|
import {Component, ElementRef, Inject, Input, Renderer2, ViewChild} from '@angular/core';
|
||||||
import {ActivatedRoute, Router} from '@angular/router';
|
import {ActivatedRoute, Router} from '@angular/router';
|
||||||
import {Location} from '@angular/common';
|
import {DOCUMENT, Location} from '@angular/common';
|
||||||
import {Meta, Title} from '@angular/platform-browser';
|
import {Meta, Title} from '@angular/platform-browser';
|
||||||
import {EnvProperties} from '../openaireLibrary/utils/properties/env-properties';
|
import {EnvProperties} from '../openaireLibrary/utils/properties/env-properties';
|
||||||
|
|
||||||
|
@ -120,7 +120,9 @@ export class CommunityComponent {
|
||||||
private _searchZenodoCommunitiesService: SearchZenodoCommunitiesService,
|
private _searchZenodoCommunitiesService: SearchZenodoCommunitiesService,
|
||||||
private _zenodoCommunitieService: ZenodoCommunitiesService,
|
private _zenodoCommunitieService: ZenodoCommunitiesService,
|
||||||
private seoService: SEOService,
|
private seoService: SEOService,
|
||||||
private userManagementService: UserManagementService) {
|
private userManagementService: UserManagementService,
|
||||||
|
private _renderer2: Renderer2,
|
||||||
|
@Inject(DOCUMENT) private _document: Document) {
|
||||||
|
|
||||||
var description = "OpenAIRE - Connect, Community Dashboard, research community";
|
var description = "OpenAIRE - Connect, Community Dashboard, research community";
|
||||||
var title = "OpenAIRE - Connect";
|
var title = "OpenAIRE - Connect";
|
||||||
|
@ -230,6 +232,16 @@ export class CommunityComponent {
|
||||||
this.handleError("Error getting community with id: " + this.communityId, error);
|
this.handleError("Error getting community with id: " + this.communityId, error);
|
||||||
}
|
}
|
||||||
));
|
));
|
||||||
|
|
||||||
|
// loading twitter widget script conditionally
|
||||||
|
if(properties.environment == "development") {
|
||||||
|
if(this.communityInfo.twitterAccount) {
|
||||||
|
let script = this._renderer2.createElement('script');
|
||||||
|
script.charset = "utf-8";
|
||||||
|
script.src = "https://platform.twitter.com/widgets.js";
|
||||||
|
this._renderer2.appendChild(this._document.body, script);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private searchPublications(page: number, size: number) {
|
private searchPublications(page: number, size: number) {
|
||||||
|
|
|
@ -1 +1 @@
|
||||||
Subproject commit 64051887ce031b36d74349496912e5c337801c15
|
Subproject commit 0b85dfba03e2db942dcbf3b68b453c757f70cbf9
|
Loading…
Reference in New Issue