mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-10-27 17:16:14 +01:00
filter:middleware.render
This commit is contained in:
@@ -34,11 +34,6 @@ module.exports = function (middleware) {
|
||||
var ajaxifyData;
|
||||
async.waterfall([
|
||||
function (next) {
|
||||
plugins.fireHook('filter:' + template + '.build', {req: req, res: res, templateData: options}, next);
|
||||
},
|
||||
function (data, next) {
|
||||
options = data.templateData;
|
||||
|
||||
options.loggedIn = !!req.uid;
|
||||
options.relative_path = nconf.get('relative_path');
|
||||
options.template = {name: template};
|
||||
@@ -46,6 +41,14 @@ module.exports = function (middleware) {
|
||||
options.url = (req.baseUrl + req.path).replace(/^\/api/, '');
|
||||
options.bodyClass = buildBodyClass(req);
|
||||
|
||||
plugins.fireHook('filter:' + template + '.build', {req: req, res: res, templateData: options}, next);
|
||||
},
|
||||
function (data, next) {
|
||||
plugins.fireHook('filter.middleware.render', {req: res, res: res, templateData: data. templateData}, next);
|
||||
},
|
||||
function (data, next) {
|
||||
options = data.templateData;
|
||||
|
||||
res.locals.template = template;
|
||||
options._locals = undefined;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user