mirror of
https://github.com/akveo/ngx-admin.git
synced 2025-12-17 07:50:12 +01:00
content top component
This commit is contained in:
parent
aae6dbcc23
commit
9fa15f15f0
6 changed files with 78 additions and 2 deletions
|
|
@ -3,13 +3,13 @@ import {RouteConfig, Router} from 'angular2/router';
|
||||||
|
|
||||||
import {Dashboard} from './dashboard';
|
import {Dashboard} from './dashboard';
|
||||||
import {Ui} from './ui';
|
import {Ui} from './ui';
|
||||||
import {PageTop, Sidebar} from '../theme';
|
import {PageTop, ContentTop, Sidebar} from '../theme';
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'pages',
|
selector: 'pages',
|
||||||
encapsulation: ViewEncapsulation.None,
|
encapsulation: ViewEncapsulation.None,
|
||||||
styles: [],
|
styles: [],
|
||||||
directives: [PageTop, Sidebar],
|
directives: [PageTop, Sidebar, ContentTop],
|
||||||
template: `
|
template: `
|
||||||
<sidebar></sidebar>
|
<sidebar></sidebar>
|
||||||
<page-top></page-top>
|
<page-top></page-top>
|
||||||
|
|
|
||||||
25
src/app/theme/contentTop/contentTop.component.ts
Normal file
25
src/app/theme/contentTop/contentTop.component.ts
Normal file
|
|
@ -0,0 +1,25 @@
|
||||||
|
import {Component, ViewEncapsulation} from 'angular2/core';
|
||||||
|
|
||||||
|
import {ThemeGlobal} from "../theme.global";
|
||||||
|
import {Subscription} from "rxjs/Subscription";
|
||||||
|
|
||||||
|
@Component({
|
||||||
|
selector: 'content-top',
|
||||||
|
styles: [require('./contentTop.scss')],
|
||||||
|
template: require('./contentTop.html'),
|
||||||
|
})
|
||||||
|
export class ContentTop {
|
||||||
|
activePageTitle = '';
|
||||||
|
private _themeGlobalSubscription:Subscription;
|
||||||
|
|
||||||
|
constructor(private _themeGlobal:ThemeGlobal) {
|
||||||
|
this._themeGlobalSubscription = this._themeGlobal.getDataStream().subscribe((data) => {
|
||||||
|
this.activePageTitle = data['menu.activeLink'] != null ? data['menu.activeLink'].title : this.activePageTitle;
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
ngOnDestroy() {
|
||||||
|
// prevent memory leak when component destroyed
|
||||||
|
this._themeGlobalSubscription.unsubscribe();
|
||||||
|
}
|
||||||
|
}
|
||||||
9
src/app/theme/contentTop/contentTop.html
Normal file
9
src/app/theme/contentTop/contentTop.html
Normal file
|
|
@ -0,0 +1,9 @@
|
||||||
|
<div class="content-top clearfix">
|
||||||
|
<h1 class="al-title">{{ activePageTitle }}</h1>
|
||||||
|
|
||||||
|
<ul class="breadcrumb al-breadcrumb">
|
||||||
|
<li>
|
||||||
|
<a href="#/dashboard">Home</a></li>
|
||||||
|
<li>{{ activePageTitle }}</li>
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
40
src/app/theme/contentTop/contentTop.scss
Normal file
40
src/app/theme/contentTop/contentTop.scss
Normal file
|
|
@ -0,0 +1,40 @@
|
||||||
|
@import '../sass/conf/conf';
|
||||||
|
|
||||||
|
.content-top {
|
||||||
|
padding-top: 13px;
|
||||||
|
padding-bottom: 27px;
|
||||||
|
}
|
||||||
|
|
||||||
|
h1.al-title {
|
||||||
|
font-weight: $font-bold;
|
||||||
|
color: #ffffff;
|
||||||
|
float: left;
|
||||||
|
width: auto;
|
||||||
|
margin: 0;
|
||||||
|
padding: 0;
|
||||||
|
font-size: 24px;
|
||||||
|
text-transform: uppercase;
|
||||||
|
opacity: 0.9;
|
||||||
|
}
|
||||||
|
|
||||||
|
.al-breadcrumb {
|
||||||
|
background: none;
|
||||||
|
color: #ffffff;
|
||||||
|
padding: 0;
|
||||||
|
margin: 0;
|
||||||
|
float: right;
|
||||||
|
padding-top: 11px;
|
||||||
|
li {
|
||||||
|
font-size: 18px;
|
||||||
|
font-weight: $font-light;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.al-look {
|
||||||
|
float: right;
|
||||||
|
margin-right: 10px;
|
||||||
|
padding-top: 10px;
|
||||||
|
> a {
|
||||||
|
font-size: 19px;
|
||||||
|
}
|
||||||
|
}
|
||||||
1
src/app/theme/contentTop/index.ts
Normal file
1
src/app/theme/contentTop/index.ts
Normal file
|
|
@ -0,0 +1 @@
|
||||||
|
export * from './contentTop.component';
|
||||||
|
|
@ -1,3 +1,4 @@
|
||||||
export * from './pageTop';
|
export * from './pageTop';
|
||||||
export * from './msgCenter';
|
export * from './msgCenter';
|
||||||
export * from './sidebar';
|
export * from './sidebar';
|
||||||
|
export * from './contentTop';
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue