Merge branch 'master' into acp-paper

Conflicts:
	package.json
v1.18.x
psychobunny 10 years ago
commit 3353fc8b0e

@ -51,7 +51,7 @@
"nodebb-theme-lavender": "1.0.52", "nodebb-theme-lavender": "1.0.52",
"nodebb-theme-persona": "2.0.17", "nodebb-theme-persona": "2.0.17",
"nodebb-theme-vanilla": "3.0.10", "nodebb-theme-vanilla": "3.0.10",
"nodebb-widget-essentials": "1.0.4", "nodebb-widget-essentials": "1.0.5",
"npm": "^2.1.4", "npm": "^2.1.4",
"passport": "^0.2.1", "passport": "^0.2.1",
"passport-local": "1.0.0", "passport-local": "1.0.0",

@ -5,6 +5,7 @@ var async = require('async'),
templates = require('templates.js'), templates = require('templates.js'),
plugins = require('../plugins'), plugins = require('../plugins'),
translator = require('../../public/src/modules/translator'),
db = require('../database'); db = require('../database');
var widgets = {}; var widgets = {};
@ -29,7 +30,6 @@ widgets.render = function(uid, area, callback) {
} }
async.map(widgetsByLocation[location], function(widget, next) { async.map(widgetsByLocation[location], function(widget, next) {
if (!widget || !widget.data || (!!widget.data['hide-registered'] && uid !== 0) || (!!widget.data['hide-guests'] && uid === 0)) { if (!widget || !widget.data || (!!widget.data['hide-registered'] && uid !== 0) || (!!widget.data['hide-guests'] && uid === 0)) {
return next(); return next();
} }
@ -48,14 +48,18 @@ widgets.render = function(uid, area, callback) {
} }
if (widget.data.container && widget.data.container.match('{body}')) { if (widget.data.container && widget.data.container.match('{body}')) {
translator.translate(widget.data.title, function(title) {
html = templates.parse(widget.data.container, { html = templates.parse(widget.data.container, {
title: widget.data.title, title: title,
body: html body: html
}); });
}
next(null, {html: html}); next(null, {html: html});
}); });
} else {
next(null, {html: html});
}
});
}, function(err, result) { }, function(err, result) {
done(err, {location: location, widgets: result.filter(Boolean)}); done(err, {location: location, widgets: result.filter(Boolean)});
}); });

Loading…
Cancel
Save