summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorClaudius Coenen2018-11-05 00:35:48 +0100
committerGitHub2018-11-05 00:35:48 +0100
commit64e9dfd7140a90ca388eed3e0c26df800850e799 (patch)
tree05a313b4a9526547b8b1782b9094135e2064d6d1 /lib
parent637f955bddabf953778d27ffe348683bf1c27653 (diff)
parent44ffc564da1dd20b2fae3247d9fa314a52e0aaca (diff)
Merge pull request #1035 from ccoenen/feature/global-site-layout-vars
removing global site layout vars from individual routers
Diffstat (limited to 'lib')
-rw-r--r--lib/response.js52
1 files changed, 2 insertions, 50 deletions
diff --git a/lib/response.js b/lib/response.js
index 4f572e47..3cbd3203 100644
--- a/lib/response.js
+++ b/lib/response.js
@@ -55,12 +55,10 @@ var response = {
function responseError (res, code, detail, msg) {
res.status(code).render('error.ejs', {
- url: config.serverURL,
title: code + ' ' + detail + ' ' + msg,
code: code,
detail: detail,
- msg: msg,
- useCDN: config.useCDN
+ msg: msg
})
}
@@ -69,26 +67,6 @@ function showIndex (req, res, next) {
var deleteToken = ''
var data = {
- url: config.serverURL,
- useCDN: config.useCDN,
- allowAnonymous: config.allowAnonymous,
- allowAnonymousEdits: config.allowAnonymousEdits,
- facebook: config.isFacebookEnable,
- twitter: config.isTwitterEnable,
- github: config.isGitHubEnable,
- gitlab: config.isGitLabEnable,
- mattermost: config.isMattermostEnable,
- dropbox: config.isDropboxEnable,
- google: config.isGoogleEnable,
- ldap: config.isLDAPEnable,
- ldapProviderName: config.ldap.providerName,
- saml: config.isSAMLEnable,
- oauth2: config.isOAuth2Enable,
- oauth2ProviderName: config.oauth2.providerName,
- email: config.isEmailEnable,
- allowEmailRegister: config.allowEmailRegister,
- allowPDFExport: config.allowPDFExport,
- openID: config.isOpenIDEnable,
signin: authStatus,
infoMessage: req.flash('info'),
errorMessage: req.flash('error'),
@@ -124,27 +102,7 @@ function responseCodiMD (res, note) {
'X-Robots-Tag': 'noindex, nofollow' // prevent crawling
})
res.render('codimd.ejs', {
- url: config.serverURL,
- title: title,
- useCDN: config.useCDN,
- allowAnonymous: config.allowAnonymous,
- allowAnonymousEdits: config.allowAnonymousEdits,
- facebook: config.isFacebookEnable,
- twitter: config.isTwitterEnable,
- github: config.isGitHubEnable,
- gitlab: config.isGitLabEnable,
- mattermost: config.isMattermostEnable,
- dropbox: config.isDropboxEnable,
- google: config.isGoogleEnable,
- ldap: config.isLDAPEnable,
- ldapProviderName: config.ldap.providerName,
- oauth2ProviderName: config.oauth2.providerName,
- saml: config.isSAMLEnable,
- oauth2: config.isOAuth2Enable,
- email: config.isEmailEnable,
- allowEmailRegister: config.allowEmailRegister,
- allowPDFExport: config.allowPDFExport,
- openID: config.isOpenIDEnable
+ title: title
})
}
@@ -254,16 +212,13 @@ function showPublishNote (req, res, next) {
var updatetime = note.lastchangeAt
var title = models.Note.decodeTitle(note.title)
title = models.Note.generateWebTitle(meta.title || title)
- var origin = config.serverURL
var data = {
title: title,
description: meta.description || (markdown ? models.Note.generateDescription(markdown) : null),
viewcount: note.viewcount,
createtime: createtime,
updatetime: updatetime,
- url: origin,
body: body,
- useCDN: config.useCDN,
owner: note.owner ? note.owner.id : null,
ownerprofile: note.owner ? models.User.getProfile(note.owner) : null,
lastchangeuser: note.lastchangeuser ? note.lastchangeuser.id : null,
@@ -634,18 +589,15 @@ function showPublishSlide (req, res, next) {
var updatetime = note.lastchangeAt
var title = models.Note.decodeTitle(note.title)
title = models.Note.generateWebTitle(meta.title || title)
- var origin = config.serverURL
var data = {
title: title,
description: meta.description || (markdown ? models.Note.generateDescription(markdown) : null),
viewcount: note.viewcount,
createtime: createtime,
updatetime: updatetime,
- url: origin,
body: markdown,
theme: meta.slideOptions && utils.isRevealTheme(meta.slideOptions.theme),
meta: JSON.stringify(extracted.meta),
- useCDN: config.useCDN,
owner: note.owner ? note.owner.id : null,
ownerprofile: note.owner ? models.User.getProfile(note.owner) : null,
lastchangeuser: note.lastchangeuser ? note.lastchangeuser.id : null,