groups pages WIP

v1.18.x
Julian Lam 11 years ago
parent 66701afdaa
commit 7bdbb966aa

@ -0,0 +1,19 @@
"use strict";
var groups = require('../groups'),
groupsController = {};
groupsController.list = function(req, res) {
groups.list({
truncateUserList: true,
expand: true
}, function(err, groups) {
console.log(groups);
res.render('groups/list', {
groups: groups
});
});
};
module.exports = groupsController;

@ -4,6 +4,7 @@ var topicsController = require('./topics'),
categoriesController = require('./categories'),
tagsController = require('./tags'),
usersController = require('./users'),
groupsController = require('./groups'),
accountsController = require('./accounts'),
staticController = require('./static'),
apiController = require('./api'),
@ -11,22 +12,21 @@ var topicsController = require('./topics'),
async = require('async'),
nconf = require('nconf'),
auth = require('./../routes/authentication'),
meta = require('./../meta'),
user = require('./../user'),
posts = require('./../posts'),
topics = require('./../topics'),
plugins = require('./../plugins'),
categories = require('./../categories'),
auth = require('../routes/authentication'),
meta = require('../meta'),
user = require('../user'),
posts = require('../posts'),
topics = require('../topics'),
plugins = require('../plugins'),
categories = require('../categories'),
privileges = require('../privileges');
var Controllers = {
topics: topicsController,
categories: categoriesController,
tags: tagsController,
users: usersController,
groups: groupsController,
accounts: accountsController,
static: staticController,
api: apiController,
@ -241,7 +241,7 @@ Controllers.confirmEmail = function(req, res, next) {
};
Controllers.sitemap = function(req, res, next) {
var sitemap = require('./../sitemap.js');
var sitemap = require('../sitemap.js');
sitemap.render(function(xml) {
res.header('Content-Type', 'application/xml');

@ -136,6 +136,10 @@ function userRoutes(app, middleware, controllers) {
app.get('/api/users/search', middleware.checkGlobalPrivacySettings, controllers.users.getUsersForSearch);
}
function groupRoutes(app, middleware, controllers) {
app.get('/groups', middleware.buildHeader, controllers.groups.list);
}
module.exports = function(app, middleware) {
app.namespace(nconf.get('relative_path'), function() {
@ -165,7 +169,7 @@ module.exports = function(app, middleware) {
categoryRoutes(app, middleware, controllers);
accountRoutes(app, middleware, controllers);
userRoutes(app, middleware, controllers);
groupRoutes(app, middleware, controllers);
});
if (process.env.NODE_ENV === 'development') {

Loading…
Cancel
Save