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'), categoriesController = require('./categories'),
tagsController = require('./tags'), tagsController = require('./tags'),
usersController = require('./users'), usersController = require('./users'),
groupsController = require('./groups'),
accountsController = require('./accounts'), accountsController = require('./accounts'),
staticController = require('./static'), staticController = require('./static'),
apiController = require('./api'), apiController = require('./api'),
@ -11,22 +12,21 @@ var topicsController = require('./topics'),
async = require('async'), async = require('async'),
nconf = require('nconf'), nconf = require('nconf'),
auth = require('./../routes/authentication'), auth = require('../routes/authentication'),
meta = require('./../meta'), meta = require('../meta'),
user = require('./../user'), user = require('../user'),
posts = require('./../posts'), posts = require('../posts'),
topics = require('./../topics'), topics = require('../topics'),
plugins = require('./../plugins'), plugins = require('../plugins'),
categories = require('./../categories'), categories = require('../categories'),
privileges = require('../privileges'); privileges = require('../privileges');
var Controllers = { var Controllers = {
topics: topicsController, topics: topicsController,
categories: categoriesController, categories: categoriesController,
tags: tagsController, tags: tagsController,
users: usersController, users: usersController,
groups: groupsController,
accounts: accountsController, accounts: accountsController,
static: staticController, static: staticController,
api: apiController, api: apiController,
@ -241,7 +241,7 @@ Controllers.confirmEmail = function(req, res, next) {
}; };
Controllers.sitemap = function(req, res, next) { Controllers.sitemap = function(req, res, next) {
var sitemap = require('./../sitemap.js'); var sitemap = require('../sitemap.js');
sitemap.render(function(xml) { sitemap.render(function(xml) {
res.header('Content-Type', 'application/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); 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) { module.exports = function(app, middleware) {
app.namespace(nconf.get('relative_path'), function() { app.namespace(nconf.get('relative_path'), function() {
@ -165,7 +169,7 @@ module.exports = function(app, middleware) {
categoryRoutes(app, middleware, controllers); categoryRoutes(app, middleware, controllers);
accountRoutes(app, middleware, controllers); accountRoutes(app, middleware, controllers);
userRoutes(app, middleware, controllers); userRoutes(app, middleware, controllers);
groupRoutes(app, middleware, controllers);
}); });
if (process.env.NODE_ENV === 'development') { if (process.env.NODE_ENV === 'development') {

Loading…
Cancel
Save