openaire-library/sharedComponents/navigationBar.component.html

337 lines
21 KiB
HTML
Raw Normal View History

<div *ngIf="showMenu && activeHeader">
2022-12-01 10:22:46 +01:00
<div id="main-menu-small" class="uk-hidden@m">
<nav class="uk-navbar-container uk-navbar" uk-navbar="delay-hide: 400">
[Library | EOSC Explore]: Updated styles | Updated link to Marketplace for EOSC::RO-crate | Bug fix in description of results versions | Removed timeout from reports.service.ts. 1. home.component.html: Added blue banner, white logo, aligned search form to the center and updated fonts according the new EOSC Marketplace. 2. parsingFunctions.class.ts: Updated link to Marketplace for eosc subject EOSC::RO-crate. 3. resultLanding.component.html: Updated how links to Compatible EOSC Services are displayed. 4. searchAll.component.html: Updated paddings and margins in search form of Search all page. 5. navigationBar.component.html: Set burger menu icon to light color if dark background. 6. advancedSearchDataProviders.component.ts & advancedSearchOrganizations.component.ts & advancedSearchProjects.component.ts & advancedSearchServices.component.ts & searchResearchResults.component.ts & searchDataproviders.component.ts & searchOrganizations.component.ts & searchProjects.component.ts & searchResearchResults.component.ts & searchServices.component.ts & search.component.ts: Set in searchForm, dark=true. 7. aggregators.ts: In eoscInfo, updated logoUrl and removed customCss of AggregatorInfo. 8. app.component.ts: Set header.darkBg: true. 9. Added eosc-custom.less file. 10. styles.less: import eosc-custom less file, instead of portal-custom.css. 11. deletedByInference.service.ts & result-preview.ts: [Bug fix] Parse description of versions properly. 12. reports.service.ts: Copy fix from angular-14 branch - do not timeout to 10000.
2022-11-28 13:37:37 +01:00
<div *ngIf="!onlyTop || userMenu" class="uk-navbar-left" [class.uk-light]='activeHeader.darkBg'>
<a class="uk-navbar-toggle" href="#tm-mobile" uk-toggle>
<div uk-navbar-toggle-icon="" class="uk-navbar-toggle-icon uk-icon custom-navbar-toggle-icon"></div>
<span class="visually-hidden">toggle menu</span>
</a>
</div>
<div class="uk-navbar-center">
<ng-container *ngTemplateOutlet="header_template; context: {mobile: true}"></ng-container>
</div>
[Library | EOSC Explore]: Updated styles | Updated link to Marketplace for EOSC::RO-crate | Bug fix in description of results versions | Removed timeout from reports.service.ts. 1. home.component.html: Added blue banner, white logo, aligned search form to the center and updated fonts according the new EOSC Marketplace. 2. parsingFunctions.class.ts: Updated link to Marketplace for eosc subject EOSC::RO-crate. 3. resultLanding.component.html: Updated how links to Compatible EOSC Services are displayed. 4. searchAll.component.html: Updated paddings and margins in search form of Search all page. 5. navigationBar.component.html: Set burger menu icon to light color if dark background. 6. advancedSearchDataProviders.component.ts & advancedSearchOrganizations.component.ts & advancedSearchProjects.component.ts & advancedSearchServices.component.ts & searchResearchResults.component.ts & searchDataproviders.component.ts & searchOrganizations.component.ts & searchProjects.component.ts & searchResearchResults.component.ts & searchServices.component.ts & search.component.ts: Set in searchForm, dark=true. 7. aggregators.ts: In eoscInfo, updated logoUrl and removed customCss of AggregatorInfo. 8. app.component.ts: Set header.darkBg: true. 9. Added eosc-custom.less file. 10. styles.less: import eosc-custom less file, instead of portal-custom.css. 11. deletedByInference.service.ts & result-preview.ts: [Bug fix] Parse description of versions properly. 12. reports.service.ts: Copy fix from angular-14 branch - do not timeout to 10000.
2022-11-28 13:37:37 +01:00
<div *ngIf="!onlyTop || userMenu" class="uk-navbar-right" [class.uk-light]='activeHeader.darkBg'>
<ng-container *ngIf="userMenu">
<user-mini [user]="user" mobileView=true (closeCanvasEmitter)="closeCanvas(canvas)"
[userMenuItems]=userMenuItems [logInUrl]=properties.loginUrl
[logOutUrl]=properties.logoutUrl [cookieDomain]=properties.cookieDomain></user-mini>
</ng-container>
</div>
</nav>
<div #canvas id="tm-mobile" [attr.uk-offcanvas]="'overlay: true'"
class="uk-offcanvas">
2022-11-28 15:25:05 +01:00
<div class="uk-offcanvas-bar uk-padding-remove-horizontal">
<button class="uk-offcanvas-close uk-icon uk-close">
<icon name="close" ratio="1.5" visuallyHidden="close menu"></icon>
2022-11-28 15:25:05 +01:00
</button>
<ul class="uk-nav uk-nav-primary uk-list uk-list-large uk-margin-large-top uk-nav-parent-icon" uk-nav>
2022-11-28 15:25:05 +01:00
<ng-container *ngIf="!onlyTop">
<li *ngIf="showHomeMenuItem && currentRoute.route !== '/'">
<a routerLink="/" (click)="closeCanvas(canvas)">Home</a>
</li>
<ng-container *ngFor="let menu of menuItems">
<li [class.uk-active]="isTheActiveMenu(menu)" [class.uk-parent]="menu.items.length > 0" [ngClass]="menu.customClass"
*ngIf="isAtleastOneEnabled(menu.entitiesRequired,showEntity) && isAtleastOneEnabled(menu.routeRequired, showPage)">
<!--a routerLink="{{menu.rootItem.route}}" [queryParams]=menu.rootItem.params class="uk-offcanvas-close custom-offcanvas-close">{{menu.rootItem.title}}</a-->
<a *ngIf="menu.route && (isEnabled([menu.route], showPage) || !menu.routeRequired)"
routerLink="{{menu.route}}" (click)="menu.items.length === 0?closeCanvas(canvas):null"
[queryParams]="menu.params"
[fragment]="menu.fragment">{{menu.title}}</a>
<a *ngIf="!menu.route && menu.url"
href="{{menu.url}}" (click)="menu.items.length === 0?closeCanvas(canvas):null" [class.custom-external]="menu.target != '_self'"
target="{{menu.target}}">{{menu.title}}</a>
<a *ngIf="(!menu.route && !menu.url) ||
(menu.route && menu.routeRequired && !isEnabled([menu.route], showPage)
&& isAtleastOneEnabled(menu.routeRequired, showPage))"
(click)="menu.items.length === 0?closeCanvas(canvas):null">{{menu.title}}</a>
<ul *ngIf="menu.items.length > 0" class="uk-nav-sub">
<ng-container *ngFor="let submenu of menu.items">
<li [class.uk-active]="isTheActiveMenu(submenu)" [ngClass]="submenu.customClass"
*ngIf="isEnabled(submenu.entitiesRequired,showEntity) && isEnabled(submenu.routeRequired, showPage) && (submenu.route.length > 0 || submenu.url.length > 0)"
[class.uk-parent]="submenu.items && submenu.items.length > 0">
<a *ngIf="submenu.route.length > 0" (click)="closeCanvas(canvas)"
routerLink="{{submenu.route}}" [queryParams]=submenu.params
[fragment]="submenu.fragment">{{submenu.title}}</a>
<a *ngIf="submenu.route.length == 0 && submenu.url.length > 0"
href="{{submenu.url}}" (click)="closeCanvas(canvas)" [class.custom-external]="submenu.target != '_self'"
target="{{submenu.target}}">{{submenu.title}}</a>
<ul *ngIf="submenu.items && submenu.items.length > 0" class="uk-nav-sub">
<ng-container *ngFor="let subsubmenu of submenu.items">
<li [class.uk-active]="isTheActiveMenu(subsubmenu)" [ngClass]="subsubmenu.customClass">
<a *ngIf="subsubmenu.route.length > 0"
routerLink="{{subsubmenu.route}}" [queryParams]="subsubmenu.params"
[fragment]="subsubmenu.fragment" (click)="closeCanvas(canvas)">{{subsubmenu.title}}</a>
<a *ngIf="subsubmenu.route.length == 0 && subsubmenu.url.length > 0"
href="{{subsubmenu.url}}" (click)="closeCanvas(canvas)" [class.custom-external]="subsubmenu.target != '_self'"
target="{{subsubmenu.target}}">{{subsubmenu.title}}</a>
</li>
</ng-container>
</ul>
</li>
<li *ngIf="submenu.route.length == 0 && submenu.url.length == 0 && isEnabled(submenu.entitiesRequired,showEntity) && isEnabled(submenu.routeRequired, showPage)"
class="uk-nav-header">{{submenu.title}}</li>
</ng-container>
</ul>
<ul *ngIf="menu.route === '/' && isFeaturedMenuEnabled && featuredMenuItems?.length > 0" class="uk-nav-sub">
<li [class.uk-active]="isTheActiveMenu(item)" *ngFor="let item of featuredMenuItems" [ngClass]="item.customClass">
<a *ngIf="item.type == 'internal' && item.route && isEnabled([item.route], showPage)"
routerLink="{{item.route}}"
[queryParams]="item.params"
[fragment]="item.fragment"
(click)="closeCanvas(canvas)">
{{item.title}}
</a>
<a *ngIf="item.type == 'external' && item.url"
href="{{item.url}}" class="custom-external"
target="_blank"
(click)="closeCanvas(canvas)">
{{item.title}}
</a>
</li>
</ul>
2022-11-28 15:25:05 +01:00
</li>
2022-02-28 13:38:26 +01:00
</ng-container>
<ng-container *ngIf="isMenuEnabled && additionalMenuItems?.length > 0">
<ng-container *ngFor="let menu of additionalMenuItems">
<li [class.uk-active]="isTheActiveMenu(menu)" [class.uk-parent]="menu.items.length > 0" [ngClass]="menu.customClass">
<a *ngIf="menu.type == 'internal' && menu.route && isEnabled([menu.route], showPage)"
routerLink="{{menu.route}}"
[queryParams]="menu.params"
[fragment]="menu.fragment"
(click)="menu.items.length === 0?closeCanvas(canvas):null">
{{menu.title}}
</a>
<a *ngIf="menu.type == 'external' && menu.url"
href="{{menu.url}}"
target="_blank" class="custom-external"
(click)="menu.items.length === 0?closeCanvas(canvas):null">
{{menu.title}}
</a>
<a *ngIf="menu.type == 'noAction'">
{{menu.title}}
</a>
<ul class="uk-nav-sub">
<ng-container *ngIf="menu.items?.length">
<ng-container *ngFor="let submenu of menu.items">
<li [class.uk-active]="isTheActiveMenu(submenu)" [ngClass]="submenu.customClass">
<a *ngIf="submenu.type == 'internal' && submenu.route && isEnabled([submenu.route], showPage)"
routerLink="{{submenu.route}}"
[queryParams]="submenu.params"
[fragment]="submenu.fragment"
(click)="menu.items.length === 0?closeCanvas(canvas):null">
{{submenu.title}}
</a>
<a *ngIf="submenu.type == 'external' && submenu.url"
href="{{submenu.url}}"
target="_blank" class="custom-external"
(click)="menu.items.length === 0?closeCanvas(canvas):null">
{{submenu.title}}
</a>
</li>
</ng-container>
</ng-container>
</ul>
</li>
</ng-container>
2022-02-28 13:38:26 +01:00
</ng-container>
<ng-content select="[extra-s]"></ng-content>
2022-02-28 13:38:26 +01:00
</ng-container>
2022-11-28 15:25:05 +01:00
</ul>
</div>
</div>
</div>
<div id="main-menu" class="uk-visible@m">
<div *ngIf="activeHeader" [class.uk-light]='activeHeader.darkBg'>
<div class="uk-navbar-container" uk-sticky="media@m">
<div *ngIf="(properties.environment =='beta' || properties.environment =='development') && showLogo && activeHeader.badge">
<img class="uk-position-top-left"
[src]="'assets/common-assets/'+(properties.environment =='beta'?'beta_flag.svg':'prototype_flag.svg')"
alt="BETA" style="height: 65px; width: 65px; z-index: 1000">
</div>
<div class="uk-container uk-container-expand">
<nav class="uk-navbar" uk-navbar="delay-hide: 400">
<ng-container *ngIf="!onlyTop">
<div class="uk-navbar-left">
<ng-container *ngIf="showLogo && isHeaderLeft">
<ng-container *ngTemplateOutlet="header_template; context: {mobile: false}"></ng-container>
</ng-container>
</div>
<div class="uk-navbar-center">
<ng-container *ngIf="showLogo && !isHeaderLeft">
<ng-container *ngTemplateOutlet="header_template; context: {mobile: false}"></ng-container>
</ng-container>
<ng-container *ngIf="!activeHeader.menuPosition || activeHeader.menuPosition === 'center'">
<ng-container *ngTemplateOutlet="mainMenu"></ng-container>
</ng-container>
</div>
<div class="uk-navbar-right">
<ng-container *ngIf="activeHeader.menuPosition === 'right'">
<ng-container *ngTemplateOutlet="mainMenu"></ng-container>
</ng-container>
<user-mini *ngIf="userMenu" [user]="user"
[userMenuItems]=userMenuItems [logInUrl]=properties.loginUrl [logOutUrl]=properties.logoutUrl
[cookieDomain]=properties.cookieDomain></user-mini>
<div class="uk-visible@m">
<ng-content select="[extra-m]"></ng-content>
</div>
</div>
<ng-template #mainMenu>
<ul class="uk-navbar-nav" [class.uk-margin-right]="!userMenu">
<li class="uk-parent" *ngIf="showHomeMenuItem && currentRoute.route !== '/'">
<a routerLink="/">Home</a>
</li>
<ng-container *ngFor="let menu of menuItems">
2022-11-28 15:25:05 +01:00
<li class="uk-parent" [class.uk-active]="isTheActiveMenu(menu)" [ngClass]="menu.customClass"
*ngIf="isAtleastOneEnabled(menu.entitiesRequired,showEntity) && isAtleastOneEnabled(menu.routeRequired, showPage)">
<!--a routerLink="{{menu.rootItem.route}}" [queryParams]=menu.rootItem.params class="" aria-expanded="false">{{menu.rootItem.title}}</a-->
<a *ngIf="menu.route.length > 0 && (isEnabled([menu.route], showPage) || !menu.routeRequired )"
routerLink="{{menu.route}}"
[queryParams]="menu.params"
[fragment]="menu.fragment"> {{menu.title}}</a>
<a *ngIf="menu.route.length == 0 && menu.url.length > 0"
href="{{menu.url}}" target="{{menu.target}}"
[class.custom-external]="menu.target != '_self'">{{menu.title}}</a>
<a *ngIf="(menu.route.length == 0 && menu.url.length == 0) || ( menu.route.length >0 && menu.routeRequired && !isEnabled([menu.route], showPage) && isAtleastOneEnabled(menu.routeRequired, showPage))">{{menu.title}}</a>
<div *ngIf="menu.items.length > 0" class="uk-navbar-dropdown uk-navbar-dropdown-bottom-left uk-height-max-medium uk-overflow-auto">
<!-- Do not delete this div, because it will remove the margin bottom of navbar -->
<div>
<ul class="uk-nav uk-navbar-dropdown-nav">
<ng-container *ngFor="let submenu of menu.items">
<li *ngIf="isEnabled(submenu.entitiesRequired,showEntity) &&
isEnabled(submenu.routeRequired, showPage) && (submenu.route.length > 0 ||
submenu.url.length > 0)" [class.uk-active]="isTheActiveMenu(submenu)"
2022-11-28 15:25:05 +01:00
[class.uk-parent]="submenu.items && submenu.items.length > 0" [ngClass]="submenu.customClass">
<a *ngIf="submenu.route.length > 0"
routerLink="{{submenu.route}}" [queryParams]="submenu.params"
[fragment]="submenu.fragment">{{submenu.title}}</a>
<a *ngIf="submenu.route.length == 0 && submenu.url.length > 0"
href="{{submenu.url}}" [class.custom-external]="submenu.target != '_self'"
target="{{submenu.target}}">{{submenu.title}}</a>
<ul *ngIf="submenu.items && submenu.items.length > 0" class="uk-nav-sub">
<ng-container *ngFor="let subsubmenu of submenu.items">
2022-11-28 15:25:05 +01:00
<li [class.uk-active]="isTheActiveMenu(subsubmenu)" [ngClass]="subsubmenu.customClass">
<a *ngIf="subsubmenu.route.length > 0"
routerLink="{{subsubmenu.route}}" [queryParams]="subsubmenu.params"
[fragment]="subsubmenu.fragment">{{subsubmenu.title}}</a>
<a *ngIf="subsubmenu.route.length == 0 && subsubmenu.url.length > 0"
href="{{subsubmenu.url}}" [class.custom-external]="subsubmenu.target != '_self'" target="{{subsubmenu.target}}">{{subsubmenu.title}}</a>
</li>
</ng-container>
</ul>
<li *ngIf="submenu.route.length == 0 && submenu.url.length == 0 && isEnabled(submenu.entitiesRequired,showEntity) && isEnabled(submenu.routeRequired, showPage)"
class="uk-nav-header">{{submenu.title}}</li>
</ng-container>
</ul>
</div>
</div>
</li>
</ng-container>
<ng-container *ngIf="isMenuEnabled && additionalMenuItems?.length > 0">
<ng-container *ngFor="let menu of additionalMenuItems">
2022-11-28 15:25:05 +01:00
<li class="uk-parent" [class.uk-active]="isTheActiveMenu(menu)" [ngClass]="menu.customClass">
<a *ngIf="menu.type == 'internal' && menu.route && isEnabled([menu.route], showPage)"
routerLink="{{menu.route}}"
[queryParams]="menu.params"
[fragment]="menu.fragment">
{{menu.title}}
</a>
<a *ngIf="menu.type == 'external' && menu.url"
href="{{menu.url}}"
target="_blank" class="custom-external">
{{menu.title}}
</a>
<a *ngIf="menu.type == 'noAction'">
{{menu.title}}
</a>
<div *ngIf="menu.items.length > 0" class="uk-navbar-dropdown uk-navbar-dropdown-bottom-left"
style="top: 80px; left: 0px;" id="{{menu._id}}" uk-toggle>
<div class="uk-navbar-dropdown-grid uk-child-width-1-1 uk-grid uk-grid-stack" uk-grid="">
<div class="uk-first-column uk-height-max-medium uk-overflow-auto">
<ul class="uk-nav uk-navbar-dropdown-nav">
<ng-container *ngFor="let submenu of menu.items">
2022-11-28 15:25:05 +01:00
<li [class.uk-active]="isTheActiveMenu(submenu)" [ngClass]="submenu.customClass">
<a *ngIf="submenu.type == 'internal' && submenu.route && isEnabled([submenu.route], showPage)"
routerLink="{{submenu.route}}"
[queryParams]="submenu.params"
[fragment]="submenu.fragment">
{{submenu.title}}
</a>
<a *ngIf="submenu.type == 'external' && submenu.url"
href="{{submenu.url}}"
target="_blank" class="custom-external">
{{submenu.title}}
</a>
</li>
</ng-container>
</ul>
</div>
</div>
2022-02-28 13:38:26 +01:00
</div>
</li>
</ng-container>
</ng-container>
</ul>
</ng-template>
</ng-container>
</nav>
</div>
</div>
</div>
<!-- New navbar for featured menu items only -->
<ng-container *ngIf="isFeaturedMenuEnabled && featuredMenuItems?.length > 0">
<div class="uk-background-primary uk-light">
<div class="uk-container uk-container-expand">
<div class="uk-navbar" uk-navbar="delay-hide: 400">
<div [ngClass]="'uk-navbar-'+featuredAlignment.toLowerCase()">
<ul class="uk-navbar-nav">
<ng-container *ngFor="let item of featuredMenuItems">
<li [class.uk-active]="isTheActiveMenu(item)" [ngClass]="item.customClass">
<a *ngIf="item.type == 'internal' && item.route && isEnabled([item.route], showPage)"
routerLink="{{item.route}}"
[queryParams]="item.params"
[fragment]="item.fragment">
{{item.title}}
</a>
<a *ngIf="item.type == 'external' && item.url"
href="{{item.url}}" class="custom-external"
target="_blank">
{{item.title}}
</a>
</li>
</ng-container>
</ul>
</div>
</div>
</div>
</div>
</ng-container>
</div>
</div>
<ng-template #header_template let-mobile="mobile">
<a *ngIf="!activeHeader.url" [routerLink]="activeHeader.route" [class.uk-padding-remove]="!isHeaderLeft"
2022-08-04 15:46:42 +02:00
class="uk-logo uk-navbar-item uk-flex uk-flex-middle uk-animation-scale-up">
<img *ngIf="(mobile && activeHeader.logoSmallUrl) || (!mobile && activeHeader.logoUrl)"
[src]="!mobile?activeHeader.logoUrl:activeHeader.logoSmallUrl"
[alt]="activeHeader.title">
<div *ngIf="activeHeader.logoInfo" class="uk-visible@l" [innerHTML]="activeHeader.logoInfo"></div>
<ng-container *ngIf="(mobile && !activeHeader.logoSmallUrl) || (!mobile && !activeHeader.logoUrl)">
<div class="multi-line-ellipsis lines-2" [style.max-width]="(!mobile)?'25vw':null" [title]="activeHeader.title">
<p class="uk-margin-remove">{{activeHeader.title}}</p>
</div>
</ng-container>
</a>
<a *ngIf="activeHeader.url" [href]="activeHeader.url" [class.uk-padding-remove]="!isHeaderLeft"
2022-08-04 15:46:42 +02:00
class="uk-logo uk-navbar-item uk-flex uk-flex-middle uk-animation-scale-up">
<img *ngIf="(mobile && activeHeader.logoSmallUrl) || (!mobile && activeHeader.logoUrl)"
[src]="!mobile?activeHeader.logoUrl:activeHeader.logoSmallUrl"
[alt]="activeHeader.title">
<div *ngIf="activeHeader.logoInfo" class="uk-visible@l" [innerHTML]="activeHeader.logoInfo"></div>
<ng-container *ngIf="(mobile && !activeHeader.logoSmallUrl) || (!mobile && !activeHeader.logoUrl)">
<div class="multi-line-ellipsis lines-2" [style.max-width]="(!mobile)?'25vw':null" [title]="activeHeader.title">
<p class="uk-margin-remove">{{activeHeader.title}}</p>
</div>
</ng-container>
</a>
</ng-template>