|
@@ -252,8 +252,6 @@ module.exports = function(crowi, app) {
|
|
|
tree: [],
|
|
tree: [],
|
|
|
pageRelatedGroup: null,
|
|
pageRelatedGroup: null,
|
|
|
template: null,
|
|
template: null,
|
|
|
- childrenTemplateExists: false,
|
|
|
|
|
- decendantsTemplateExists: false,
|
|
|
|
|
};
|
|
};
|
|
|
|
|
|
|
|
var pageTeamplate = 'customlayout-selector/page';
|
|
var pageTeamplate = 'customlayout-selector/page';
|
|
@@ -285,10 +283,6 @@ module.exports = function(crowi, app) {
|
|
|
.then(function() {
|
|
.then(function() {
|
|
|
return Page.checkIfTemplatesExist(originalPath);
|
|
return Page.checkIfTemplatesExist(originalPath);
|
|
|
})
|
|
})
|
|
|
- .then(function(templateInfo) {
|
|
|
|
|
- renderVars.childrenTemplateExists = templateInfo.childrenTemplateExists;
|
|
|
|
|
- renderVars.decendantsTemplateExists = templateInfo.decendantsTemplateExists;
|
|
|
|
|
- })
|
|
|
|
|
.then(() => {
|
|
.then(() => {
|
|
|
return PageGroupRelation.findByPage(renderVars.page);
|
|
return PageGroupRelation.findByPage(renderVars.page);
|
|
|
})
|
|
})
|
|
@@ -463,8 +457,6 @@ module.exports = function(crowi, app) {
|
|
|
page: pageData,
|
|
page: pageData,
|
|
|
revision: pageData.revision || {},
|
|
revision: pageData.revision || {},
|
|
|
author: pageData.revision.author || false,
|
|
author: pageData.revision.author || false,
|
|
|
- childrenTemplateExists: false,
|
|
|
|
|
- decendantsTemplateExists: false,
|
|
|
|
|
};
|
|
};
|
|
|
var userPage = isUserPage(pageData.path);
|
|
var userPage = isUserPage(pageData.path);
|
|
|
var userData = null;
|
|
var userData = null;
|
|
@@ -509,12 +501,6 @@ module.exports = function(crowi, app) {
|
|
|
}
|
|
}
|
|
|
}).then(function() {
|
|
}).then(function() {
|
|
|
return interceptorManager.process('beforeRenderPage', req, res, renderVars);
|
|
return interceptorManager.process('beforeRenderPage', req, res, renderVars);
|
|
|
- }).then(function() {
|
|
|
|
|
- return Page.checkIfTemplatesExist(pageData.path)
|
|
|
|
|
- .then(function(templateInfo) {
|
|
|
|
|
- renderVars.childrenTemplateExists = templateInfo.childrenTemplateExists;
|
|
|
|
|
- renderVars.decendantsTemplateExists = templateInfo.decendantsTemplateExists;
|
|
|
|
|
- });
|
|
|
|
|
}).then(function() {
|
|
}).then(function() {
|
|
|
var defaultPageTeamplate = 'customlayout-selector/page';
|
|
var defaultPageTeamplate = 'customlayout-selector/page';
|
|
|
if (userData) {
|
|
if (userData) {
|
|
@@ -1205,10 +1191,7 @@ module.exports = function(crowi, app) {
|
|
|
const templateFinder = Page.checkIfTemplatesExist(pagePath);
|
|
const templateFinder = Page.checkIfTemplatesExist(pagePath);
|
|
|
|
|
|
|
|
templateFinder.then(function(templateInfo) {
|
|
templateFinder.then(function(templateInfo) {
|
|
|
- var result = {};
|
|
|
|
|
- result.templateInfo = templateInfo;
|
|
|
|
|
-
|
|
|
|
|
- return res.json(ApiResponse.success(result));
|
|
|
|
|
|
|
+ return res.json(ApiResponse.success(templateInfo));
|
|
|
}).catch(function(err) {
|
|
}).catch(function(err) {
|
|
|
return res.json(ApiResponse.error(err));
|
|
return res.json(ApiResponse.error(err));
|
|
|
});
|
|
});
|