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

Fixed saving authors and systems to brews

This commit is contained in:
Scott Tolksdorf
2017-01-19 12:06:14 -05:00
parent c417c1aa0c
commit 70346ffce7
4 changed files with 27 additions and 5 deletions

View File

@@ -1,10 +1,12 @@
# changelog
### Tuesday, 17/01/2017 - v2.7cont
- Added in code position to brew page jumping
### Thursday, 19/01/2017 - v2.7.0
- Fixed saving multiple authors and multiple systems on brew metadata (thanks u/PalaNolho re:282)
- Adding in line highlight for new pages
### Saturday, 14/01/2017 - v2.7.0cont
- - Added a new Render Warning overlay. It detects situations where the brew may not be rendering correctly (wrong browser, browser is zoomed in...) and let's the user know
### Saturday, 14/01/2017 - v2.7.0
- Added a new Render Warning overlay. It detects situations where the brew may not be rendering correctly (wrong browser, browser is zoomed in...) and let's the user know
### Sunday, 25/12/2016 - v2.7.0

View File

@@ -73,6 +73,22 @@ const Editor = React.createClass({
return r;
}, 1);
},
highlightPageLines : function(){
if(!this.refs.codeEditor) return;
const codeMirror = this.refs.codeEditor.codeMirror;
const lineNumbers = _.reduce(this.props.value.split('\n'), (r, line, lineNumber)=>{
if(line.indexOf('\\page') !== -1){
codeMirror.addLineClass(lineNumber, 'background', 'pageLine');
r.push(lineNumber);
}
return r;
}, []);
return lineNumbers
},
brewJump : function(){
const currentPage = this.getCurrentPage();
window.location.hash = 'p' + currentPage;

View File

@@ -44,7 +44,7 @@ const Snippetbar = React.createClass({
{this.renderSnippetGroups()}
<div className={cx('toggleMeta', {selected: this.props.showmeta})}
onClick={this.props.onToggle}>
<i className='fa fa-settings' />
<i className='fa fa-bars' />
</div>
</div>
}

View File

@@ -63,6 +63,10 @@ router.put('/api/update/:id', (req, res)=>{
brew = _.merge(brew, req.body);
brew.updatedAt = new Date();
if(req.account) brew.authors = _.uniq(_.concat(brew.authors, req.account.username));
brew.markModified('authors');
brew.markModified('systems');
brew.save((err, obj)=>{
if(err) throw err;
return res.status(200).send(obj);