[Connect | Trunk]
- Update affiliations layout - Use customization class to create the css - Create preview/ demo component - Clean up piwik helper file - updates on customization css git-svn-id: https://svn.driver.research-infrastructures.eu/driver/dnet40/modules/uoa-connect-portal/trunk@60892 d315682c-612b-4755-9ff5-7f18f6832af3
This commit is contained in:
parent
60f54a0574
commit
dccb5c0b03
|
@ -66,13 +66,13 @@ app.set('view engine', 'html');
|
|||
app.set('views', join(DIST_FOLDER, 'browser'));
|
||||
// Allow frames from specific domains
|
||||
app.use(function (req, res, next) {
|
||||
var XFRAME_WHITELIST = [ 'http://scoobydoo.di.uoa.gr:5000/customize-layout', 'https://beta.admin.connect.openaire.eu/customize-layout','https://admin.connect.openaire.eu/customize-layout' ];
|
||||
var XFRAME_WHITELIST = [ 'http://spitoo.di.uoa.gr:5000/','http://scoobydoo.di.uoa.gr:5000/', 'https://beta.admin.connect.openaire.eu/','https://admin.connect.openaire.eu/' ];
|
||||
let referer: string;
|
||||
if(req.headers.referer){
|
||||
referer = isArray(req.headers.referer)?req.headers.referer[0]:(<string>req.headers.referer);
|
||||
referer = referer.split("?")[0];
|
||||
}
|
||||
if ( referer && (XFRAME_WHITELIST.indexOf(referer) != -1 || referer.indexOf(".d4science.org") != -1)) {
|
||||
if ( referer && (XFRAME_WHITELIST.indexOf(referer) != -1 || referer.indexOf("/customize-layout") !=-1 || referer.indexOf(".d4science.org") != -1)) {
|
||||
// res.header('X-FRAME-OPTIONS', 'allow from ' +req.headers.referer);
|
||||
}else {
|
||||
res.header('X-FRAME-OPTIONS', 'SAMEORIGIN');
|
||||
|
|
|
@ -2,8 +2,8 @@
|
|||
|
||||
<ng-template #card let-organization="organization" let-fullView="fullView">
|
||||
<div class="affiliation-logo uk-flex uk-flex-middle uk-flex-center uk-padding-remove-horizontal"
|
||||
[ngClass]="(!fullView)?'uk-card-body':'uk-card-media-top uk-padding-small'">
|
||||
<div class="uk-align-center">
|
||||
[ngClass]="(!fullView)?'':'uk-card-media-top uk-padding-small'">
|
||||
<div class="uk-align-center uk-margin-remove-bottom">
|
||||
<img *ngIf="organization.logo_url != null && organization.logo_url != '' "
|
||||
[src]="organization.logo_url | urlPrefix"
|
||||
alt="{{(organization.name)?organization.name:''}} logo">
|
||||
|
@ -52,38 +52,40 @@
|
|||
<!-- ({{affiliations.length}})-->
|
||||
</h3>
|
||||
|
||||
<div *ngIf="!longView" [class]="'uk-position-relative uk-visible-toggle'" tabindex="-1"
|
||||
<div *ngIf="!longView"
|
||||
[attr.uk-slider]="sliderOptions">
|
||||
<div
|
||||
[class]="'uk-align-center uk-width-'+(affiliations.length >= affiliationsInSlider ? affiliationsInSlider : affiliations.length)+'-'+affiliationsInSlider">
|
||||
<ul class="uk-slider-items uk-grid-small" uk-height-match="target: > li > .affiliation" uk-grid>
|
||||
<li *ngFor="let affiliation of affiliations"
|
||||
[class]="'affiliation-element uk-width-1-'+(affiliations.length >= affiliationsInSlider ? affiliationsInSlider : affiliations.length)">
|
||||
<div class="affiliation uk-flex uk-flex-middle uk-flex-center uk-padding-small"
|
||||
[attr.uk-tooltip]="(affiliation.name) ? affiliation.name : 'cls: uk-invisible'">
|
||||
<a *ngIf="affiliation.website_url" target="_blank" [href]="affiliation.website_url | urlPrefix"
|
||||
class="affiliation-content">
|
||||
<ng-container
|
||||
*ngTemplateOutlet="card; context: { organization: affiliation, fullView: false}"></ng-container>
|
||||
</a>
|
||||
<span *ngIf="!affiliation.website_url" class="affiliation-content">
|
||||
<ng-container *ngTemplateOutlet="card; context: { organization: affiliation}"></ng-container>
|
||||
</span>
|
||||
</div>
|
||||
</li>
|
||||
</ul>
|
||||
<div [class]="'uk-position-relative uk-visible-toggle'" tabindex="-1">
|
||||
<div class="uk-slider-container uk-padding-small uk-margin-remove-bottom uk-align-center uk-width-1-1 ">
|
||||
<ul class="uk-slider-items uk-grid-small uk-flex uk-flex-center" uk-height-match="target: > li > .affiliation" uk-grid>
|
||||
<li *ngFor="let affiliation of affiliations"
|
||||
[class]="'affiliation-element ' +
|
||||
(affiliationsInSlider == 2?'uk-width-1-2':'uk-width-small')">
|
||||
<div
|
||||
class="uk-card portalSearchCard affiliation uk-flex uk-flex-middle uk-flex-center uk-padding-small"
|
||||
[attr.uk-tooltip]="(affiliation.name) ? affiliation.name : 'cls: uk-invisible'">
|
||||
<a *ngIf="affiliation.website_url" target="_blank" [href]="affiliation.website_url | urlPrefix"
|
||||
class="affiliation-content">
|
||||
<ng-container
|
||||
*ngTemplateOutlet="card; context: { organization: affiliation, fullView: false}"></ng-container>
|
||||
</a>
|
||||
<span *ngIf="!affiliation.website_url" class="affiliation-content">
|
||||
<ng-container *ngTemplateOutlet="card; context: { organization: affiliation}"></ng-container>
|
||||
</span>
|
||||
</div>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
<a *ngIf="arrows"
|
||||
class="uk-position-center-left-out " [class.coloredBackground]="communityFirstPage"
|
||||
href="#" uk-slidenav-previous uk-slider-item="previous"></a>
|
||||
<a *ngIf=" arrows"
|
||||
class="uk-position-center-right-out "
|
||||
[class.coloredBackground]="communityFirstPage"
|
||||
href="#" uk-slidenav-next uk-slider-item="next"></a>
|
||||
</div>
|
||||
<!-- [class]="'uk-hidden-hover uk-position-center-left uk-padding uk-height-1-1 uk-flex uk-width-1-'+(affiliations.length >= affiliationsInSlider ? affiliationsInSlider : affiliations.length)"-->
|
||||
<!-- class="uk-position-center-right uk-padding uk-height-1-1 uk-flex"-->
|
||||
<a *ngIf="(affiliations.length > affiliationsInSlider) && arrows"
|
||||
class="uk-position-center-left uk-padding uk-height-1-1 uk-flex" [class.coloredBackground]="communityFirstPage"
|
||||
href="#" uk-slidenav-previous uk-slider-item="previous"></a>
|
||||
<a *ngIf="(affiliations.length > affiliationsInSlider) && arrows"
|
||||
class="uk-position-center-right uk-padding uk-height-1-1 uk-flex" [class.coloredBackground]="communityFirstPage"
|
||||
href="#" uk-slidenav-next uk-slider-item="next"></a>
|
||||
</div>
|
||||
<div *ngIf="communityFirstPage">
|
||||
<a routerLink="/organizations" class="uk-align-right portal-link uk-flex uk-flex-middle">
|
||||
<a routerLink="/organizations" class="uk-align-right portal-link uk-flex uk-flex-middle uk-margin-top">
|
||||
<span>See Details</span>
|
||||
<span uk-icon="chevron-right"></span>
|
||||
</a>
|
||||
|
|
|
@ -36,10 +36,8 @@ import {LayoutService} from "./openaireLibrary/services/layout.service";
|
|||
[showMenu]=showMenu [properties]="properties" [enableSearch]="false"
|
||||
searchRoute="/search/find/research-outcomes"
|
||||
[showHomeMenuItem]="false"></navbar>
|
||||
<!-- <customization *ngIf="properties && showMenu && communityId && communityId.length > 0 && layout" [properties]="properties"-->
|
||||
<!-- [communityId]="communityId" [layout]="layout" ></customization>-->
|
||||
<customization *ngIf="properties && showMenu && communityId && communityId.length > 0" [properties]="properties"
|
||||
[communityId]="communityId" ></customization>
|
||||
<customization *ngIf="properties && showMenu && communityId && communityId.length > 0 && layout" [properties]="properties"
|
||||
[communityId]="communityId" [layout]="layout" ></customization>
|
||||
<schema2jsonld *ngIf="properties && showMenu && !community" [URL]="properties.domain + properties.baseLink"
|
||||
[logoURL]="properties.domain + properties.baseLink+'/assets/common-assets/logo-small-connect.png'"
|
||||
type="home"
|
||||
|
@ -139,12 +137,6 @@ export class AppComponent {
|
|||
this.user = user;
|
||||
this.init();
|
||||
}, error => this.init()));
|
||||
/* this.subscriptions.push(this.route.queryParams.subscribe(params => {
|
||||
console.log(" params changed!" + params['layout'])
|
||||
if(params['layout']) {
|
||||
this.layout = JSON.parse(StringUtils.URIDecode(params['layout']));
|
||||
}
|
||||
}));*/
|
||||
}
|
||||
|
||||
get isManager() {
|
||||
|
@ -168,32 +160,27 @@ export class AppComponent {
|
|||
initAdminToolCommunity(communityId) {
|
||||
if (communityId) {
|
||||
this.properties.adminToolsPortalType = "community";
|
||||
// this.initLayout(communityId);
|
||||
this.initLayout(communityId);
|
||||
}
|
||||
this.configurationService.initCommunityInformation(this.properties, (communityId) ? communityId : this.properties.adminToolsPortalType);
|
||||
}
|
||||
initLayout(communityId){
|
||||
if(!this.layout) {
|
||||
if(!this.layout && this.properties.environment == "development") {
|
||||
this._layoutService.getLayout(this.properties, communityId).subscribe(
|
||||
layout => {
|
||||
console.debug(layout);
|
||||
|
||||
if (layout) {
|
||||
console.debug("service");
|
||||
this.layout = layout.layoutOptions;
|
||||
this.layout = CustomizationOptions.checkForObsoleteVersion(layout.layoutOptions,this.communityId);
|
||||
} else {
|
||||
this.layout = new CustomizationOptions(CustomizationOptions.getIdentity(communityId).mainColor, CustomizationOptions.getIdentity(communityId).secondaryColor);
|
||||
console.debug("default");
|
||||
}
|
||||
|
||||
},
|
||||
error => {
|
||||
console.log(" Layout not found - use default");
|
||||
this.layout = new CustomizationOptions(CustomizationOptions.getIdentity(communityId).mainColor, CustomizationOptions.getIdentity(communityId).secondaryColor);
|
||||
console.debug("error - default");
|
||||
|
||||
}
|
||||
);
|
||||
}else{
|
||||
this.layout = new CustomizationOptions(CustomizationOptions.getIdentity(communityId).mainColor, CustomizationOptions.getIdentity(communityId).secondaryColor);
|
||||
}
|
||||
}
|
||||
public buildMenu(communityId: string) {
|
||||
|
|
|
@ -13,7 +13,7 @@
|
|||
</search-tab>
|
||||
</div>
|
||||
|
||||
<div
|
||||
<!--<div
|
||||
*ngIf="statistics.statisticsSum && statistics.statisticsDisplay && statistics.statisticsSum[type].total>0
|
||||
&&
|
||||
( statistics.statisticsDisplay.entities[type].numbers.map['total']['showInDashboard']
|
||||
|
@ -38,7 +38,7 @@
|
|||
chartsInfoMap:statistics.chartsInfoMap, showIn:'showInDashboard'}">
|
||||
</ng-container>
|
||||
</div>
|
||||
</div>
|
||||
</div>-->
|
||||
</div>
|
||||
</ng-template>
|
||||
|
||||
|
@ -293,10 +293,10 @@
|
|||
? 'uk-margin-small-bottom' : ''">
|
||||
<span
|
||||
*ngIf="projectTotal && projectTotal > 0 && isEntityEnabled('project') && isRouteEnabled(searchLinkToProjects)">
|
||||
<span class="uk-text-muted">Projects:</span>
|
||||
<span class="uk-text-muted">Projects: </span>
|
||||
<a class="uk-margin-auto-vertical uk-margin-auto portal-link" [queryParams]=params
|
||||
routerLinkActive="router-link-active" [routerLink]="searchLinkToProjects">
|
||||
{{projectTotal|number}}
|
||||
routerLinkActive="router-link-active"
|
||||
[routerLink]="searchLinkToProjects">{{projectTotal|number}}
|
||||
</a>
|
||||
</span>
|
||||
<span
|
||||
|
@ -304,8 +304,8 @@
|
|||
[class]="'uk-display-inline-block '+((projectTotal && projectTotal > 0 && isEntityEnabled('project') && isRouteEnabled(searchLinkToProjects)) ? 'uk-margin-left' : '')">
|
||||
<span class="uk-text-muted">Content Providers: </span>
|
||||
<a class="uk-margin-auto-vertical uk-margin-auto portal-link" [queryParams]=params
|
||||
routerLinkActive="router-link-active" [routerLink]="searchLinkToDataProviders">
|
||||
{{contentProviderTotal|number}}
|
||||
routerLinkActive="router-link-active"
|
||||
[routerLink]="searchLinkToDataProviders">{{contentProviderTotal|number}}
|
||||
</a>
|
||||
</span>
|
||||
<span *ngIf="projectsCalculated && contentProvidersCalculated &&
|
||||
|
@ -554,10 +554,10 @@
|
|||
[tabTitle]="'Other Research'" [tabNumber]="fetchOrps.searchUtils.totalResults" [tabId]="'other'">
|
||||
<ng-container *ngTemplateOutlet="other_tab;"></ng-container>
|
||||
</my-tab>
|
||||
<my-tab *ngIf="showAnalyticsTab()"
|
||||
<!-- <my-tab *ngIf="showAnalyticsTab()"
|
||||
[tabTitle]="'Analytics'" customClass="statistics" [tabId]="'analytics'">
|
||||
<ng-container *ngTemplateOutlet="analytics_tab;"></ng-container>
|
||||
</my-tab>
|
||||
</my-tab>-->
|
||||
<my-tab *ngIf="properties.environment != 'production' && communityId == 'covid-19'"
|
||||
[tabTitle]="'Ontology Mapping'" [tabId]="'mapping'" customClass="portalTab">
|
||||
<ng-container *ngTemplateOutlet="mapping_tab;"></ng-container>
|
||||
|
@ -592,10 +592,10 @@
|
|||
[tabTitle]="'Other Research'" [tabNumber]="fetchOrps.searchUtils.totalResults" [tabId]="'other'">
|
||||
<ng-container *ngTemplateOutlet="other_tab;"></ng-container>
|
||||
</my-tab>
|
||||
<my-tab *ngIf="showAnalyticsTab()"
|
||||
<!--<my-tab *ngIf="showAnalyticsTab()"
|
||||
[tabTitle]="'Analytics'" customClass="statistics" [tabId]="'analytics'">
|
||||
<ng-container *ngTemplateOutlet="analytics_tab;"></ng-container>
|
||||
</my-tab>
|
||||
</my-tab>-->
|
||||
<my-tab *ngIf="properties.environment != 'production' && communityId == 'covid-19'"
|
||||
[tabTitle]="'Ontology Mapping'" [tabId]="'mapping'" customClass="portalTab">
|
||||
<ng-container *ngTemplateOutlet="mapping_tab;"></ng-container>
|
||||
|
@ -611,11 +611,11 @@
|
|||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<statistics-for-dashboard [currentMode]="'showInDashboard'"></statistics-for-dashboard>
|
||||
<!--<statistics-for-dashboard [currentMode]="'showInDashboard'"></statistics-for-dashboard>-->
|
||||
<div class="uk-section tm-middle uk-container uk-margin-top uk-padding-remove-top" id=""
|
||||
*ngIf="communityId && communityInfo">
|
||||
<ng-container *ngIf=" isRouteEnabled('/organizations')">
|
||||
<div class="uk-container uk-margin-bottom uk-grid">
|
||||
<div class="uk-container uk-margin-bottom">
|
||||
<div class="uk-width-expand uk-padding-remove">
|
||||
<affiliations [longView]="false" [getAffiliationsFromAPI]="true" [communityFirstPage]="true"></affiliations>
|
||||
</div>
|
||||
|
|
|
@ -75,7 +75,6 @@ export class CommunityComponent {
|
|||
|
||||
subscribers: number = 0;
|
||||
|
||||
// TODO Unsubscribe
|
||||
subs: Subscription[] = [];
|
||||
|
||||
@ViewChild(StatisticsForDashboardComponent) statistics: StatisticsForDashboardComponent = null;
|
||||
|
|
|
@ -1,24 +1,59 @@
|
|||
<customization *ngIf="layout" [properties]="properties"
|
||||
[layout]="layout" ></customization>
|
||||
<div class="">
|
||||
<div
|
||||
class="uk-padding uk-text-center generalSearchForm uk-width-1-1 uk-height-small midBackground uk-flex uk-flex-center uk-flex-middle">
|
||||
<div class="uk-margin-large-top uk-margin-large-bottom uk-padding">
|
||||
<div>
|
||||
<input class="uk-input uk-input-small uk-width-medium uk-margin-small-bottom" placeholder="Search... ">
|
||||
<button class="uk-button uk-margin-small-left">Button</button>
|
||||
</div>
|
||||
<div>
|
||||
<a class="portal-link">Link</a>
|
||||
</div>
|
||||
class="uk-padding generalSearchForm midBackground ">
|
||||
<div class="uk-container uk-container-large">
|
||||
<div class="uk-margin-large-top">
|
||||
<h1 class="title uk-margin-remove">
|
||||
Lorem ipsum dolor sit amet
|
||||
</h1>
|
||||
<div class="subtitle uk-margin-remove">
|
||||
Lorem ipsum dolor sit amet, consectetur adipiscing elit
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div
|
||||
class=" uk-flex uk-flex-center uk-flex-middle">
|
||||
<form class="uk-margin-large uk-margin-large-top ">
|
||||
<input class="uk-input uk-input uk-width-xlarge@l uk-width-large@m uk-width-medium uk-margin-small-bottom" placeholder="Search... ">
|
||||
<button class="uk-button uk-margin-small-left uktext-bold">Search</button>
|
||||
<div class="uk-text-right uk-margin-small-top"><a class="portal-link">Advanced search</a></div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!--Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.-->
|
||||
<div class="uk-container uk-container-large uk-margin-top">
|
||||
<my-tabs class="uk-padding">
|
||||
<my-tab
|
||||
[tabTitle]="'Summary'" [tabId]="'summary'" class="uk-active">
|
||||
<div class="uk-padding-small uk-text-center uk-width-1-1 uk-height-medium lightBackground uk-flex uk-flex-center uk-flex-middle">
|
||||
Summary tab
|
||||
</div>
|
||||
<div class="uk-padding uk-width-1-1">
|
||||
<div class="uk-margin-bottom">
|
||||
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
|
||||
</div>
|
||||
<div class="uk-margin-small-bottom">
|
||||
<span class="uk-margin-right "><span class="lowOpacityColor uk-text-muted">Created: </span> 01-Jan-2020
|
||||
</span>
|
||||
<span><span class="uk-display-inline-block "><span class="lowOpacityColor uk-text-muted">Members: </span>
|
||||
1024 </span></span>
|
||||
</div>
|
||||
<div class="uk-margin-small-bottom">
|
||||
<span class="uk-margin-right "><span class="lowOpacityColor uk-text-muted">Projects: </span> <a
|
||||
class="portal-link">567
|
||||
</a>
|
||||
</span>
|
||||
<span><span class="uk-display-inline-block "><span class="lowOpacityColor uk-text-muted">Content providers:
|
||||
</span>
|
||||
<a class="portal-link">123</a></span></span>
|
||||
</div>
|
||||
<hr>
|
||||
<div>
|
||||
<div class="tab-header"> <span class=""> Recent publications </span></div>
|
||||
<div class="uk-text-right "><a class=" uk-button uk-button-text" > View all </a></div>
|
||||
<result-preview [properties]="properties" [result]="result"></result-preview>
|
||||
</div>
|
||||
</div>
|
||||
</my-tab>
|
||||
|
||||
<my-tab customClass="portalTab"
|
||||
|
@ -28,6 +63,10 @@
|
|||
</div>
|
||||
</my-tab>
|
||||
</my-tabs>
|
||||
<div>
|
||||
<result-landing [resultFromInput]="true" [resultLandingInfo]="resultLanding"></result-landing>
|
||||
|
||||
</div>
|
||||
<div class="uk-margin-top uk-margin-small-bottom uk-text-bold uk-text-large">Dark background</div>
|
||||
|
||||
<div class="uk-padding-small uk-text-center communityPanelBackground uk-height-medium uk-light uk-flex uk-flex-center uk-flex-middle" >
|
||||
|
@ -35,7 +74,8 @@
|
|||
<h1 >Heading</h1>
|
||||
<div>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Praesent mollis velit ornare, auctor lectus at, rutrum magna. Aenean vehicula elementum lacinia.</div>
|
||||
<a class="">Link</a>
|
||||
<button class="uk-button">Button</button>
|
||||
<br>
|
||||
<button class="uk-button">Button</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
|
|
@ -1,7 +1,11 @@
|
|||
import {Component, OnInit} from '@angular/core';
|
||||
import {EnvProperties} from "../openaireLibrary/utils/properties/env-properties";
|
||||
import {ActivatedRoute, Router} from "@angular/router";
|
||||
import {HelperService} from "../openaireLibrary/utils/helper/helper.service";
|
||||
import {ActivatedRoute} from "@angular/router";
|
||||
import {CustomizationOptions} from "../openaireLibrary/connect/community/CustomizationOptions";
|
||||
import {StringUtils} from "../openaireLibrary/utils/string-utils.class";
|
||||
import {ResultPreview} from "../openaireLibrary/utils/result-preview/result-preview";
|
||||
import {properties} from "../../environments/environment";
|
||||
import {ResultLandingInfo} from "../openaireLibrary/utils/entities/resultLandingInfo";
|
||||
|
||||
|
||||
@Component({
|
||||
|
@ -11,15 +15,43 @@ import {HelperService} from "../openaireLibrary/utils/helper/helper.service";
|
|||
|
||||
export class DemoComponent implements OnInit{
|
||||
|
||||
properties:EnvProperties;
|
||||
|
||||
constructor(private route: ActivatedRoute,
|
||||
private _router: Router,
|
||||
private helper: HelperService) {
|
||||
properties:EnvProperties;
|
||||
layout: CustomizationOptions = null;
|
||||
result: ResultPreview;
|
||||
resultLanding:ResultLandingInfo;
|
||||
constructor(private route: ActivatedRoute) {
|
||||
|
||||
}
|
||||
|
||||
ngOnInit(): void {
|
||||
this.properties = properties;
|
||||
this.route.queryParams.subscribe(params => {
|
||||
if (params['layout']) {
|
||||
this.layout = JSON.parse(StringUtils.URIDecode(params['layout']));
|
||||
}
|
||||
});
|
||||
this.result = new ResultPreview();
|
||||
this.resultLanding = new ResultLandingInfo();
|
||||
this.result.resultType = "Publication";
|
||||
this.resultLanding.types = this.result.types = ["Article"];
|
||||
this.resultLanding.accessMode = this.result.accessMode = "Open Access";
|
||||
this.resultLanding.description = this.result.description = "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum."
|
||||
this.resultLanding.authors = this.result.authors = [{fullName: "Lorem ipsum", orcid: "0000-1111-2222-3333", orcid_pending: null}, {fullName: "Lorem ipsum", orcid: null, orcid_pending: "0000-1111-2222-3333"},{fullName: "Lorem ipsum", orcid: null, orcid_pending: null}];
|
||||
this.resultLanding.title = this.result.title = "Lorem ipsum dolor sit amet, consectetur adipiscing elit";
|
||||
this.resultLanding.fundedByProjects = this.result.projects = [{id: "XYZ", acronym: "Project acronym", title: "Project name", funderShortname: "Funder acronym", funderName: "Funder name", code:" project code"}]
|
||||
this.resultLanding.countries = this.result.countries = ["Greece"];
|
||||
this.resultLanding.languages = this.result.languages = ["GR"];
|
||||
this.resultLanding.identifiers = this.result.identifiers = new Map<string, string[]>();
|
||||
this.result.identifiers.set("doi",["DOI/1","DOI/2"]);
|
||||
this.resultLanding.date = this.result.year = "2020";
|
||||
this.resultLanding.publisher = "Publisher name";
|
||||
this.resultLanding.journal = {journal: "Journal name", lissn: null};
|
||||
this.resultLanding.subjects = ["Subject 1", "Subject 2"];
|
||||
this.resultLanding.contexts = [{ "labelContext": "Research Community", "idContext": "",
|
||||
"labelCategory":"", "idCategory": "",
|
||||
"labelConcept": "", "idConcept": "", "inline" :true }]
|
||||
this.resultLanding.objIdentifier ="re3data_____::db814dc656a911b556dba42a331cebe9";
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
|
|
@ -4,6 +4,9 @@ import {DemoComponent} from "./demo.component";
|
|||
import {CommonModule} from "@angular/common";
|
||||
import {RouterModule} from "@angular/router";
|
||||
import {TabsModule} from "../openaireLibrary/utils/tabs/tabs.module";
|
||||
import {CustomizationModule} from "../utils/customization/customization.module";
|
||||
import {ResultPreviewModule} from "../openaireLibrary/utils/result-preview/result-preview.module";
|
||||
import {ResultLandingModule} from "../openaireLibrary/landingPages/result/resultLanding.module";
|
||||
|
||||
@NgModule({
|
||||
imports: [
|
||||
|
@ -12,7 +15,10 @@ import {TabsModule} from "../openaireLibrary/utils/tabs/tabs.module";
|
|||
RouterModule.forChild([
|
||||
{path: '', component: DemoComponent}
|
||||
]),
|
||||
TabsModule
|
||||
TabsModule,
|
||||
CustomizationModule,
|
||||
ResultPreviewModule,
|
||||
ResultLandingModule
|
||||
],
|
||||
declarations: [
|
||||
DemoComponent
|
||||
|
|
|
@ -4,8 +4,6 @@ import {EnvProperties} from '../../openaireLibrary/utils/properties/env-properti
|
|||
import {LayoutService} from "../../openaireLibrary/services/layout.service";
|
||||
import {CustomizationOptions} from "../../openaireLibrary/connect/community/CustomizationOptions";
|
||||
import {DOCUMENT} from "@angular/common";
|
||||
import {DomSanitizer} from "@angular/platform-browser";
|
||||
import {StringUtils} from "../../openaireLibrary/utils/string-utils.class";
|
||||
|
||||
@Component({
|
||||
selector: 'customization',
|
||||
|
@ -19,42 +17,10 @@ export class CustomizationComponent {
|
|||
customizationCss:string = "";
|
||||
|
||||
|
||||
constructor(private route: ActivatedRoute,
|
||||
private router: Router, private _layoutService: LayoutService, @Inject(DOCUMENT) private document, private rendererFactory: RendererFactory2, private sanitizer: DomSanitizer
|
||||
) {
|
||||
|
||||
constructor(private route: ActivatedRoute,private router: Router, private _layoutService: LayoutService, @Inject(DOCUMENT) private document, private rendererFactory: RendererFactory2) {
|
||||
}
|
||||
|
||||
public ngOnInit() {
|
||||
console.log("cust init")
|
||||
this._layoutService.getLayout(this.properties, this.communityId).subscribe(
|
||||
layout => {
|
||||
if (layout) {
|
||||
console.debug("service");
|
||||
this.layout = CustomizationOptions.checkForObsoleteVersion(layout.layoutOptions,this.communityId);
|
||||
} else {
|
||||
this.layout = new CustomizationOptions(CustomizationOptions.getIdentity(this.communityId).mainColor, CustomizationOptions.getIdentity(this.communityId).secondaryColor);
|
||||
console.debug("default");
|
||||
}
|
||||
this.privateAppendCss();
|
||||
},
|
||||
error => {
|
||||
console.log(" Layout not found - use default");
|
||||
this.layout = new CustomizationOptions();
|
||||
this.privateAppendCss();
|
||||
}
|
||||
);
|
||||
this.route.queryParams.subscribe(params => {
|
||||
if(params['layout']) {
|
||||
this.layout = JSON.parse(StringUtils.URIDecode(params['layout']));
|
||||
this.privateAppendCss();
|
||||
}else{
|
||||
|
||||
}
|
||||
});
|
||||
// this.privateAppendCss();
|
||||
}
|
||||
privateAppendCss(){
|
||||
|
||||
this.buildCss();
|
||||
try {
|
||||
|
@ -105,6 +71,12 @@ export class CustomizationComponent {
|
|||
this.customizationCss = this.customizationCss.concat('.generalSearchForm,.publicationsSearchForm,.projectsSearchForm, .projectsTableSearchForm,.organizationsSearchForm,.datasourcesSearchForm {');
|
||||
this.customizationCss = this.customizationCss.concat(' background: ' + "url('" + svg + "') transparent no-repeat center bottom }");
|
||||
|
||||
//Button link SVG
|
||||
let arrow = `<svg width="23" height="11" viewBox="0 0 23 11" xmlns="http://www.w3.org/2000/svg"><polyline fill="none" stroke="{{color}}" points="17 1 22 5.5 17 10 " /><line fill="none" stroke="{{color}}" x1="0" y1="5.5" x2="22.4" y2="5.5" /></svg>`;;
|
||||
let svg_arrow = 'data:image/svg+xml,' + encodeURIComponent(arrow.split('{{color}}').join(this.layout.identity.mainColor));
|
||||
this.customizationCss = this.customizationCss.concat('.uk-button-text::before {');
|
||||
this.customizationCss = this.customizationCss.concat(' background-image: ' + "url('" + svg_arrow + "') !important}");
|
||||
|
||||
this.customizationCss = this.customizationCss.concat(' .communityPanelBackground, .communityPanelBackground .uk-section-primary {');
|
||||
this.customizationCss = this.customizationCss.concat(' background-color: ' + this.layout.backgrounds.dark.color + ';}');
|
||||
this.customizationCss = this.customizationCss.concat(' .uk-button:not(.uk-button-text){');
|
||||
|
|
|
@ -22,17 +22,7 @@ export class PiwikHelper{
|
|||
"enermaps":318,
|
||||
"galaxy":453
|
||||
};
|
||||
public static siteIDsProduction={
|
||||
"dh-ch":198,
|
||||
"sdsn-gr":200,
|
||||
"fam":197,
|
||||
"mes":196,
|
||||
"ni":199
|
||||
};
|
||||
public static getSiteId(communityId:string, environment:string){
|
||||
// if(environment == 'production' && this.siteIDsProduction[communityId]){
|
||||
// return this.siteIDsProduction[communityId];
|
||||
// }
|
||||
return this.siteIDs[communityId];
|
||||
}
|
||||
|
||||
|
|
|
@ -162,11 +162,7 @@ a:hover .user-circle-background {
|
|||
}
|
||||
|
||||
.coloredBackground, .coloredBackground:focus, .coloredBackground:hover {
|
||||
background-color: var(--background-light-color);
|
||||
}
|
||||
|
||||
.coloredBackground:hover {
|
||||
opacity: 0.9;
|
||||
background-color: transparent;
|
||||
}
|
||||
|
||||
.generalSearchForm .subtitle{
|
||||
|
|
|
@ -85,7 +85,8 @@ a:not(.uk-button),
|
|||
.uk-navbar-dropdown-nav>li.uk-active>a,
|
||||
.uk-tab>.uk-active>a,
|
||||
.uk-navbar-nav>li.uk-active>a,
|
||||
.uk-navbar-container:not(.uk-navbar-transparent) .uk-navbar-nav>li.uk-active>a
|
||||
.uk-navbar-container:not(.uk-navbar-transparent) .uk-navbar-nav>li.uk-active>a,
|
||||
.uk-button-text
|
||||
{
|
||||
color: var(--portal-main-color) !important;
|
||||
}
|
||||
|
@ -120,10 +121,6 @@ a:not(.uk-button),
|
|||
color: var(--portal-dark-color) !important;
|
||||
}
|
||||
|
||||
.uk-slidenav {
|
||||
background: none;
|
||||
}
|
||||
|
||||
#stickyNavbar{
|
||||
box-shadow: 0 1px 1px #0000004D;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue