|
|
@@ -311,10 +311,7 @@ module.exports = function(crowi, app) {
|
|
|
.catch(function(err) {
|
|
|
pageTeamplate = 'customlayout-selector/not_found';
|
|
|
|
|
|
- const templatePath = cutOffLastSlash(originalPath);
|
|
|
- const pathList = generatePathsOnTree(originalPath, []);
|
|
|
-
|
|
|
- return Page.findTemplate(pathList, templatePath)
|
|
|
+ return Page.findTemplate(originalPath)
|
|
|
.then(template => {
|
|
|
renderVars.template = template;
|
|
|
});
|
|
|
@@ -367,22 +364,6 @@ module.exports = function(crowi, app) {
|
|
|
});
|
|
|
};
|
|
|
|
|
|
- const cutOffLastSlash = path => {
|
|
|
- const lastSlash = path.lastIndexOf('/');
|
|
|
- return path.substr(0, lastSlash);
|
|
|
- };
|
|
|
-
|
|
|
- const generatePathsOnTree = (path, pathList) => {
|
|
|
- const newPath = cutOffLastSlash(path);
|
|
|
-
|
|
|
- if (newPath === '') {
|
|
|
- return pathList;
|
|
|
- }
|
|
|
-
|
|
|
- pathList.push(newPath);
|
|
|
- return generatePathsOnTree(newPath, pathList);
|
|
|
- };
|
|
|
-
|
|
|
actions.deletedPageListShow = function(req, res) {
|
|
|
var path = '/trash' + getPathFromRequest(req);
|
|
|
var limit = 50;
|