|
@@ -439,6 +439,35 @@ module.exports = function(crowi, app) {
|
|
|
return showPageForGrowiBehavior(req, res, next);
|
|
return showPageForGrowiBehavior(req, res, next);
|
|
|
};
|
|
};
|
|
|
|
|
|
|
|
|
|
+ actions.showSharePage = async function(req, res, next) {
|
|
|
|
|
+ const { path } = req.params;
|
|
|
|
|
+
|
|
|
|
|
+ const layoutName = configManager.getConfig('crowi', 'customize:layout');
|
|
|
|
|
+ let view = `layout-${layoutName}/page`;
|
|
|
|
|
+
|
|
|
|
|
+ // TODO
|
|
|
|
|
+ const page = {};
|
|
|
|
|
+
|
|
|
|
|
+ const limit = 50;
|
|
|
|
|
+ const offset = parseInt(req.query.offset) || 0;
|
|
|
|
|
+ const renderVars = {};
|
|
|
|
|
+
|
|
|
|
|
+ addRendarVarsForPage(renderVars, page);
|
|
|
|
|
+ addRendarVarsForScope(renderVars, page);
|
|
|
|
|
+
|
|
|
|
|
+ await addRenderVarsForSlack(renderVars, page);
|
|
|
|
|
+ await addRenderVarsForDescendants(renderVars, path, req.user, offset, limit, true);
|
|
|
|
|
+
|
|
|
|
|
+ if (isUserPage(page.path)) {
|
|
|
|
|
+ // change template
|
|
|
|
|
+ view = `layout-${layoutName}/user_page`;
|
|
|
|
|
+ await addRenderVarsForUserPage(renderVars, page, req.user);
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ await interceptorManager.process('beforeRenderPage', req, res, renderVars);
|
|
|
|
|
+ return res.render(view, renderVars);
|
|
|
|
|
+ };
|
|
|
|
|
+
|
|
|
/**
|
|
/**
|
|
|
* switch action by behaviorType
|
|
* switch action by behaviorType
|
|
|
*/
|
|
*/
|