Commit bc3d82ec authored by prumde's avatar prumde

Added breadcrumbs component


git-svn-id: http://15.206.35.175/svn/proteus/business-java/trunk@174350 ce508802-f39f-4f6c-b175-0d175dae99d5
parent 603a00bc
.ecm-breadcrumbs {
/* font-size: .85em; */
color: #000;
line-height: 1.5;
/* margin: 20px; */
padding-left: 0;
margin: 0;
list-style-type: none;
}
.ecm-breadcrumbs li {
display: inline;
list-style-type: none;
margin-left: 0;
}
.ecm-breadcrumbs li:before {
content: "/";
padding-left: 5px;
padding-right: 5px;
color: mediumvioletred;
}
.ecm-breadcrumbs li:first-child:before {
content: "";
padding-right: 5px;
}
.ecm-breadcrumbs li a {
background-color: transparent;
color: mediumvioletred;
text-decoration: none;
cursor: pointer;
}
.ecm-breadcrumbs li a:hover {
color: rgba(199, 21, 133, 0.45);
}
.row.sub-heading {
top: 60px;
position: relative;
background: #ffffff;
max-width: 100rem;
padding-left: 3rem;
box-shadow: 0 0 5px 2px rgba(0, 0, 0, 0.1);
}
.img-back-32 {
/*content: url(../../assets/images/w_user_32_32.png);*/
content: url(../../assets/images/svg/back_32_32.svg);
}
.fixed-header-back {
position: absolute;
padding: 0;
height: 20px !important;
width: 20px !important;
box-shadow: 0 0 0 3px rgba(0 ,0 ,0, 0.1), inset 0 0 0px 20px rgba(0 ,0, 0, 0.1);
cursor: pointer;
border-radius: 100%;
margin-left: -2rem !important;
}
.ecm-section-info {
padding: 8px;
}
\ No newline at end of file
<div class="row sub-heading">
<div class="ecm-section-info" >
<img class="fixed-header-back img-back-32" (click) = "backClicked();" />
<ul class="ecm-breadcrumbs">
<li *ngFor="let breadcrumb of breadcrumbs">
<a [routerLink]="[breadcrumb.url]">{{breadcrumb.label}}</a>
</li>
</ul>
</div>
</div>
\ No newline at end of file
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
import { EcmBreadcrumbsComponent } from './ecm-breadcrumbs.component';
describe('EcmBreadcrumbsComponent', () => {
let component: EcmBreadcrumbsComponent;
let fixture: ComponentFixture<EcmBreadcrumbsComponent>;
beforeEach(async(() => {
TestBed.configureTestingModule({
declarations: [ EcmBreadcrumbsComponent ]
})
.compileComponents();
}));
beforeEach(() => {
fixture = TestBed.createComponent(EcmBreadcrumbsComponent);
component = fixture.componentInstance;
fixture.detectChanges();
});
it('should create', () => {
expect(component).toBeTruthy();
});
});
import { Component, OnInit, Input } from '@angular/core';
import { Location } from '@angular/common';
interface IBreadcrumb {
label: string;
url: string;
}
@Component({
selector: 'app-ecm-breadcrumbs',
templateUrl: './ecm-breadcrumbs.component.html',
styleUrls: ['./ecm-breadcrumbs.component.css']
})
export class EcmBreadcrumbsComponent implements OnInit {
@Input() pageName;
breadcrumbs:IBreadcrumb[] = [];
constructor( private _location: Location) { }
ngOnInit() { console.log(this.pageName);
if(this.pageName == 'SUB_CATEGORY')
{
//this.breadcrumb = "Home / " + category.shDescr;
let category_shDescr=localStorage.getItem('CATEGORY_SH_DESCR');
this.breadcrumbs = [];
this.breadcrumbs.push( {
label: 'Home',
url: '/home'
} );
this.breadcrumbs.push( {
label: category_shDescr,
url: 'javascript:void(0)'
} );
}
if(this.pageName == 'ITEMS')
{
let catCode = localStorage.getItem('CATEGORY_CAT_CODE');
let catShDescr = localStorage.getItem('CATEGORY_SH_DESCR');
let subcatShDescr = localStorage.getItem('SUBCATEGORY_SH_DESCR');
this.breadcrumbs = [];
this.breadcrumbs.push( {
label: 'Home',
url: '/home'
} );
this.breadcrumbs.push( {
label: catShDescr,
url: '/list/SUB_CATEGORY/' + catCode
} );
this.breadcrumbs.push( {
label: subcatShDescr,
url: 'javascript:void(0)'
} );
//[ '/list','SUB_CATEGORY',category.catCode]
//this.breadcrumb = "Home / " + catShDescr + subcategory.shDescr;
//Use for Detail Page
/*
this.breadcrumbs.push( {
label: subcategory.shDescr,
params: ['ITEMS',scatCode],
url: '/list'
} );*/
}
if(this.pageName == 'SEARCH')
{
this.breadcrumbs = [];
this.breadcrumbs.push( {
label: 'Home',
url: '/home'
} );
this.breadcrumbs.push( {
label: 'Search',
url: 'javascript:void(0)'
} );
}
}
backClicked() {
this._location.back();
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment