@@ -7,6 +7,9 @@
.perm, .select_all {
text-align: center;
}
td {
vertical-align: middle !important;
}
</style>
</%block>
<%block name="extra_js">
@@ -21,11 +24,11 @@ $(document).ready(function() {
for (var i = 0; i < PERMISSIONS.length; i++) {
var p = PERMISSIONS[i];
$('th.' + p + ' i.fa-check-square-o ').click(function() {
$('th.' + p + ' button.select_all-perm ').click(function() {
p = this.attributes['data-perm'].value;
$('.' + p + ' input').each(function() { this.checked = true; });
});
$('th.' + p + ' i.fa-square-o ').click(function() {
$('th.' + p + ' button.select_none-perm ').click(function() {
p = this.attributes['data-perm'].value;
$('.' + p + ' input').each(function() {
if (p != 'is_admin' || this.attributes['data-uid'].value != ${current_user.uid}) {
@@ -37,11 +40,11 @@ $(document).ready(function() {
for (var i = 0; i < USERS.length; i++) {
uid = USERS[i];
$('.u' + uid + ' td .select_all i.fa-check-square-o ').click(function() {
$('.u' + uid + ' button .select_all-user ').click(function() {
uid = this.attributes['data-uid'].value;
$('input.u' + uid).each(function() { this.checked = true; });
});
$('.u' + uid + ' td.select_all i.fa-square-o ').click(function() {
$('.u' + uid + ' button.select_none-user ').click(function() {
uid = this.attributes['data-uid'].value;
$('input.u' + uid).each(function() {
if (uid != current_uid || this.attributes['data-perm'].value != 'is_admin') { this.checked = false; }
@@ -63,12 +66,30 @@ $(document).ready(function() {
<thead><tr>
<th class="uid">#</th>
<th class="username">Username</th>
<th class="perm is_admin">Admin<br><i class="fa fa-check-square-o fa-fw" data-perm="is_admin"></i><i class="fa fa-square-o fa-fw" data-perm="is_admin"></i></th>
<th class="perm can_edit_all_posts">Can all posts<br><i class="fa fa-check-square-o fa-fw" data-perm="can_edit_all_posts"></i><i class="fa fa-square-o fa-fw" data-perm="can_edit_all_posts"></i></th>
<th class="perm wants_all_posts">Want all posts<br><i class="fa fa-check-square-o fa-fw" data-perm="wants_all_posts"></i><i class="fa fa-square-o fa-fw" data-perm="wants_all_posts"></i></th>
<th class="perm can_upload_attachments">Attachments<br><i class="fa fa-check-square-o fa-fw" data-perm="can_upload_attachments"></i><i class="fa fa-square-o fa-fw" data-perm="can_upload_attachments"></i></th>
<th class="perm can_rebuild_site">Rebuild<br><i class="fa fa-check-square-o fa-fw" data-perm="can_rebuild_site"></i><i class="fa fa-square-o fa-fw" data-perm="can_rebuild_site"></i></th>
<th class="perm can_transfer_post_authorship">Transfer authorship<br><i class="fa fa-check-square-o fa-fw" data-perm="can_transfer_post_authorship"></i><i class="fa fa-square-o fa-fw" data-perm="can_transfer_post_authorship"></i></th>
<th class="perm is_admin">Admin<br>
<button type="button" class="btn btn-info btn-xs select_all-perm" data-perm="is_admin"><i class="fa fa-check-square-o fa-fw"></i></button>
<button type="button" class="btn btn-info btn-xs select_none-perm" data-perm="is_admin"><i class="fa fa-square-o fa-fw"></i></button>
</th>
<th class="perm can_edit_all_posts">Can all posts<br>
<button type="button" class="btn btn-info btn-xs select_all-perm" data-perm="can_edit_all_posts"><i class="fa fa-check-square-o fa-fw"></i></button>
<button type="button" class="btn btn-info btn-xs select_none-perm" data-perm="can_edit_all_posts"><i class="fa fa-square-o fa-fw"></i></button>
</th>
<th class="perm wants_all_posts">Wants all posts<br>
<button type="button" class="btn btn-info btn-xs select_all-perm" data-perm="wants_all_posts"><i class="fa fa-check-square-o fa-fw"></i></button>
<button type="button" class="btn btn-info btn-xs select_none-perm" data-perm="wants_all_posts"><i class="fa fa-square-o fa-fw"></i></button>
</th>
<th class="perm can_upload_attachments">Attachments<br>
<button type="button" class="btn btn-info btn-xs select_all-perm" data-perm="can_upload_attachments"><i class="fa fa-check-square-o fa-fw"></i></button>
<button type="button" class="btn btn-info btn-xs select_none-perm" data-perm="can_upload_attachments"><i class="fa fa-square-o fa-fw"></i></button>
</th>
<th class="perm can_rebuild_site">Rebuild<br>
<button type="button" class="btn btn-info btn-xs select_all-perm" data-perm="can_rebuild_site"><i class="fa fa-check-square-o fa-fw"></i></button>
<button type="button" class="btn btn-info btn-xs select_none-perm" data-perm="can_rebuild_site"><i class="fa fa-square-o fa-fw"></i></button>
</th>
<th class="perm can_transfer_post_authorship">Transfer authorship<br>
<button type="button" class="btn btn-info btn-xs select_all-perm" data-perm="can_transfer_post_authorship"><i class="fa fa-check-square-o fa-fw"></i></button>
<button type="button" class="btn btn-info btn-xs select_none-perm" data-perm="can_transfer_post_authorship"><i class="fa fa-square-o fa-fw"></i></button>
</th>
<th class="select_all">Select all</th>
</tr></thead>
% for uid, user in USERS.items():
@@ -79,7 +100,7 @@ $(document).ready(function() {
% for p in PERMISSIONS:
<td class="perm ${p}">${display_permission(user, p)}</td>
% endfor
<td class="select_all info" ><i class="fa fa-check-square-o fa-fw" data-uid="${uid}"></i><i class="fa fa-square-o fa-fw" data-uid="${uid}" ></i></td>
<td class="select_all"><button type="button" class="btn btn- info select_all-user" data-uid="${uid}" ><i class="fa fa-check-square-o fa-fw"></i></button> <button type="button" class="btn btn-info select_none-user" data-uid="${uid}"><i class="fa fa-square-o fa-fw"></i></button ></td>
</tr>
% endif
% endfor