Skip to content

Node.js based forum software built for the modern web

closes #3069

psychobunny0150e0e063d2
diff --git a/public/language/en_GB/user.json b/public/language/en_GB/user.json
index 50d5dbf6c0..b11db877cb 100644
--- a/public/language/en_GB/user.json
+++ b/public/language/en_GB/user.json
@@ -97,5 +97,7 @@
"follow_topics_you_create": "Follow topics you create",
"grouptitle": "Select the group title you would like to display",
- "no-group-title": "No group title"
+ "no-group-title": "No group title",
+
+ "select-skin": "Select a Skin"
}
diff --git a/src/controllers/accounts.js b/src/controllers/accounts.js
index 1049f06269..fc49f31e1b 100644
--- a/src/controllers/accounts.js
+++ b/src/controllers/accounts.js
@@ -424,6 +424,82 @@ accountsController.accountSettings = function(req, res, next) {
{value: 'month', name: '[[user:digest_monthly]]', selected: 'month' === userData.settings.dailyDigestFreq}
];
+
+ userData.bootswatchSkinOptions = [
+ {
+ "name": "Default",
+ "value": "default"
+ },
+ {
+ "name": "Cerulean",
+ "value": "cerulean"
+ },
+ {
+ "name": "Cosmo",
+ "value": "cosmo"
+ },
+ {
+ "name": "Cyborg",
+ "value": "cyborg"
+ },
+ {
+ "name": "Darkly",
+ "value": "darkly"
+ },
+ {
+ "name": "Flatly",
+ "value": "flatly"
+ },
+ {
+ "name": "Journal",
+ "value": "journal"
+ },
+ {
+ "name": "Lumen",
+ "value": "lumen"
+ },
+ {
+ "name": "Paper",
+ "value": "paper"
+ },
+ {
+ "name": "Readable",
+ "value": "readable"
+ },
+ {
+ "name": "Sandstone",
+ "value": "sandstone"
+ },
+ {
+ "name": "Simplex",
+ "value": "simplex"
+ },
+ {
+ "name": "Slate",
+ "value": "slate"
+ },
+ {
+ "name": "Spacelab",
+ "value": "spacelab"
+ },
+ {
+ "name": "Superhero",
+ "value": "superhero"
+ },
+ {
+ "name": "United",
+ "value": "united"
+ },
+ {
+ "name": "Yeti",
+ "value": "yeti"
+ }
+ ];
+
+ userData.bootswatchSkinOptions.forEach(function(skin) {
+ skin.selected = skin.value === userData.settings.bootswatchSkin;
+ });
+
userData.userGroups.forEach(function(group) {
group.selected = group.name === userData.settings.groupTitle;
});
diff --git a/src/middleware/middleware.js b/src/middleware/middleware.js
index 930431f3c2..6bab0678e6 100644
--- a/src/middleware/middleware.js
+++ b/src/middleware/middleware.js
@@ -243,6 +243,11 @@ middleware.renderHeader = function(req, res, callback) {
if (err) {
return next(err);
}
+
+ if (settings.bootswatchSkin && settings.bootswatchSkin !== 'default') {
+ templateValues.bootswatchCSS = '//maxcdn.bootstrapcdn.com/bootswatch/latest/' + settings.bootswatchSkin + '/bootstrap.min.css';
+ }
+
meta.title.build(req.url.slice(1), settings.userLang, next);
});
} else {
diff --git a/src/user/settings.js b/src/user/settings.js
index ec493457aa..5af9f567c1 100644
--- a/src/user/settings.js
+++ b/src/user/settings.js
@@ -75,6 +75,7 @@ module.exports = function(User) {
settings.sendPostNotifications = parseInt(settings.sendPostNotifications, 10) === 1;
settings.restrictChat = parseInt(settings.restrictChat, 10) === 1;
settings.topicSearchEnabled = parseInt(settings.topicSearchEnabled, 10) === 1;
+ settings.bootswatchSkin = settings.bootswatchSkin || 'default';
callback(null, settings);
});
@@ -107,6 +108,7 @@ module.exports = function(User) {
sendPostNotifications: data.sendPostNotifications,
restrictChat: data.restrictChat,
topicSearchEnabled: data.topicSearchEnabled,
+ bootswatchSkin: data.bootswatchSkin,
groupTitle: data.groupTitle
}, next);
},