Skip to content

Commit

Permalink
Fixes #64, #62, #60
Browse files Browse the repository at this point in the history
  • Loading branch information
claudioc committed Jan 26, 2015
1 parent f565a35 commit 2d9d9bc
Show file tree
Hide file tree
Showing 5 changed files with 28 additions and 18 deletions.
7 changes: 7 additions & 0 deletions ChangeLog.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
Version 1.2.9, January 26th, 2014
=================================

- Fixes #64 (crash serving favicon)
- Fixes #62 (missing titles on new and edit)
- Fixes #60 (no sidebar on login page)

Version 1.2.8, December 15th, 2014
=================================

Expand Down
4 changes: 2 additions & 2 deletions jingo
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
* Jingo, wiki engine
* http://github.com/claudioc/jingo
*
* Copyright 2014 Claudio Cicali <claudio.cicali@gmail.com>
* Copyright 2015 Claudio Cicali <claudio.cicali@gmail.com>
* Released under the MIT license
*/
var program = require('commander'),
Expand All @@ -18,7 +18,7 @@ var program = require('commander'),

global.Git = require('./lib/gitmech');

program.version('1.2.8')
program.version('1.2.9')
.option('-c, --config <path>', 'Specify the config file')
.option('-#, --hash-string <string>', 'Create an hash for a string')
.option('-l, --local', 'Listen on localhost only')
Expand Down
31 changes: 16 additions & 15 deletions lib/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ module.exports.initialize = function(config) {
if (config.get("application").loggingMode) {
app.use(logger(config.get("application").loggingMode == 1 ? "combined" : "dev", {skip: function() { }}));
}
app.use(favicon("public/favicon.ico"));
app.use(favicon(path.join(__dirname + "/../", 'public', 'favicon.ico')))
app.use(bodyParser.urlencoded({extended: true, limit: "500kb"}));
app.use(methodOverride(function(req, res){
if (req.body && typeof req.body === 'object' && '_method' in req.body) {
Expand Down Expand Up @@ -135,21 +135,22 @@ module.exports.initialize = function(config) {
res.locals._style = components.customStyle();
res.locals._script = components.customScript();

if (null === req.url.match(/^\/auth\//) &&
null === req.url.match(/^\/misc\//) &&
null === req.url.match(/^\/login/)) {
components.sidebarAsync().then(function(content) {
res.locals._sidebar = content;
return components.footerAsync();
}).then(function(content) {
res.locals._footer = content;
next();
}).catch(function(e) {
console.log(e);
});
} else {
next();
if ( /^\/auth\//.test(req.url) ||
/^\/misc\//.test(req.url) ||
(/^\/login/.test(req.url) && !config.get('authorization').anonRead)
) {
return next();
}

components.sidebarAsync().then(function(content) {
res.locals._sidebar = content;
return components.footerAsync();
}).then(function(content) {
res.locals._footer = content;
return next();
}).catch(function(e) {
console.log(e);
});
});

app.use(passport.initialize());
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "jingo",
"version": "1.2.8",
"version": "1.2.9",
"description": "A nodejs based wiki engine (sort of Gollum port)",
"author": "Claudio Cicali <claudio.cicali@gmail.com>",
"keywords": [
Expand Down
2 changes: 2 additions & 0 deletions routes/pages.js
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ function _getPagesNew(req, res) {
delete req.session.formData;

res.render("create", {
title: "Jingo – Create page " + title,
pageTitle: title,
pageName: page ? page.wikiname : ""
});
Expand Down Expand Up @@ -257,6 +258,7 @@ function _getPagesEdit(req, res) {
delete req.session.formData;

res.render('edit', {
title: "Jingo – Edit page " + page.title,
page: page,
warning: warning
});
Expand Down

0 comments on commit 2d9d9bc

Please sign in to comment.