1
0
mirror of https://github.com/stolksdorf/homebrewery.git synced 2025-12-30 12:51:30 +00:00

got the changelog page working, yayyyyyyyyyy

This commit is contained in:
Scott
2016-02-19 20:14:28 -05:00
parent ac8579ccc9
commit 8d61a21fa7
8 changed files with 54 additions and 10 deletions

View File

@@ -1,25 +1,41 @@
## changelog # changelog
#### Tuesday, 16/02/2016, `v2.0.0` ## v1.3.0
### Friday, 19/02/2016
* Improved the admin panel
* Added ability to clear away old empty brews
* Added delete butotn to the edit page
* Added a dynamically updating changelog page! Nifty!
* Added stlying for wide monster stat blocks and single column class tables
* Added snippets for wide monster stat blocks and single column class tables
### Tuesday, 16/02/2016
* Paragraphs right after tables now indent (thanks LikeAJi6!) * Paragraphs right after tables now indent (thanks LikeAJi6!)
* Added a `@page` css rule to auto turn off margins when printing * Added a `@page` css rule to auto turn off margins when printing
* Added a `page-break` property on each `.phb` page to properly page the pages up when exporting (thanks Jokefury!) * Added a `page-break` property on each `.phb` page to properly page the pages up when exporting (thanks Jokefury!)
#### Sunday, 17/01/2016 ## v1.2.0
### Sunday, 17/01/2016
* Added a printer friendly snippet that injects some CSS to remove backbrounds and images * Added a printer friendly snippet that injects some CSS to remove backbrounds and images
* Adjusted the styling specific to spell blocks to give it tighter spacing * Adjusted the styling specific to spell blocks to give it tighter spacing
* Added a changelog! How meta! * Added a changelog! How meta!
#### Thursday, 14/01/2016 ## v1.1.0
### Thursday, 14/01/2016
* Added view source to see the markdown that made the page * Added view source to see the markdown that made the page
* Added print view * Added print view
* Fixed API issues that were causing the server to crash * Fixed API issues that were causing the server to crash
* Increased padding on table cells * Increased padding on table cells
* Raw html now shows in view source * Raw html now shows in view source
#### Wednesday, 3/01/2016
## v1.0.0 - Release
### Wednesday, 3/01/2016
* Added `phb.standalone.css` plus a build system for creating it * Added `phb.standalone.css` plus a build system for creating it
* Added page numbers and footer text * Added page numbers and footer text

View File

@@ -14,6 +14,7 @@ var Homebrew = React.createClass({
return { return {
url : "", url : "",
welcomeText : "", welcomeText : "",
changelog : "",
brew : { brew : {
text : "", text : "",
shareId : null, shareId : null,
@@ -28,9 +29,13 @@ var Homebrew = React.createClass({
'/homebrew/edit/:id' : (args) => { '/homebrew/edit/:id' : (args) => {
return <EditPage id={args.id} entry={this.props.brew} /> return <EditPage id={args.id} entry={this.props.brew} />
}, },
'/homebrew/share/:id' : (args) => { '/homebrew/share/:id' : (args) => {
return <SharePage id={args.id} entry={this.props.brew} /> return <SharePage id={args.id} entry={this.props.brew} />
}, },
'/homebrew/changelog' : (args) => {
return <SharePage entry={{text : this.props.changelog}} />
},
'/homebrew*' : <HomePage welcomeText={this.props.welcomeText} />, '/homebrew*' : <HomePage welcomeText={this.props.welcomeText} />,
}); });
}, },

View File

@@ -90,6 +90,14 @@ var Statusbar = React.createClass({
</a> </a>
}, },
renderChangelogButton : function(){
if(this.props.editId || this.props.shareId) return null;
return <a className='changelogButton' target='_blank' href='/homebrew/changelog'>
Changelog <i className='fa fa-file-text-o' />
</a>
},
renderShare : function(){ renderShare : function(){
if(!this.props.shareId) return null; if(!this.props.shareId) return null;
@@ -138,6 +146,7 @@ var Statusbar = React.createClass({
</a> </a>
</div> </div>
<div className='controls right'> <div className='controls right'>
{this.renderChangelogButton()}
{this.renderStatus()} {this.renderStatus()}
{this.renderInfo()} {this.renderInfo()}
{this.renderSourceButton()} {this.renderSourceButton()}

View File

@@ -58,6 +58,14 @@
background-color : fade(@green, 70%); background-color : fade(@green, 70%);
} }
} }
.changelogButton{
.animate(background-color);
color : white;
text-decoration : none;
&:hover{
background-color : fade(@purple, 70%);
}
}
.deleteButton{ .deleteButton{
.animate(background-color); .animate(background-color);
color : white; color : white;

View File

@@ -18,13 +18,14 @@ var Router = CreateRouter({
var NaturalCrit = React.createClass({ var NaturalCrit = React.createClass({
getDefaultProps: function() { getDefaultProps: function() {
return { return {
url : '/' url : '/',
changelog : ''
}; };
}, },
render : function(){ render : function(){
return <div className='naturalCrit'> return <div className='naturalCrit'>
<Router initialUrl={this.props.url} /> <Router initialUrl={this.props.url} scope={this}/>
</div> </div>
}, },
}); });

View File

@@ -1,7 +1,7 @@
{ {
"name": "naturalCrit", "name": "naturalCrit",
"description": "A super rad project!", "description": "A super rad project!",
"version": "0.0.0", "version": "1.3.0",
"scripts": { "scripts": {
"postinstall": "gulp prod", "postinstall": "gulp prod",
"start": "node server.js" "start": "node server.js"
@@ -21,7 +21,7 @@
"moment": "^2.11.0", "moment": "^2.11.0",
"mongoose": "^4.3.3", "mongoose": "^4.3.3",
"pico-flux": "^1.1.0", "pico-flux": "^1.1.0",
"pico-router": "^1.0.0", "pico-router": "^1.1.0",
"react": "^0.14.2", "react": "^0.14.2",
"react-dom": "^0.14.2", "react-dom": "^0.14.2",
"shortid": "^2.2.4", "shortid": "^2.2.4",

View File

@@ -10,6 +10,8 @@ app.use(bodyParser.json());
//Mongoose //Mongoose
var mongoose = require('mongoose'); var mongoose = require('mongoose');
var mongoUri = process.env.MONGOLAB_URI || process.env.MONGOHQ_URL || 'mongodb://localhost/naturalcrit'; var mongoUri = process.env.MONGOLAB_URI || process.env.MONGOHQ_URL || 'mongodb://localhost/naturalcrit';

View File

@@ -3,6 +3,8 @@ var Moment = require('moment');
var vitreumRender = require('vitreum/render'); var vitreumRender = require('vitreum/render');
var HomebrewModel = require('./homebrew.model.js').model; var HomebrewModel = require('./homebrew.model.js').model;
var changelogText = require('fs').readFileSync('./changelog.md', 'utf8');
var getTopBrews = function(cb){ var getTopBrews = function(cb){
HomebrewModel.find().sort({views: -1}).limit(5).exec(function(err, brews) { HomebrewModel.find().sort({views: -1}).limit(5).exec(function(err, brews) {
@@ -166,7 +168,8 @@ module.exports = function(app){
prerenderWith : './client/homebrew/homebrew.jsx', prerenderWith : './client/homebrew/homebrew.jsx',
initialProps: { initialProps: {
url: req.originalUrl, url: req.originalUrl,
welcomeText : welcomeText welcomeText : welcomeText,
changelog : changelogText
}, },
clearRequireCache : true, clearRequireCache : true,
}, function (err, page) { }, function (err, page) {