diff --git a/public/src/forum/admin/settings.js b/public/src/forum/admin/settings.js index 8cb6ebfdae..2b59883d17 100644 --- a/public/src/forum/admin/settings.js +++ b/public/src/forum/admin/settings.js @@ -17,6 +17,8 @@ define('forum/admin/settings', ['uploader', 'sounds'], function(uploader, sounds return; } + setupPills(); + // Populate the fields on the page from the config var fields = $('#content [data-field]'), numFields = fields.length, @@ -91,12 +93,6 @@ define('forum/admin/settings', ['uploader', 'sounds'], function(uploader, sounds handleUploads(); - $('#settings-tab a').off('click').on('click', function (e) { - e.preventDefault(); - $(this).tab('show'); - return false; - }); - $('button[data-action="email.test"]').off('click').on('click', function() { socket.emit('admin.email.test', function(err) { app.alert({ @@ -131,6 +127,14 @@ define('forum/admin/settings', ['uploader', 'sounds'], function(uploader, sounds socket.emit('admin.config.remove', key); }; + function setupPills() { + $('.settings.nav-pills li').removeClass('active'); + + var slug = window.location.href.split('/'); + slug = slug[slug.length-1]; + $('.settings.nav-pills [data-pill="' + slug + '"]').addClass('active'); + } + function saveField(field, callback) { field = $(field); var key = field.attr('data-field'), diff --git a/src/controllers/admin.js b/src/controllers/admin.js index 8ba54380d8..2eac244d78 100644 --- a/src/controllers/admin.js +++ b/src/controllers/admin.js @@ -203,7 +203,7 @@ adminController.languages.get = function(req, res, next) { }; adminController.settings.get = function(req, res, next) { - res.render('admin/settings', { + res.render('admin/settings/' + req.params.term, { 'csrf': req.csrfToken() }); }; diff --git a/src/routes/admin.js b/src/routes/admin.js index b64208a3ba..a29610e0e2 100644 --- a/src/routes/admin.js +++ b/src/routes/admin.js @@ -39,12 +39,14 @@ function addRoutes(router, middleware, controllers) { //main router.get('/index', controllers.admin.home); router.get('/plugins', controllers.admin.plugins.get); - router.get('/settings', middleware.applyCSRF, controllers.admin.settings.get); router.get('/themes', controllers.admin.themes.get); router.get('/languages', controllers.admin.languages.get); router.get('/groups', controllers.admin.groups.get); router.get('/sounds', controllers.admin.sounds.get); + //settings + router.get('/settings/:term', middleware.applyCSRF, controllers.admin.settings.get); + //user router.get('/users', controllers.admin.users.search); router.get('/users/search', controllers.admin.users.search); diff --git a/src/views/admin/header.tpl b/src/views/admin/header.tpl index 3413788ac7..26e4decafa 100644 --- a/src/views/admin/header.tpl +++ b/src/views/admin/header.tpl @@ -60,7 +60,7 @@ Home
- Please ensure that you have installed a third-party emailer (e.g. PostageApp, Mailgun, Mandrill, SendGrid, etc), otherwise emails will not be sent by NodeBB -
-- The following email address refers to the email that the recipient will see in the "From" and "Reply To" fields. -
-- The test email will be sent to the currently logged in user's email address. -
-+ Please ensure that you have installed a third-party emailer (e.g. PostageApp, Mailgun, Mandrill, SendGrid, etc), otherwise emails will not be sent by NodeBB +
++ The following email address refers to the email that the recipient will see in the "From" and "Reply To" fields. +
++ The test email will be sent to the currently logged in user's email address. +
+- If no browser title is specified, the site title will be used -
- - -+ If no browser title is specified, the site title will be used +
+ + +- The following settings govern the functionality and/or appearance of the post composer shown - to users when they create new topics, or reply to existing topics. -
-+ The following settings govern the functionality and/or appearance of the post composer shown + to users when they create new topics, or reply to existing topics. +
+Use privilege thresholds to manage how much reputation a user must gain to receive moderator access.
- Leave blank if unsure. -
-+ Leave blank if unsure. +
+- If login attempts to a user's account exceeds this threshold, that account will be locked for a pre-configured amount of time -
-+ If login attempts to a user's account exceeds this threshold, that account will be locked for a pre-configured amount of time +
+