passing in the column count so a message can be displayed to users when no users have privs in a category, #2887

v1.18.x
Julian Lam 10 years ago
parent 60b19a9d62
commit 4f2c7382c5

@ -136,6 +136,8 @@ adminController.categories.get = function(req, res, next) {
return next(err); return next(err);
} }
data.privileges.columnCount = data.privileges.labels.users.length + 2;
res.render('admin/manage/category', { res.render('admin/manage/category', {
category: data.category[0], category: data.category[0],
privileges: data.privileges privileges: data.privileges

@ -6,6 +6,7 @@
<th class="text-center">{privileges.labels.users.name}</th> <th class="text-center">{privileges.labels.users.name}</th>
<!-- END privileges.labels.users --> <!-- END privileges.labels.users -->
</tr> </tr>
<!-- IF privileges.users.length -->
<!-- BEGIN privileges.users --> <!-- BEGIN privileges.users -->
<tr data-uid="{uid}"> <tr data-uid="{uid}">
<td><img src="{picture}" title="{username}" /></td> <td><img src="{picture}" title="{username}" /></td>
@ -13,6 +14,13 @@
{function.spawnPrivilegeStates, privileges} {function.spawnPrivilegeStates, privileges}
</tr> </tr>
<!-- END privileges.users --> <!-- 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>
<table class="table table-striped table-hover privilege-table"> <table class="table table-striped table-hover privilege-table">

Loading…
Cancel
Save