1
0
mirror of https://github.com/stolksdorf/homebrewery.git synced 2025-12-15 23:35:57 +00:00

Adding in the print view button to the status bar

This commit is contained in:
Scott Tolksdorf
2016-01-13 17:06:09 -05:00
parent 1a3cd1d8ce
commit 8aca0ef0e8
4 changed files with 47 additions and 19 deletions

View File

@@ -67,6 +67,7 @@ var EditPage = React.createClass({
<Statusbar <Statusbar
editId={this.props.entry.editId} editId={this.props.entry.editId}
shareId={this.props.entry.shareId} shareId={this.props.entry.shareId}
printId={this.props.entry.shareId}
lastUpdated={this.state.lastUpdated} lastUpdated={this.state.lastUpdated}
isPending={this.state.pending} /> isPending={this.state.pending} />

View File

@@ -27,6 +27,7 @@ var SharePage = React.createClass({
<Statusbar <Statusbar
lastUpdated={this.props.entry.updatedAt} lastUpdated={this.props.entry.updatedAt}
views={this.props.entry.views} views={this.props.entry.views}
printId={this.props.entry.shareId}
/> />
<PageContainer text={this.props.entry.text} /> <PageContainer text={this.props.entry.text} />

View File

@@ -11,6 +11,7 @@ var Statusbar = React.createClass({
return { return {
//editId: null, //editId: null,
shareId : null, shareId : null,
printId : null,
isPending : false, isPending : false,
lastUpdated : null, lastUpdated : null,
info : null, info : null,
@@ -62,6 +63,14 @@ var Statusbar = React.createClass({
</a> </a>
}, },
renderPrintButton : function(){
if(!this.props.printId) return null;
return <a className='printField' key='print' href={'/homebrew/print/' + this.props.printId} target="_blank">
Print View <i className='fa fa-print' />
</a>
},
renderStatus : function(){ renderStatus : function(){
if(!this.props.editId) return null; if(!this.props.editId) return null;
@@ -87,6 +96,7 @@ var Statusbar = React.createClass({
<div className='controls right'> <div className='controls right'>
{this.renderStatus()} {this.renderStatus()}
{this.renderInfo()} {this.renderInfo()}
{this.renderPrintButton()}
{this.renderShare()} {this.renderShare()}
{this.renderNewButton()} {this.renderNewButton()}
</div> </div>

View File

@@ -1,38 +1,38 @@
.statusbar{ .statusbar{
position : fixed;
z-index : 1000;
height : 25px; height : 25px;
width : 100%;
background-color : black; background-color : black;
font-size : 24px; font-size : 24px;
position: fixed;
width :100%;
z-index : 1000;
color : white; color : white;
line-height : 1.0em; line-height : 1.0em;
border-bottom : 1px solid @grey; border-bottom : 1px solid @grey;
.logo{ .logo{
display : inline-block; display : inline-block;
vertical-align : middle; vertical-align : middle;
margin-top : -5px;
margin-right : 20px; margin-right : 20px;
margin-top: -5px;
svg{ svg{
margin-top: -6px; margin-top : -6px;
} }
} }
.left{ .left{
display : inline-block; display : inline-block;
vertical-align: top; vertical-align : top;
} }
.right{ .right{
float : right; float : right;
} }
.toolName{ .toolName{
vertical-align : middle; display : block;
font-family : CodeBold; vertical-align : middle;
text-decoration: none; font-family : CodeBold;
color: white; font-size : 16px;
display: block; color : white;
font-size : 16px; line-height : 30px;
line-height : 30px; text-decoration : none;
small{ small{
font-family : CodeBold; font-family : CodeBold;
} }
@@ -59,19 +59,35 @@
} }
} }
.shareField{ .shareField{
.animate(background-color);
cursor : pointer;
color : white; color : white;
text-decoration : none; text-decoration : none;
cursor : pointer;
.animate(background-color);
&:hover{ &:hover{
background-color : fade(@teal, 70%); background-color : fade(@teal, 70%);
} }
span{ span{
margin-right : 10px; margin-right : 5px;
} }
input{ input{
width : 100px; width : 100px;
font-size: 12px; font-size : 12px;
}
}
.printField{
.animate(background-color);
cursor : pointer;
color : white;
text-decoration : none;
&:hover{
background-color : fade(@orange, 70%);
}
span{
margin-right : 5px;
}
input{
width : 100px;
font-size : 12px;
} }
} }
} }