|
|
@@ -178,6 +178,8 @@ module.exports = function(crowi, app) {
|
|
|
|
|
|
if (portalPage) {
|
|
|
renderVars.revision = portalPage.revision;
|
|
|
+ renderVars.revisionHackmdSynced = portalPage.revisionHackmdSynced;
|
|
|
+ renderVars.pageIdOnHackmd = portalPage.pageIdOnHackmd;
|
|
|
return Revision.findRevisionList(portalPage.path, {});
|
|
|
}
|
|
|
else {
|
|
|
@@ -227,25 +229,25 @@ module.exports = function(crowi, app) {
|
|
|
};
|
|
|
|
|
|
actions.pageShowForCrowiPlus = function(req, res) {
|
|
|
- var path = getPathFromRequest(req);
|
|
|
+ const path = getPathFromRequest(req);
|
|
|
|
|
|
- var limit = 50;
|
|
|
- var offset = parseInt(req.query.offset) || 0;
|
|
|
- var SEENER_THRESHOLD = 10;
|
|
|
+ const limit = 50;
|
|
|
+ const offset = parseInt(req.query.offset) || 0;
|
|
|
+ const SEENER_THRESHOLD = 10;
|
|
|
|
|
|
// index page
|
|
|
- var pagerOptions = {
|
|
|
+ const pagerOptions = {
|
|
|
offset: offset,
|
|
|
limit: limit
|
|
|
};
|
|
|
- var queryOptions = {
|
|
|
+ const queryOptions = {
|
|
|
offset: offset,
|
|
|
limit: limit + 1,
|
|
|
isPopulateRevisionBody: Config.isEnabledTimeline(config),
|
|
|
includeDeletedPage: path.startsWith('/trash/'),
|
|
|
};
|
|
|
|
|
|
- var renderVars = {
|
|
|
+ const renderVars = {
|
|
|
path: path,
|
|
|
page: null,
|
|
|
revision: {},
|
|
|
@@ -254,11 +256,12 @@ module.exports = function(crowi, app) {
|
|
|
tree: [],
|
|
|
pageRelatedGroup: null,
|
|
|
template: null,
|
|
|
+ revisionHackmdSynced: null,
|
|
|
};
|
|
|
|
|
|
- var pageTeamplate = 'customlayout-selector/page';
|
|
|
+ let pageTeamplate = 'customlayout-selector/page';
|
|
|
|
|
|
- var isRedirect = false;
|
|
|
+ let isRedirect = false;
|
|
|
Page.findPage(path, req.user, req.query.revision)
|
|
|
.then(function(page) {
|
|
|
debug('Page found', page._id, page.path);
|
|
|
@@ -276,6 +279,8 @@ module.exports = function(crowi, app) {
|
|
|
renderVars.path = page.path;
|
|
|
renderVars.revision = page.revision;
|
|
|
renderVars.author = page.revision.author;
|
|
|
+ renderVars.revisionHackmdSynced = page.revisionHackmdSynced;
|
|
|
+ renderVars.pageIdOnHackmd = page.pageIdOnHackmd;
|
|
|
|
|
|
return Revision.findRevisionList(page.path, {})
|
|
|
.then(function(tree) {
|
|
|
@@ -290,8 +295,8 @@ module.exports = function(crowi, app) {
|
|
|
}
|
|
|
})
|
|
|
.then(function() {
|
|
|
- var userPage = isUserPage(page.path);
|
|
|
- var userData = null;
|
|
|
+ const userPage = isUserPage(page.path);
|
|
|
+ let userData = null;
|
|
|
|
|
|
if (userPage) {
|
|
|
// change template
|