mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-11-03 04:25:55 +01:00
Refactor skins to be built on server-side (#6849)
* WIP * using bootswatch from npm instead of bootswatch CDN url * feat: on-demand client css building for skins * added ability for client-side to select a skin * updated loading and saving logic of bootstrapSkin on client side user settings * fix: broken test for #6849
This commit is contained in:
@@ -141,7 +141,7 @@ module.exports = function (middleware) {
|
||||
results.user['email:confirmed'] = results.user['email:confirmed'] === 1;
|
||||
results.user.isEmailConfirmSent = !!results.isEmailConfirmSent;
|
||||
|
||||
setBootswatchCSS(templateValues, res.locals.config);
|
||||
templateValues.bootswatchSkin = parseInt(meta.config.disableCustomUserSkins, 10) !== 1 ? res.locals.config.bootswatchSkin || '' : '';
|
||||
|
||||
var unreadCount = {
|
||||
topic: results.unreadCounts[''] || 0,
|
||||
@@ -272,21 +272,5 @@ module.exports = function (middleware) {
|
||||
|
||||
return title;
|
||||
}
|
||||
|
||||
function setBootswatchCSS(obj, config) {
|
||||
if (config && config.bootswatchSkin !== 'noskin') {
|
||||
var skinToUse = '';
|
||||
|
||||
if (!meta.config.disableCustomUserSkins) {
|
||||
skinToUse = config.bootswatchSkin;
|
||||
} else if (meta.config.bootswatchSkin) {
|
||||
skinToUse = meta.config.bootswatchSkin;
|
||||
}
|
||||
|
||||
if (skinToUse) {
|
||||
obj.bootswatchCSS = '//maxcdn.bootstrapcdn.com/bootswatch/3.3.7/' + skinToUse + '/bootstrap.min.css';
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user