fix: #7298 privilege header misalignment

v1.18.x
Julian Lam 6 years ago
parent fefec8ba57
commit df6f75eb05

@ -35,6 +35,7 @@
"privileges.section-viewing": "Viewing Privileges",
"privileges.section-posting": "Posting Privileges",
"privileges.section-moderation": "Moderation Privileges",
"privileges.section-other": "Other",
"privileges.section-user": "User",
"privileges.search-user": "Add User",
"privileges.no-users": "No user-specific privileges in this category.",

@ -34,7 +34,10 @@ module.exports = function (privileges) {
},
function (payload, next) {
// This is a hack because I can't do {labels.users.length} to echo the count in templates.js
payload.columnCount = payload.labels.users.length + 2;
payload.columnCountUser = payload.labels.users.length + 2;
payload.columnCountUserOther = payload.labels.users.length - privileges.privilegeLabels.length;
payload.columnCountGroup = payload.labels.groups.length + 2;
payload.columnCountGroupOther = payload.labels.groups.length - privileges.privilegeLabels.length;
next(null, payload);
},
], callback);

@ -11,6 +11,11 @@
<th class="arrowed" colspan="3">
[[admin/manage/categories:privileges.section-moderation]]
</th>
<!-- IF privileges.columnCountUserOther -->
<th class="arrowed" colspan="{privileges.columnCountUserOther}">
[[admin/manage/categories:privileges.section-other]]
</th>
<!-- END -->
</tr><tr><!-- zebrastripe reset --></tr>
<tr>
<th colspan="2">[[admin/manage/categories:privileges.section-user]]</th>
@ -35,7 +40,7 @@
</tr>
<!-- END privileges.users -->
<tr>
<td colspan="{privileges.columnCount}">
<td colspan="{privileges.columnCountUser}">
<button type="button" class="btn btn-primary pull-right" data-ajaxify="false" data-action="search.user">
[[admin/manage/categories:privileges.search-user]]
</button>
@ -43,7 +48,7 @@
</tr>
<!-- ELSE -->
<tr>
<td colspan="{privileges.columnCount}">
<td colspan="{privileges.columnCountUser}">
[[admin/manage/categories:privileges.no-users]]
<button type="button" class="btn btn-primary pull-right" data-ajaxify="false" data-action="search.user">
[[admin/manage/categories:privileges.search-user]]
@ -67,6 +72,11 @@
<th class="arrowed" colspan="3">
[[admin/manage/categories:privileges.section-moderation]]
</th>
<!-- IF privileges.columnCountGroupOther -->
<th class="arrowed" colspan="{privileges.columnCountGroupOther}">
[[admin/manage/categories:privileges.section-other]]
</th>
<!-- END -->
</tr><tr><!-- zebrastripe reset --></tr>
<tr>
<th colspan="2">[[admin/manage/categories:privileges.section-group]]</th>
@ -89,7 +99,7 @@
</tr>
<!-- END privileges.groups -->
<tr>
<td colspan="{privileges.columnCount}">
<td colspan="{privileges.columnCountGroup}">
<div class="btn-toolbar">
<button type="button" class="btn btn-primary pull-right" data-ajaxify="false" data-action="search.group">
[[admin/manage/categories:privileges.search-group]]

Loading…
Cancel
Save