v1.18.x
psychobunny 11 years ago
parent 870bf95e5b
commit b12ca5ab9f

@ -14,6 +14,18 @@ define('forum/admin/themes', ['forum/admin/settings'], function(Settings) {
scriptEl.attr('src', '//bootswatch.aws.af.cm/3/?callback=bootswatchListener');
$('body').append(scriptEl);
$('#widgets .nav-pills a').on('click', function(ev) {
var $this = $(this);
$('#widgets .nav-pills li').removeClass('active');
$this.parent().addClass('active');
$('#widgets .tab-pane').removeClass('active');
$('#widgets .tab-pane[data-template="' + $this.attr('data-template') + '"]').addClass('active');
ev.preventDefault();
return false;
});
var bootstrapThemeContainer = $('#bootstrap_themes'),
installedThemeContainer = $('#installed_themes');

@ -148,7 +148,28 @@ adminController.themes.get = function(req, res, next) {
}
}
var templates = [],
list = {}, index = 0;
widgetData.areas.forEach(function(area) {
if (typeof list[area.template] === 'undefined') {
list[area.template] = index;
templates.push({
template: area.template,
areas: []
});
index++;
}
templates[list[area.template]].areas.push({
name: area.name,
location: area.location
});
});
res.render('admin/themes', {
templates: templates,
areas: widgetData.areas,
widgets: widgetData.widgets,
branding: branding

Loading…
Cancel
Save