mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-11-01 19:46:01 +01:00
closes #5497
This commit is contained in:
@@ -42,7 +42,6 @@ module.exports = function (middleware) {
|
||||
middleware.renderHeader = function (req, res, data, callback) {
|
||||
var registrationType = meta.config.registrationType || 'normal';
|
||||
var templateValues = {
|
||||
bootswatchCSS: meta.config['theme:src'],
|
||||
title: meta.config.title || '',
|
||||
description: meta.config.description || '',
|
||||
'cache-buster': meta.config['cache-buster'] || '',
|
||||
@@ -117,9 +116,7 @@ module.exports = function (middleware) {
|
||||
results.user['email:confirmed'] = parseInt(results.user['email:confirmed'], 10) === 1;
|
||||
results.user.isEmailConfirmSent = !!results.isEmailConfirmSent;
|
||||
|
||||
if (res.locals.config && parseInt(meta.config.disableCustomUserSkins, 10) !== 1 && res.locals.config.bootswatchSkin !== 'default') {
|
||||
templateValues.bootswatchCSS = '//maxcdn.bootstrapcdn.com/bootswatch/latest/' + res.locals.config.bootswatchSkin + '/bootstrap.min.css';
|
||||
}
|
||||
setBootswatchCSS(templateValues, res.locals.config);
|
||||
|
||||
templateValues.browserTitle = controllers.helpers.buildTitle(data.title);
|
||||
templateValues.navigation = results.navigation;
|
||||
@@ -191,5 +188,21 @@ module.exports = function (middleware) {
|
||||
|
||||
return title;
|
||||
}
|
||||
|
||||
function setBootswatchCSS(obj, config) {
|
||||
if (config && config.bootswatchSkin !== 'default') {
|
||||
var skinToUse = '';
|
||||
|
||||
if (parseInt(meta.config.disableCustomUserSkins, 10) !== 1) {
|
||||
skinToUse = config.bootswatchSkin;
|
||||
} else if (meta.config.bootswatchSkin !== 'default') {
|
||||
skinToUse = meta.config.bootswatchSkin;
|
||||
}
|
||||
|
||||
if (skinToUse) {
|
||||
obj.bootswatchCSS = '//maxcdn.bootstrapcdn.com/bootswatch/latest/' + skinToUse + '/bootstrap.min.css';
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user