|
|
@ -361,50 +361,22 @@ define(['uploader'], function(uploader) {
|
|
|
|
|
|
|
|
|
|
|
|
Categories.refreshPrivilegeList = function (cid) {
|
|
|
|
Categories.refreshPrivilegeList = function (cid) {
|
|
|
|
var modalEl = $('#category-permissions-modal'),
|
|
|
|
var modalEl = $('#category-permissions-modal'),
|
|
|
|
readMembers = modalEl.find('#category-permissions-read'),
|
|
|
|
memberList = $('.members');
|
|
|
|
writeMembers = modalEl.find('#category-permissions-write'),
|
|
|
|
|
|
|
|
moderatorsEl = modalEl.find('#category-permissions-mods');
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
socket.emit('admin.categories.getPrivilegeSettings', cid, function(err, privilegeList) {
|
|
|
|
socket.emit('admin.categories.getPrivilegeSettings', cid, function(err, privilegeList) {
|
|
|
|
var readLength = privilegeList['+r'].length,
|
|
|
|
var membersLength = privilegeList.length,
|
|
|
|
writeLength = privilegeList['+w'].length,
|
|
|
|
|
|
|
|
modLength = privilegeList.mods.length,
|
|
|
|
|
|
|
|
liEl, x, userObj;
|
|
|
|
liEl, x, userObj;
|
|
|
|
|
|
|
|
|
|
|
|
readMembers.html('');
|
|
|
|
memberList.html('');
|
|
|
|
if (readLength > 0) {
|
|
|
|
if (membersLength > 0) {
|
|
|
|
for(x = 0; x < readLength; x++) {
|
|
|
|
for(x = 0; x < membersLength; x++) {
|
|
|
|
userObj = privilegeList['+r'][x];
|
|
|
|
userObj = privilegeList[x];
|
|
|
|
liEl = $('<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 + '" />');
|
|
|
|
readMembers.append(liEl);
|
|
|
|
memberList.append(liEl);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
liEl = $('<li/>').addClass('empty').html('All users can read and see this category');
|
|
|
|
liEl = $('<li/>').addClass('empty').html('All users can read and post, and reply to topics in this category');
|
|
|
|
readMembers.append(liEl);
|
|
|
|
memberList.append(liEl);
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
writeMembers.html('');
|
|
|
|
|
|
|
|
if (writeLength > 0) {
|
|
|
|
|
|
|
|
for(x=0;x<writeLength;x++) {
|
|
|
|
|
|
|
|
userObj = privilegeList['+w'][x];
|
|
|
|
|
|
|
|
liEl = $('<li />').attr('data-uid', userObj.uid).html('<img src="' + userObj.picture + '" title="' + userObj.username + '" />');
|
|
|
|
|
|
|
|
writeMembers.append(liEl);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
|
|
|
liEl = $('<li />').addClass('empty').html('All users can write to this category');
|
|
|
|
|
|
|
|
writeMembers.append(liEl);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
moderatorsEl.html('');
|
|
|
|
|
|
|
|
if (modLength > 0) {
|
|
|
|
|
|
|
|
for(x = 0;x < modLength; x++) {
|
|
|
|
|
|
|
|
userObj = privilegeList.mods[x];
|
|
|
|
|
|
|
|
liEl = $('<li />').attr('data-uid', userObj.uid).html('<img src="' + userObj.picture + '" title="' + userObj.username + '" />');
|
|
|
|
|
|
|
|
moderatorsEl.append(liEl);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
|
|
|
liEl = $('<li />').addClass('empty').html('No moderators');
|
|
|
|
|
|
|
|
moderatorsEl.append(liEl);
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
});
|
|
|
|
});
|
|
|
|
};
|
|
|
|
};
|
|
|
|