Revert "closes #992"

This reverts commit ed4b0461b9.
v1.18.x
psychobunny 11 years ago
parent bbe1a00d34
commit 6496ad95e8

@ -58,15 +58,14 @@ define(function() {
listEl.on('click', 'button[data-action]', function() { listEl.on('click', 'button[data-action]', function() {
var action = this.getAttribute('data-action'), var action = this.getAttribute('data-action'),
parent = $(this).parents('li[data-gid]'), gid = $(this).parents('li[data-gid]').attr('data-gid');
gid = parent.attr('data-gid'),
system = parseInt(parent.attr('data-system'), 10) === 1;
switch (action) { switch (action) {
case 'delete': case 'delete':
bootbox.confirm('Are you sure you wish to delete this group?', function(confirm) { bootbox.confirm('Are you sure you wish to delete this group?', function(confirm) {
if (confirm) { if (confirm) {
socket.emit('admin.groups.delete', gid, function(err, data) { socket.emit('admin.groups.delete', gid, function(err, data) {
console.log(err, data);
if(err) { if(err) {
return app.alertError(err.message); return app.alertError(err.message);
} }
@ -107,8 +106,6 @@ define(function() {
detailsModal.attr('data-gid', groupObj.gid); detailsModal.attr('data-gid', groupObj.gid);
detailsModal.modal('show'); detailsModal.modal('show');
$('.hide-if-system')[system ? 'hide' : 'show']();
}); });
break; break;
} }

@ -5,7 +5,7 @@
<div class="groups"> <div class="groups">
<ul id="groups-list"> <ul id="groups-list">
<!-- BEGIN groups --> <!-- BEGIN groups -->
<li data-gid="{groups.gid}" data-system="{groups.hidden}"> <li data-gid="{groups.gid}">
<div class="row"> <div class="row">
<div class="col-lg-8"> <div class="col-lg-8">
<h2>{groups.name}</h2> <h2>{groups.name}</h2>
@ -69,7 +69,7 @@
<div class="modal-body"> <div class="modal-body">
<div class="alert alert-danger hide" id="create-modal-error"></div> <div class="alert alert-danger hide" id="create-modal-error"></div>
<form> <form>
<div class="form-group hide-if-system"> <div class="form-group">
<label for="group-name">Group Name</label> <label for="group-name">Group Name</label>
<input type="text" class="form-control" id="change-group-name" placeholder="Group Name" /> <input type="text" class="form-control" id="change-group-name" placeholder="Group Name" />
</div> </div>

@ -13,16 +13,14 @@
expand: options.expand expand: options.expand
}, next); }, next);
}, function (err, groups) { }, function (err, groups) {
groups.forEach(function(group, g, arr) { // Remove deleted and hidden groups from this list
if (parseInt(group.deleted, 10) === 1) { callback(err, groups.filter(function (group) {
delete arr[g]; if (parseInt(group.deleted, 10) === 1 || parseInt(group.hidden, 10) === 1) {
} return false;
if (parseInt(group.hidden, 10) === 1) { } else {
group.deletable = 0; return true;
} }
}); }));
callback(err, groups);
}); });
} else { } else {
callback(null, []); callback(null, []);

Loading…
Cancel
Save