mirror of
https://github.com/NodeBB/NodeBB.git
synced 2026-01-06 15:42:52 +01:00
passing in the column count so a message can be displayed to users when no users have privs in a category, #2887
This commit is contained in:
@@ -136,6 +136,8 @@ adminController.categories.get = function(req, res, next) {
|
||||
return next(err);
|
||||
}
|
||||
|
||||
data.privileges.columnCount = data.privileges.labels.users.length + 2;
|
||||
|
||||
res.render('admin/manage/category', {
|
||||
category: data.category[0],
|
||||
privileges: data.privileges
|
||||
|
||||
@@ -6,6 +6,7 @@
|
||||
<th class="text-center">{privileges.labels.users.name}</th>
|
||||
<!-- END privileges.labels.users -->
|
||||
</tr>
|
||||
<!-- IF privileges.users.length -->
|
||||
<!-- BEGIN privileges.users -->
|
||||
<tr data-uid="{uid}">
|
||||
<td><img src="{picture}" title="{username}" /></td>
|
||||
@@ -13,6 +14,13 @@
|
||||
{function.spawnPrivilegeStates, privileges}
|
||||
</tr>
|
||||
<!-- END privileges.users -->
|
||||
<!-- ELSE -->
|
||||
<tr>
|
||||
<td colspan="{privileges.columnCount}">
|
||||
<div class="alert alert-info">No user-specific privileges in this category.</div>
|
||||
</td>
|
||||
</tr>
|
||||
<!-- ENDIF privileges.users.length -->
|
||||
</table>
|
||||
|
||||
<table class="table table-striped table-hover privilege-table">
|
||||
|
||||
Reference in New Issue
Block a user