v1.18.x
Julian Lam 11 years ago
parent 37bd88d1b2
commit fdd2dc322b

@ -10,12 +10,12 @@
<div class="col-lg-8"> <div class="col-lg-8">
<h2>{groups.name}</h2> <h2>{groups.name}</h2>
<p>{groups.description}</p> <p>{groups.description}</p>
<!-- IF groups.deletable -->
<div class="btn-group"> <div class="btn-group">
<button class="btn btn-default" data-action="members">Members</button> <button class="btn btn-default" data-action="members">Members</button>
<!-- IF groups.deletable -->
<button class="btn btn-danger" data-action="delete">Delete Group</button> <button class="btn btn-danger" data-action="delete">Delete Group</button>
<!-- ENDIF groups.deletable -->
</div> </div>
<!-- ENDIF groups.deletable -->
</div> </div>
<div class="col-lg-4"> <div class="col-lg-4">
<ul class="pull-right members"> <ul class="pull-right members">

@ -70,7 +70,7 @@
results.base.count = results.users.length; results.base.count = results.users.length;
results.base.members = results.users; results.base.members = results.users;
results.base.deletable = parseInt(results.base.gid, 10) !== 1; results.base.deletable = results.base.hidden !== '1';
callback(err, results.base); callback(err, results.base);
}); });

@ -2,6 +2,7 @@ var nconf = require('nconf'),
fs = require('fs'), fs = require('fs'),
path = require('path'), path = require('path'),
winston = require('winston'), winston = require('winston'),
async = require('async'),
db = require('./../database'), db = require('./../database'),
user = require('./../user'), user = require('./../user'),
@ -421,9 +422,20 @@ var nconf = require('nconf'),
}); });
app.get('/groups', function (req, res) { app.get('/groups', function (req, res) {
async.parallel([
function(next) {
groups.list({ groups.list({
expand: true expand: true
}, function (err, groups) { }, next);
},
function(next) {
groups.listSystemGroups({
expand: true
}, next);
}
], function(err, data) {
var groups = data[0].concat(data[1]);
res.json(200, { res.json(200, {
groups: groups, groups: groups,
yourid: req.user.uid yourid: req.user.uid

Loading…
Cancel
Save