update core to allow composer to define static route

v1.18.x
Julian Lam 9 years ago
parent 59c350e63c
commit d67efa3a5b

@ -43,7 +43,7 @@
"mongodb": "~2.1.3",
"morgan": "^1.3.2",
"nconf": "~0.8.2",
"nodebb-plugin-composer-default": "1.0.26",
"nodebb-plugin-composer-default": "2.0.0",
"nodebb-plugin-dbsearch": "0.3.1",
"nodebb-plugin-emoji-extended": "0.4.17",
"nodebb-plugin-markdown": "4.0.10",

@ -0,0 +1,19 @@
'use strict';
/* globals define */
define('forum/compose', [], function() {
var Compose = {};
Compose.init = function() {
var container = $('.composer');
if (container.length) {
$(window).trigger('action:composer.enhance', {
container: container
});
}
}
return Compose;
});

@ -156,14 +156,22 @@ Controllers.register = function(req, res, next) {
};
Controllers.compose = function(req, res, next) {
if (req.query.p && !res.locals.isAPI) {
if (req.query.p.startsWith(nconf.get('relative_path'))) {
req.query.p = req.query.p.replace(nconf.get('relative_path'), '');
plugins.fireHook('filter:composer.build', {
req: req,
res: res,
next: next,
templateData: {}
}, function(err, data) {
if (err) {
return next(err);
}
return helpers.redirect(res, req.query.p);
}
res.render('', {});
if (data.templateData.disabled) {
res.render('', {});
} else {
res.render('compose', data.templateData);
}
});
};
Controllers.confirmEmail = function(req, res, next) {

Loading…
Cancel
Save