Skip to content

Commit

Permalink
Merge branch 'master' into fixBrowseEndpoint
Browse files Browse the repository at this point in the history
  • Loading branch information
cjmyers authored Dec 20, 2024
2 parents 6dc365e + d2a025c commit 7a4854d
Showing 1 changed file with 29 additions and 6 deletions.
35 changes: 29 additions & 6 deletions lib/views/admin/theme.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,20 +7,40 @@ const extend = require('xtend')

module.exports = function (req, res) {
if (req.method === 'POST') {
if (req.body.showModuleInteractions) {
if (req.body.showModuleInteractions &&
(req.body.showModuleInteractions === 'on' || req.body.showModuleInteractions === 'true')) {
config.set('showModuleInteractions', true)
} else {
} else if (req.body.showModuleInteractions &&
(req.body.showModuleInteractions === 'off' || req.body.showModuleInteractions === 'false')) {
config.set('showModuleInteractions', false)
} else if (req.body.showModuleInteractions === undefined) {
config.set('showModuleInteractions', false)
} else {
config.set('showModuleInteractions', true) // default state
}
if (req.body.removePublicEnabled) {

if (req.body.removePublicEnabled &&
(req.body.removePublicEnabled === 'on' || req.body.removePublicEnabled === 'true')) {
config.set('removePublicEnabled', true)
} else {
} else if (req.body.removePublicEnabled &&
(req.body.removePublicEnabled === 'off' || req.body.removePublicEnabled === 'false')) {
config.set('removePublicEnabled', false)
} else if (req.body.removePublicEnabled === undefined) {
config.set('removePublicEnabled', false)
} else {
config.set('removePublicEnabled', true) // default state
}
if (req.body.requireLogin) {

if (req.body.requireLogin &&
(req.body.requireLogin === 'on' || req.body.requireLogin === 'true')) {
config.set('requireLogin', true)
} else {
} else if (req.body.requireLogin &&
(req.body.requireLogin === 'off' || req.body.requireLogin === 'false')) {
config.set('requireLogin', false)
} else if (req.body.requireLogin === undefined) {
config.set('requireLogin', false)
} else {
config.set('requireLogin', false) // default state
}
post(req, res)
} else {
Expand All @@ -47,6 +67,9 @@ function form (req, res) {
frontPageText: config.get('frontPageText'),
firstLaunch: config.get('firstLaunch'),
altHome: config.get('altHome'),
showModuleInteractions: config.get('showModuleInteractions'),
removePublicEnabled: config.get('removePublicEnabled'),
requireLogin: config.get('requireLogin'),
currentTheme: currentTheme,
themeParameters: themeParameters
}
Expand Down

0 comments on commit 7a4854d

Please sign in to comment.