mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-11-09 07:25:46 +01:00
closes #3742
This commit is contained in:
@@ -9,7 +9,7 @@
|
||||
.border-radius(3px);
|
||||
|
||||
&.disabled {
|
||||
-webkit-filter: grayscale(30%);
|
||||
background-color: #888!important;
|
||||
.opacity(0.5);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -240,7 +240,7 @@ define('admin/manage/category', [
|
||||
}
|
||||
|
||||
categories = categories.filter(function(category) {
|
||||
return category && parseInt(category.cid, 10) !== parseInt(ajaxify.data.category.cid, 10);
|
||||
return category && !category.disabled && parseInt(category.cid, 10) !== parseInt(ajaxify.data.category.cid, 10);
|
||||
});
|
||||
|
||||
templates.parse('partials/category_list', {
|
||||
|
||||
@@ -15,7 +15,25 @@ SocketCategories.getRecentReplies = function(socket, cid, callback) {
|
||||
};
|
||||
|
||||
SocketCategories.get = function(socket, data, callback) {
|
||||
categories.getCategoriesByPrivilege('categories:cid', socket.uid, 'find', callback);
|
||||
async.parallel({
|
||||
isAdmin: async.apply(user.isAdministrator, socket.uid),
|
||||
categories: function(next) {
|
||||
async.waterfall([
|
||||
async.apply(db.getSortedSetRange, 'categories:cid', 0, -1),
|
||||
async.apply(categories.getCategoriesData),
|
||||
], next);
|
||||
}
|
||||
}, function(err, results) {
|
||||
if (err) {
|
||||
return callback(err);
|
||||
}
|
||||
|
||||
results.categories = results.categories.filter(function(category) {
|
||||
return category && (!category.disabled || results.isAdmin);
|
||||
});
|
||||
|
||||
callback(null, results.categories);
|
||||
});
|
||||
};
|
||||
|
||||
SocketCategories.getWatchedCategories = function(socket, data, callback) {
|
||||
|
||||
Reference in New Issue
Block a user