diff --git a/public/src/forum/admin/footer.js b/public/src/forum/admin/footer.js index 9459ab2b06..c2f02bcb80 100644 --- a/public/src/forum/admin/footer.js +++ b/public/src/forum/admin/footer.js @@ -21,8 +21,20 @@ define('forum/admin/footer', ['forum/admin/settings'], function(Settings) { setupACPSearch(); }); + + $(window).on('action:ajaxify.end', function() { + setupPills(); + }); }); + function setupPills() { + $('.nav-pills li').removeClass('active'); + + var slug = window.location.href.split('/'); + slug = slug[slug.length-1]; + $('.nav-pills [data-pill="' + slug + '"]').addClass('active'); + } + function setupACPSearch() { var menu = $('#acp-search .dropdown-menu'); diff --git a/public/src/forum/admin/settings.js b/public/src/forum/admin/settings.js index 2b59883d17..5d7b105250 100644 --- a/public/src/forum/admin/settings.js +++ b/public/src/forum/admin/settings.js @@ -17,8 +17,6 @@ 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, @@ -127,14 +125,6 @@ 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 e2dba6bc7b..26830961a1 100644 --- a/src/controllers/admin.js +++ b/src/controllers/admin.js @@ -21,7 +21,7 @@ var adminController = { tags: {}, topics: {}, groups: {}, - themes: {}, + appearance: {}, events: {}, database: {}, plugins: {}, @@ -214,7 +214,19 @@ adminController.logger.get = function(req, res, next) { res.render('admin/logger', {}); }; -adminController.themes.get = function(req, res, next) { +adminController.appearance.get = function(req, res, next) { + var term = req.params.term ? req.params.term : 'themes'; + + if (term === 'widgets') { + renderWidgets(req, res, next); + } else { + res.render('admin/appearance/' + term, {}); + } +}; + + +// todo: move to extend +function renderWidgets(req, res, next) { async.parallel({ areas: function(next) { var defaultAreas = [ @@ -264,14 +276,14 @@ adminController.themes.get = function(req, res, next) { }); }); - res.render('admin/themes', { + res.render('admin/appearance/widgets', { templates: templates, areas: widgetData.areas, widgets: widgetData.widgets }); }); }); -}; +} adminController.groups.get = function(req, res, next) { groups.list({ diff --git a/src/routes/admin.js b/src/routes/admin.js index 27ec8fcd06..4a56a37564 100644 --- a/src/routes/admin.js +++ b/src/routes/admin.js @@ -39,7 +39,7 @@ function addRoutes(router, middleware, controllers) { //main router.get('/index', controllers.admin.home); router.get('/plugins', controllers.admin.plugins.get); - router.get('/themes', controllers.admin.themes.get); + router.get('/appearance/:term?', controllers.admin.appearance.get); router.get('/languages', controllers.admin.languages.get); router.get('/groups', controllers.admin.groups.get); router.get('/sounds', controllers.admin.sounds.get); diff --git a/src/views/admin/appearance/customise.tpl b/src/views/admin/appearance/customise.tpl new file mode 100644 index 0000000000..5e1fbdd546 --- /dev/null +++ b/src/views/admin/appearance/customise.tpl @@ -0,0 +1,37 @@ + + +
+ You may also opt to enter your own CSS declarations here, which will be applied after all other styles. +
+ + + + +
+ You can enter custom HTML here (ex. JavaScript, Meta Tags, etc.) which will be appended to the <head> section of your forum's markup.
+
+ NodeBB's skins are powered by Bootswatch, a repository containing themes built + with Bootstrap as a base theme. Currently, the Vanilla base theme is best optimized for use with Bootswatch. +
++ This will remove any custom theme applied to your NodeBB, and restore the base theme. +
++ The following themes are currently installed in this NodeBB instance. +
+- The following themes are currently installed in this NodeBB instance. -
-- NodeBB's skins are powered by Bootswatch, a repository containing themes built - with Bootstrap as a base theme. Currently, the Vanilla base theme is best optimized for use with Bootswatch. -
-- This will remove any custom theme applied to your NodeBB, and restore the base theme. -
-- You may also opt to enter your own CSS declarations here, which will be applied after all other styles. -
- - - - -
- You can enter custom HTML here (ex. JavaScript, Meta Tags, etc.) which will be appended to the <head> section of your forum's markup.
-