mirror of
https://github.com/naturalcrit/homebrewery.git
synced 2026-01-14 23:42:41 +00:00
Adding the brew title to the print page title, so downloads are named properly
This commit is contained in:
@@ -3,6 +3,8 @@ const _ = require('lodash');
|
|||||||
const cx = require('classnames');
|
const cx = require('classnames');
|
||||||
const Markdown = require('homebrewery/markdown.js');
|
const Markdown = require('homebrewery/markdown.js');
|
||||||
|
|
||||||
|
const Headtags = require('vitreum/headtags');
|
||||||
|
|
||||||
const PrintPage = React.createClass({
|
const PrintPage = React.createClass({
|
||||||
getDefaultProps: function() {
|
getDefaultProps: function() {
|
||||||
return {
|
return {
|
||||||
@@ -30,7 +32,7 @@ const PrintPage = React.createClass({
|
|||||||
}
|
}
|
||||||
if(this.props.query.dialog) window.print();
|
if(this.props.query.dialog) window.print();
|
||||||
},
|
},
|
||||||
//TODO: This is pretty bad
|
//TODO: Print page shouldn't replicate functionality in brew renderer
|
||||||
renderStyle : function(){
|
renderStyle : function(){
|
||||||
if(!this.state.brew.style) return;
|
if(!this.state.brew.style) return;
|
||||||
return <style>{this.state.brew.style.replace(/;/g, ' !important;')}</style>
|
return <style>{this.state.brew.style.replace(/;/g, ' !important;')}</style>
|
||||||
@@ -45,8 +47,17 @@ const PrintPage = React.createClass({
|
|||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
|
||||||
|
renderPrintInstructions : function(){
|
||||||
|
return <div className='printInstructions'>
|
||||||
|
Hey, I'm really cool instructions!!!!!
|
||||||
|
|
||||||
|
</div>
|
||||||
|
},
|
||||||
|
|
||||||
render : function(){
|
render : function(){
|
||||||
return <div>
|
return <div className='printPage'>
|
||||||
|
<Headtags.title>{this.state.brew.title}</Headtags.title>
|
||||||
|
{this.renderPrintInstructions()}
|
||||||
{this.renderStyle()}
|
{this.renderStyle()}
|
||||||
{this.renderPages()}
|
{this.renderPages()}
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -1,3 +1,17 @@
|
|||||||
.printPage{
|
|
||||||
|
|
||||||
|
.printPage{
|
||||||
|
position : relative;
|
||||||
|
@media print{
|
||||||
|
.printInstructions{
|
||||||
|
display : none;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
.printInstructions{
|
||||||
|
position : absolute;
|
||||||
|
top : 0px;
|
||||||
|
right : 0px;
|
||||||
|
z-index : 100000;
|
||||||
|
padding : 30px;
|
||||||
|
background-color : @blue;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
Reference in New Issue
Block a user