nodebb-plugin-groups-autoas.../library.js

46 lines
1.1 KiB
JavaScript
Raw Normal View History

2014-06-04 20:08:24 +00:00
"use strict";
var plugin = {};
plugin.init = function(params, callback) {
2014-06-04 20:08:24 +00:00
console.log('nodebb-plugin-quickstart: loaded');
var app = params.app,
middleware = params.middleware,
controllers = params.controllers;
// We create two routes for every view. One API call, and the actual route itself.
// Just add the buildHeader middleware to your route and NodeBB will take care of everything for you.
app.get('/admin/plugins/quickstart', middleware.admin.buildHeader, renderAdmin);
app.get('/api/admin/plugins/quickstart', renderAdmin);
2014-07-28 16:39:55 +00:00
callback();
2014-06-04 20:08:24 +00:00
};
plugin.addAdminNavigation = function(header, callback) {
header.plugins.push({
route: '/plugins/quickstart',
icon: 'fa-tint',
name: 'Quickstart'
});
callback(null, header);
};
function renderAdmin(req, res, next) {
/*
Make sure the route matches your path to template exactly.
If your route was:
myforum.com/some/complex/route/
your template should be:
templates/some/complex/route.tpl
and you would render it like so:
res.render('some/complex/route'); */
res.render('admin/plugins/quickstart', {});
}
2014-06-04 20:08:24 +00:00
module.exports = plugin;