mirror of
https://github.com/ether/etherpad-lite.git
synced 2025-04-20 15:36:16 -04:00
Add req
to EJS render args when possible
This makes it possible for EJS templates and `eejsBlock_*` hook functions to access the user's express-session state.
This commit is contained in:
parent
cf43156390
commit
ed5a635f4c
4 changed files with 11 additions and 14 deletions
|
@ -8,13 +8,12 @@ const UpdateCheck = require('ep_etherpad-lite/node/utils/UpdateCheck');
|
|||
|
||||
exports.expressCreateServer = function(hook_name, args, cb) {
|
||||
args.app.get('/admin/plugins', function(req, res) {
|
||||
var render_args = {
|
||||
res.send(eejs.require('ep_etherpad-lite/templates/admin/plugins.html', {
|
||||
plugins: plugins.plugins,
|
||||
req,
|
||||
search_results: {},
|
||||
errors: [],
|
||||
};
|
||||
|
||||
res.send(eejs.require("ep_etherpad-lite/templates/admin/plugins.html", render_args));
|
||||
}));
|
||||
});
|
||||
|
||||
args.app.get('/admin/plugins/info', function(req, res) {
|
||||
|
@ -24,7 +23,8 @@ exports.expressCreateServer = function(hook_name, args, cb) {
|
|||
res.send(eejs.require("ep_etherpad-lite/templates/admin/plugins-info.html", {
|
||||
gitCommit: gitCommit,
|
||||
epVersion: epVersion,
|
||||
latestVersion: UpdateCheck.getLatestVersion()
|
||||
latestVersion: UpdateCheck.getLatestVersion(),
|
||||
req,
|
||||
}));
|
||||
});
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue