Navbar add rules if header menu and header is on center
This commit is contained in:
parent
d590732aba
commit
c2b6547b4c
|
@ -16,7 +16,6 @@
|
|||
[src]="'assets/common-assets/'+(properties.environment =='beta'?'beta_flag.svg':'prototype_flag.svg')"
|
||||
alt="BETA" style="height: 60px; width: 60px ">
|
||||
</div>
|
||||
<!-- class="uk-navbar-right"--> <!-- if we want to revert the menu - put it on the right -->
|
||||
<div *ngIf="!onlyTop || userMenu" class="uk-navbar-left">
|
||||
<a *ngIf="!offCanvasFlip" class="uk-navbar-toggle" href="#tm-mobile" uk-toggle="" style="z-index:1000;">
|
||||
<div uk-navbar-toggle-icon="" class="uk-navbar-toggle-icon uk-icon custom-navbar-toggle-icon"></div>
|
||||
|
@ -100,43 +99,6 @@
|
|||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!--<div *ngIf="(['explore','connect','monitor','provide','develop']).indexOf(portal)!=-1"
|
||||
class="tm-toolbar custom-{{portal}}-toolbar uk-visible@m">
|
||||
<div class="uk-container uk-flex uk-flex-middle uk-container-expand">
|
||||
<div class="uk-margin-auto-left">
|
||||
<div class="uk-grid-medium uk-child-width-auto uk-flex-middle uk-grid uk-grid-stack"
|
||||
uk-grid="margin: uk-margin-small-top">
|
||||
<div class="uk-first-column">
|
||||
<div class="uk-panel inner" id="module-119">
|
||||
<ul class="uk-subnav uk-subnav-line">
|
||||
<li><a [href]="'https://'+(properties.environment =='beta'?'beta':'www')+'.openaire.eu'" target="_blank"
|
||||
class="home-icon"><span class="uk-responsive-height">
|
||||
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"
|
||||
enable-background="new 0 0 20 20" height="20px" id="Layer_1" version="1.1"
|
||||
viewBox="0 0 48 48" width="20px" xml:space="preserve"><path id="home" clip-rule="evenodd" d="M44.715,23.711c-0.381,0.382-1,0.382-1.381,0l-8.939-8.938 c-0.064-0.051-0.119-0.106-0.17-0.171l-3.83-3.829c-0.064-0.051-0.119-0.106-0.17-0.171L24,4.377L4.667,23.711 c-0.381,0.382-1,0.382-1.381,0c-0.381-0.381-0.381-1,0-1.381L23.191,2.425c0.031-0.047,0.053-0.101,0.094-0.144 C23.482,2.085,23.742,1.994,24,2c0.258-0.006,0.518,0.084,0.715,0.281c0.043,0.042,0.062,0.096,0.096,0.144L30,7.616V4.997 c0,0,0,0,0,0c0-0.552,0.447-1,1-1h4c0.277,0,0.527,0.112,0.707,0.293C35.889,4.471,36,4.721,36,4.997v8.619l8.715,8.714 C45.096,22.711,45.096,23.33,44.715,23.711z M34,5.997h-2v3.619l2,2V5.997z M10,21.997c0.552,0,1,0.448,1,1v19c0,1.105,0.896,2,2,2 h6l0,0v-13c0-0.553,0.447-1,1-1h8c0.553,0,1,0.447,1,1v13l0,0h6c1.105,0,2-0.895,2-2v-19c0-0.552,0.447-1,1-1s1,0.448,1,1v19 c0,2.209-1.791,4-4,4H13c-2.209,0-4-1.791-4-4v-19C9,22.444,9.448,21.997,10,21.997z M27,43.996v-12h-6v12l0,0H27L27,43.996z" fill-rule="evenodd" fill="#fff"/></svg>
|
||||
</span><span class="visually-hidden">Home</span></a></li>
|
||||
<li [class]="(portal=='explore')?'custom-'+portal+'-li':''"><a
|
||||
[href]="'https://'+(properties.environment =='beta' || properties.environment =='development'?'beta.':'')+'explore.openaire.eu'"
|
||||
title="Search in OA. Link your research">Explore</a></li>
|
||||
<li [class]="(portal=='provide')?'custom-'+portal+'-li':''"><a
|
||||
[href]="'https://'+(properties.environment =='beta' || properties.environment =='development'?'beta.':'')+'provide.openaire.eu'"
|
||||
target="_blank" title="Content Provider Dashboard">Provide</a></li>
|
||||
<li [class]="(portal=='connect'||portal=='connect-admin')?'custom-'+portal+'-li':''"><a
|
||||
[href]="'https://'+(properties.environment =='beta' || properties.environment =='development' ?'beta.':'')+'connect.openaire.eu'"
|
||||
target="_blank" title="Research Community Dashboard">Connect</a></li>
|
||||
<li [class]="(portal=='monitor')?'custom-'+portal+'-li':''"><a
|
||||
[href]="'https://'+(properties.environment =='beta' || properties.environment =='development'?'beta.':'')+'monitor.openaire.eu'"
|
||||
target="_blank" title="Monitoring Dashboard">Monitor</a></li>
|
||||
<li [class]="(portal=='develop')?'custom-'+portal+'-li':''"><a href="https://develop.openaire.eu"
|
||||
target="_blank" title="APIs">Develop</a>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>-->
|
||||
<div *ngIf="specialAnnouncementContent" class="uk-visible@m" [innerHTML]="specialAnnouncementContent"></div>
|
||||
<div class="uk-visible@m">
|
||||
<div [class]="'uk-sticky uk-navbar-transparent '+portal+'-menu'"
|
||||
|
@ -150,23 +112,17 @@
|
|||
alt="BETA" style="height: 102px; width: 102px">
|
||||
</div>
|
||||
<nav class="uk-navbar uk-navbar-container" uk-navbar>
|
||||
<div *ngIf="showLogo && header.position== 'left'" class="uk-navbar-left uk-visible@l">
|
||||
<ng-container *ngTemplateOutlet="header_template; context: {mobile: false}"></ng-container>
|
||||
</div>
|
||||
<div *ngIf="showLogo && header.position == 'left'" class="uk-navbar-left uk-visible@m uk-hidden@l">
|
||||
<ng-container *ngTemplateOutlet="header_template; context: {mobile: false}"></ng-container>
|
||||
</div>
|
||||
<div *ngIf="showLogo && header.position == 'center' && header.menuPosition != 'center' "
|
||||
class="uk-margin-auto uk-visible@m">
|
||||
<ng-container *ngTemplateOutlet="header_template; context: {mobile: false}"></ng-container>
|
||||
</div>
|
||||
<!-- <div *ngIf="!onlyTop" class="uk-navbar-center"> -->
|
||||
<ng-container *ngIf="!onlyTop">
|
||||
<div *ngIf="showLogo && header.position == 'center' && header.menuPosition == 'center' "
|
||||
class="uk-margin-large-right uk-visible@m">
|
||||
<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="header.menuPosition === 'center'">
|
||||
<ng-container *ngTemplateOutlet="mainMenu"></ng-container>
|
||||
</ng-container>
|
||||
|
@ -300,7 +256,7 @@
|
|||
</div>
|
||||
</div>
|
||||
<ng-template #header_template let-mobile="mobile">
|
||||
<a *ngIf="!header.url" [routerLink]="header.route" [class.uk-padding-remove]="header.position !== 'left'"
|
||||
<a *ngIf="!header.url" [routerLink]="header.route" [class.uk-padding-remove]="!isHeaderLeft"
|
||||
class="uk-logo uk-navbar-item uk-text-center uk-text-bold">
|
||||
<img *ngIf="(mobile && header.logoSmallUrl) || (!mobile && header.logoUrl)"
|
||||
[src]="!mobile?header.logoUrl:header.logoSmallUrl"
|
||||
|
@ -312,7 +268,7 @@
|
|||
</div>
|
||||
</ng-container>
|
||||
</a>
|
||||
<a *ngIf="header.url" [href]="header.url" [class.uk-padding-remove]="header.position !== 'left'"
|
||||
<a *ngIf="header.url" [href]="header.url" [class.uk-padding-remove]="!isHeaderLeft"
|
||||
class="uk-logo uk-navbar-item uk-text-center uk-text-bold">
|
||||
<img *ngIf="(mobile && header.logoSmallUrl) || (!mobile && header.logoUrl)"
|
||||
[src]="!mobile?header.logoUrl:header.logoSmallUrl"
|
||||
|
|
|
@ -6,6 +6,7 @@ import {MenuItem, RootMenuItem} from './menu';
|
|||
import {EnvProperties} from '../utils/properties/env-properties';
|
||||
import {Subscription} from 'rxjs';
|
||||
import {HelpContentService} from '../services/help-content.service';
|
||||
import {properties} from "../../../environments/environment";
|
||||
|
||||
declare var UIkit;
|
||||
|
||||
|
@ -28,7 +29,7 @@ export interface Header {
|
|||
export class NavigationBarComponent implements OnInit, OnDestroy {
|
||||
@Input() portal: string = 'connect';
|
||||
@Input() dark: boolean = false;
|
||||
@Input() onlyTop: boolean;
|
||||
@Input() onlyTop: boolean = false;
|
||||
@Input() logoPath: string = 'assets/common-assets/';
|
||||
@Input() userMenu: boolean = true;
|
||||
@Input() showHomeMenuItem: boolean = false;
|
||||
|
@ -39,7 +40,7 @@ export class NavigationBarComponent implements OnInit, OnDestroy {
|
|||
@Input() header: Header;
|
||||
@Input() showMenu: boolean = true;
|
||||
@Input() homeurl: boolean = true;
|
||||
@Input() properties: EnvProperties;
|
||||
@Input() properties: EnvProperties = properties;
|
||||
@Input() user: User;
|
||||
@Input() enableSearch: boolean = false;
|
||||
@Input() searchRoute: string = '/search/find';
|
||||
|
@ -155,6 +156,10 @@ export class NavigationBarComponent implements OnInit, OnDestroy {
|
|||
console.error('NavigationBar (component): ' + message, error);
|
||||
}
|
||||
|
||||
get isHeaderLeft(): boolean {
|
||||
return this.header.position === 'left' || (this.header.position === 'center' && this.header.menuPosition === 'center' && this.menuItems.length > 0);
|
||||
}
|
||||
|
||||
get currentRoute() {
|
||||
return {
|
||||
route: this.router.url.split('?')[0].split('#')[0],
|
||||
|
|
Loading…
Reference in New Issue