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