[Library | Trunk]: 1. Add project name as subtitle if acrony and name are existed. 2. Remove isClient condition, which made menu hidden on server mode.
git-svn-id: https://svn.driver.research-infrastructures.eu/driver/dnet40/modules/uoa-services-library/trunk/ng-openaire-library/src/app@58285 d315682c-612b-4755-9ff5-7f18f6832af3
This commit is contained in:
parent
cd6642d7b2
commit
9d69da41fd
|
@ -1,5 +1,6 @@
|
|||
import {Component, Input} from '@angular/core';
|
||||
import {HelperFunctions} from "../../utils/HelperFunctions.class";
|
||||
import {Project} from "../../utils/result-preview/result-preview";
|
||||
|
||||
@Component({
|
||||
selector: 'fundedBy',
|
||||
|
@ -7,7 +8,7 @@ import {HelperFunctions} from "../../utils/HelperFunctions.class";
|
|||
<li>
|
||||
<span class="uk-text-muted">Funded by: </span>
|
||||
<span *ngFor="let item of fundedByProjects.slice(0, showNum) let i=index">
|
||||
<span class="clickable uk-link">
|
||||
<a class="cursor-default">
|
||||
<mark *ngIf="item.inline">
|
||||
<span *ngIf="item['funderShortname'] || item['funderName']">{{item['funderShortname']?item['funderShortname']:item['funderName']}}</span>
|
||||
<span *ngIf="!item['funderShortname'] && !item['funderName']">[no funder available]</span>
|
||||
|
@ -18,18 +19,21 @@ import {HelperFunctions} from "../../utils/HelperFunctions.class";
|
|||
<span *ngIf="!item['funderShortname'] && !item['funderName']">[no funder available]</span>
|
||||
<span *ngIf="item['acronym'] || item['title']">| {{ item['acronym']?item['acronym']:item['title']}}</span>
|
||||
</span>
|
||||
</span>
|
||||
</a>
|
||||
<div class="default-dropdown uk-margin-remove-top uk-padding-small"
|
||||
uk-dropdown="pos: bottom-left; mode:click">
|
||||
<span class="uk-text-small">Project</span>
|
||||
<div class="uk-margin-bottom">
|
||||
<a *ngIf="item.id" class="uk-h6 uk-margin-remove"
|
||||
<a *ngIf="item.id" class="uk-h6 uk-margin-remove portal-link"
|
||||
[queryParams]="{projectId: item.id}" routerLink="/search/project">
|
||||
{{item['acronym']?item['acronym']:item['title']}}
|
||||
</a>
|
||||
<span *ngIf="!item.id" class="uk-h6 uk-margin-remove">
|
||||
{{item['acronym']?item['acronym']:item['title']}}
|
||||
</span>
|
||||
<div *ngIf="item.acronym && item.title">
|
||||
{{item.title}}
|
||||
</div>
|
||||
</div>
|
||||
<ul class="uk-list uk-padding-remove-left uk-margin-bottom">
|
||||
<li *ngIf="item.funderShortname || item.funderName">
|
||||
|
@ -67,61 +71,11 @@ import {HelperFunctions} from "../../utils/HelperFunctions.class";
|
|||
})
|
||||
|
||||
export class FundedByComponent {
|
||||
@Input() fundedByProjects: { "id": string, "acronym": string, "title": string,
|
||||
"funderShortname": string, "funderName": string,
|
||||
"funding": string, "code": string, "provenanceAction": string,
|
||||
"inline": boolean }[];
|
||||
@Input() fundedByProjects: Project[];
|
||||
|
||||
public threshold: number = 5;
|
||||
public showNum: number = 5;
|
||||
|
||||
constructor () {}
|
||||
|
||||
ngOnInit() {}
|
||||
|
||||
public buildFundingTooltip(item: { "id": string, "acronym": string, "title": string,
|
||||
"funderShortname": string, "funderName": string,
|
||||
"funding": string, "code": string, "provenanceAction": string, inline: boolean}) {
|
||||
let tooltipContent: string = "<div class='tooltip-custom-font-size uk-padding-small uk-light'>";
|
||||
|
||||
if(item.title) {
|
||||
tooltipContent += "<p class='uk-h5'>"+item.title+"</p>";
|
||||
}
|
||||
|
||||
if(item.code || item.funderName || item.funderShortname || item.funding) {
|
||||
tooltipContent += "<p>";
|
||||
}
|
||||
|
||||
if(item.code) {
|
||||
tooltipContent += "<div>Project Code: "+item.code+"</div>";
|
||||
}
|
||||
if(item.funderName || item.funderShortname) {
|
||||
tooltipContent += "<div>Funder: ";
|
||||
if(item.funderName && item.funderShortname) {
|
||||
tooltipContent += item.funderName + " ("+ item.funderShortname +")";
|
||||
} else if(item.funderName) {
|
||||
tooltipContent += item.funderName;
|
||||
} else {
|
||||
tooltipContent += item.funderShortname;
|
||||
}
|
||||
tooltipContent += "</div>";
|
||||
}
|
||||
|
||||
if(item.funding) {
|
||||
tooltipContent += "<div>Funding: "+ item.funding + "</div>";
|
||||
}
|
||||
|
||||
if(item.code || item.funderName || item.funderShortname || item.funding) {
|
||||
tooltipContent += "</p>";
|
||||
}
|
||||
tooltipContent += "<span class='uk-text-small'>";
|
||||
tooltipContent += item.provenanceAction;
|
||||
tooltipContent += "</span>";
|
||||
tooltipContent+="</div>";
|
||||
|
||||
return tooltipContent;
|
||||
}
|
||||
|
||||
public scroll() {
|
||||
HelperFunctions.scroll();
|
||||
}
|
||||
|
|
|
@ -43,7 +43,7 @@
|
|||
<button class="uk-offcanvas-close uk-close uk-icon" type="button" uk-close=""></button>
|
||||
<div class="uk-child-width-1-1 uk-grid" uk-grid="">
|
||||
<div>
|
||||
<div *ngIf= "isClient" class="uk-panel" id="module-0">
|
||||
<div class="uk-panel" id="module-0">
|
||||
<ul class="uk-nav uk-nav-default">
|
||||
<li class="uk-nav-header uk-parent" >
|
||||
Dashboards
|
||||
|
@ -176,7 +176,7 @@
|
|||
|
||||
<!-- <div *ngIf="!onlyTop" class="uk-navbar-center"> -->
|
||||
<div *ngIf="!onlyTop" class="uk-navbar-right uk-position-top-right">
|
||||
<ul *ngIf= "isClient" [class]="'uk-navbar-nav'+(!userMenu?' uk-margin-right':'')">
|
||||
<ul [class]="'uk-navbar-nav'+(!userMenu?' uk-margin-right':'')">
|
||||
<li class="uk-parent" *ngIf="showHomeMenuItem && getCurrentRoute()!='/'">
|
||||
<a routerLinkActive="uk-link" routerLink="/">Home</a>
|
||||
</li>
|
||||
|
|
|
@ -32,7 +32,6 @@ export class NavigationBarComponent {
|
|||
|
||||
public isAuthorized: boolean = false;
|
||||
sub: any;
|
||||
isClient: boolean = false;
|
||||
showEntity = {};
|
||||
showPage = {};
|
||||
specialAnnouncementContent: string = null;
|
||||
|
@ -45,13 +44,6 @@ export class NavigationBarComponent {
|
|||
}
|
||||
|
||||
ngOnInit() {
|
||||
//console.log(this.menuItems);
|
||||
if (typeof document !== 'undefined') {
|
||||
try {
|
||||
this.isClient = true;
|
||||
} catch (e) {
|
||||
}
|
||||
}
|
||||
this.activeRouteEnabled = false;
|
||||
this.sub = this.route.queryParams.subscribe(params => {
|
||||
this.initialize();
|
||||
|
|
Loading…
Reference in New Issue