nodebb-theme-lavender
Advanced tools
Comparing version 5.0.8 to 5.0.9
105
lib/theme.js
@@ -1,68 +0,65 @@ | ||
(function(module) { | ||
"use strict"; | ||
"use strict"; | ||
var theme = {}, | ||
meta = module.parent.require('./meta'), | ||
path = module.parent.require('path'), | ||
nconf = module.parent.require('nconf'); | ||
var path = require('path'); | ||
theme.defineWidgetAreas = function(areas, callback) { | ||
areas = areas.concat([ | ||
{ | ||
name: "Categories Sidebar", | ||
template: "categories.tpl", | ||
location: "sidebar" | ||
}, | ||
{ | ||
name: "Category Sidebar", | ||
template: "category.tpl", | ||
location: "sidebar" | ||
}, | ||
{ | ||
name: "Topic Sidebar", | ||
template: "topic.tpl", | ||
location: "sidebar" | ||
} | ||
]); | ||
var meta = require.main.require('./src/meta'); | ||
var nconf = require.main.require('nconf'); | ||
callback(null, areas); | ||
}; | ||
var theme = module.exports; | ||
theme.preinit = function(params, callback) { | ||
nconf.set('base_templates_path', path.join(nconf.get('themes_path'), 'nodebb-theme-vanilla/templates')); | ||
theme.defineWidgetAreas = function(areas, callback) { | ||
areas = areas.concat([ | ||
{ | ||
name: "Categories Sidebar", | ||
template: "categories.tpl", | ||
location: "sidebar" | ||
}, | ||
{ | ||
name: "Category Sidebar", | ||
template: "category.tpl", | ||
location: "sidebar" | ||
}, | ||
{ | ||
name: "Topic Sidebar", | ||
template: "topic.tpl", | ||
location: "sidebar" | ||
} | ||
]); | ||
callback(); | ||
}; | ||
callback(null, areas); | ||
}; | ||
theme.init = function(params, callback) { | ||
var app = params.router, | ||
middleware = params.middleware; | ||
theme.preinit = function(params, callback) { | ||
nconf.set('base_templates_path', path.join(nconf.get('themes_path'), 'nodebb-theme-vanilla/templates')); | ||
app.get('/admin/plugins/lavender', middleware.admin.buildHeader, renderAdmin); | ||
app.get('/api/admin/plugins/lavender', renderAdmin); | ||
callback(); | ||
}; | ||
callback(); | ||
}; | ||
theme.init = function(params, callback) { | ||
var app = params.router, | ||
middleware = params.middleware; | ||
theme.addAdminNavigation = function(header, callback) { | ||
header.plugins.push({ | ||
route: '/plugins/lavender', | ||
icon: 'fa-paint-brush', | ||
name: 'Lavender Theme' | ||
}); | ||
app.get('/admin/plugins/lavender', middleware.admin.buildHeader, renderAdmin); | ||
app.get('/api/admin/plugins/lavender', renderAdmin); | ||
callback(null, header); | ||
}; | ||
callback(); | ||
}; | ||
theme.getConfig = function(config, callback) { | ||
config.disableMasonry = !!parseInt(meta.config.disableMasonry, 10); | ||
callback(false, config); | ||
}; | ||
theme.addAdminNavigation = function(header, callback) { | ||
header.plugins.push({ | ||
route: '/plugins/lavender', | ||
icon: 'fa-paint-brush', | ||
name: 'Lavender Theme' | ||
}); | ||
function renderAdmin(req, res, next) { | ||
res.render('admin/plugins/lavender', {}); | ||
} | ||
callback(null, header); | ||
}; | ||
module.exports = theme; | ||
theme.getConfig = function(config, callback) { | ||
config.disableMasonry = !!parseInt(meta.config.disableMasonry, 10); | ||
callback(false, config); | ||
}; | ||
}(module)); | ||
function renderAdmin(req, res, next) { | ||
res.render('admin/plugins/lavender', {}); | ||
} |
{ | ||
"name": "nodebb-theme-lavender", | ||
"version": "5.0.8", | ||
"version": "5.0.9", | ||
"description": "Lavender Theme for NodeBB", | ||
@@ -5,0 +5,0 @@ "main": "theme.less", |
254243
3359