|
|
|
@ -252,6 +252,7 @@ define(['uploader'], function(uploader) {
|
|
|
|
|
|
|
|
|
|
var numResults = results.length,
|
|
|
|
|
resultObj;
|
|
|
|
|
resultsEl.html('');
|
|
|
|
|
for(var x = 0; x < numResults; x++) {
|
|
|
|
|
resultObj = results[x];
|
|
|
|
|
liEl = $('<li />')
|
|
|
|
@ -348,12 +349,14 @@ define(['uploader'], function(uploader) {
|
|
|
|
|
readMembers = modalEl.find('#category-permissions-read'),
|
|
|
|
|
writeMembers = modalEl.find('#category-permissions-write'),
|
|
|
|
|
moderatorsEl = modalEl.find('#category-permissions-mods');
|
|
|
|
|
|
|
|
|
|
socket.emit('admin.categories.getPrivilegeSettings', cid, function(err, privilegeList) {
|
|
|
|
|
var readLength = privilegeList['+r'].length,
|
|
|
|
|
writeLength = privilegeList['+w'].length,
|
|
|
|
|
modLength = privilegeList['mods'].length,
|
|
|
|
|
liEl, x, userObj;
|
|
|
|
|
|
|
|
|
|
readMembers.html('');
|
|
|
|
|
if (readLength > 0) {
|
|
|
|
|
for(x = 0; x < readLength; x++) {
|
|
|
|
|
userObj = privilegeList['+r'][x];
|
|
|
|
@ -365,10 +368,11 @@ define(['uploader'], function(uploader) {
|
|
|
|
|
readMembers.append(liEl);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
writeMembers.html('');
|
|
|
|
|
if (writeLength > 0) {
|
|
|
|
|
for(x=0;x<writeLength;x++) {
|
|
|
|
|
userObj = privilegeList['+w'][x];
|
|
|
|
|
$('<li />').attr('data-uid', userObj.uid).html('<img src="' + userObj.picture + '" title="' + userObj.username + '" />');
|
|
|
|
|
liEl = $('<li />').attr('data-uid', userObj.uid).html('<img src="' + userObj.picture + '" title="' + userObj.username + '" />');
|
|
|
|
|
writeMembers.append(liEl);
|
|
|
|
|
}
|
|
|
|
|
} else {
|
|
|
|
@ -376,6 +380,7 @@ define(['uploader'], function(uploader) {
|
|
|
|
|
writeMembers.append(liEl);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
moderatorsEl.html('');
|
|
|
|
|
if (modLength > 0) {
|
|
|
|
|
for(x = 0;x < modLength; x++) {
|
|
|
|
|
userObj = privilegeList['mods'][x];
|
|
|
|
@ -384,7 +389,7 @@ define(['uploader'], function(uploader) {
|
|
|
|
|
}
|
|
|
|
|
} else {
|
|
|
|
|
liEl = $('<li />').addClass('empty').html('No moderators');
|
|
|
|
|
moderatorsEl.appendChild(liEl);
|
|
|
|
|
moderatorsEl.append(liEl);
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
};
|
|
|
|
|