Files
@ 9dd726706178
Branch filter:
Location: kallithea/rhodecode/templates/admin/user_groups/user_group_edit_perms.html
9dd726706178
7.3 KiB
text/html
Complete copyright notices for web interface; change footer to link to them.
The original copyright notice found in the footer was not accurate as it
included only one of the many copyright holders in this project. This change
creates an "about" page, which currently contains just the copyright and
license information. It links to repository for additional potential copyright
holders not listed on the about page.
Unlisted contributors are mentioned in template comments.
Html links for Kallithea is fixed and we link to Conservancy.
Display of version information in the footer is improved.
The original copyright notice found in the footer was not accurate as it
included only one of the many copyright holders in this project. This change
creates an "about" page, which currently contains just the copyright and
license information. It links to repository for additional potential copyright
holders not listed on the about page.
Unlisted contributors are mentioned in template comments.
Html links for Kallithea is fixed and we link to Conservancy.
Display of version information in the footer is improved.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 | ${h.form(url('edit_user_group_perms', id=c.user_group.users_group_id),method='put')}
<div class="form">
<div class="fields">
<div class="field">
<table id="permissions_manage" class="noborder">
<tr>
<td>${_('none')}</td>
<td>${_('read')}</td>
<td>${_('write')}</td>
<td>${_('admin')}</td>
<td>${_('user/user group')}</td>
<td></td>
</tr>
## USERS
%for r2p in c.user_group.user_user_group_to_perm:
##forbid revoking permission from yourself, except if you're an super admin
<tr id="id${id(r2p.user.username)}">
%if c.rhodecode_user.user_id != r2p.user.user_id or c.rhodecode_user.is_admin:
<td>${h.radio('u_perm_%s' % r2p.user.username,'usergroup.none')}</td>
<td>${h.radio('u_perm_%s' % r2p.user.username,'usergroup.read')}</td>
<td>${h.radio('u_perm_%s' % r2p.user.username,'usergroup.write')}</td>
<td>${h.radio('u_perm_%s' % r2p.user.username,'usergroup.admin')}</td>
<td style="white-space: nowrap;">
<img class="perm-gravatar" src="${h.gravatar_url(r2p.user.email,14)}"/>
%if h.HasPermissionAny('hg.admin')() and r2p.user.username != 'default':
<a href="${h.url('edit_user',id=r2p.user.user_id)}">${r2p.user.username}</a>
%else:
${r2p.user.username if r2p.user.username != 'default' else _('default')}
%endif
</td>
<td>
%if r2p.user.username !='default':
<span style="color:#da4f49" class="action_button" onclick="ajaxActionRevoke(${r2p.user.user_id}, 'user', '${'id%s'%id(r2p.user.username)}', '${r2p.user.username}')">
<i class="icon-remove"></i> ${_('revoke')}
</span>
%endif
</td>
%else:
<td>${h.radio('u_perm_%s' % r2p.user.username,'usergroup.none', disabled="disabled")}</td>
<td>${h.radio('u_perm_%s' % r2p.user.username,'usergroup.read', disabled="disabled")}</td>
<td>${h.radio('u_perm_%s' % r2p.user.username,'usergroup.write', disabled="disabled")}</td>
<td>${h.radio('u_perm_%s' % r2p.user.username,'usergroup.admin', disabled="disabled")}</td>
<td style="white-space: nowrap;">
<img class="perm-gravatar" src="${h.gravatar_url(r2p.user.email,14)}"/>
${r2p.user.username if r2p.user.username != 'default' else _('default')}
</td>
<td><i class="icon-user"></i> ${_('delegated admin')}</td>
%endif
</tr>
%endfor
## USER GROUPS
%for g2p in c.user_group.user_group_user_group_to_perm:
<tr id="id${id(g2p.user_group.users_group_name)}">
<td>${h.radio('g_perm_%s' % g2p.user_group.users_group_name,'usergroup.none')}</td>
<td>${h.radio('g_perm_%s' % g2p.user_group.users_group_name,'usergroup.read')}</td>
<td>${h.radio('g_perm_%s' % g2p.user_group.users_group_name,'usergroup.write')}</td>
<td>${h.radio('g_perm_%s' % g2p.user_group.users_group_name,'usergroup.admin')}</td>
<td style="white-space: nowrap;">
<img class="perm-gravatar" src="${h.url('/images/icons/group.png')}"/>
%if h.HasPermissionAny('hg.admin')():
<a href="${h.url('edit_users_group',id=g2p.user_group.users_group_id)}">
${g2p.user_group.users_group_name}
</a>
%else:
${g2p.user_group.users_group_name}
%endif
</td>
<td>
<span style="color:#da4f49" class="action_button" onclick="ajaxActionRevoke(${g2p.user_group.users_group_id}, 'user_group', '${'id%s'%id(g2p.user_group.users_group_name)}', '${g2p.user_group.users_group_name}')">
<i class="icon-remove"></i> ${_('revoke')}
</span>
</td>
</tr>
%endfor
<%
_tmpl = h.literal("""' \
<td><input type="radio" value="usergroup.none" name="perm_new_member_{0}" id="perm_new_member_{0}"></td> \
<td><input type="radio" value="usergroup.read" checked="checked" name="perm_new_member_{0}" id="perm_new_member_{0}"></td> \
<td><input type="radio" value="usergroup.write" name="perm_new_member_{0}" id="perm_new_member_{0}"></td> \
<td><input type="radio" value="usergroup.admin" name="perm_new_member_{0}" id="perm_new_member_{0}"></td> \
<td class="ac"> \
<div class="perm_ac" id="perm_ac_{0}"> \
<input class="yui-ac-input" id="perm_new_member_name_{0}" name="perm_new_member_name_{0}" value="" type="text"> \
<input id="perm_new_member_type_{0}" name="perm_new_member_type_{0}" value="" type="hidden"> \
<div id="perm_container_{0}"></div> \
</div> \
</td> \
<td></td>'""")
%>
## ADD HERE DYNAMICALLY NEW INPUTS FROM THE '_tmpl'
<tr class="new_members last_new_member" id="add_perm_input"></tr>
<tr>
<td colspan="6">
<span id="add_perm" style="cursor: pointer;">
<i class="icon-plus"></i> ${_('Add new')}
</span>
</td>
</tr>
</table>
</div>
<div class="buttons">
${h.submit('save',_('Save'),class_="btn")}
${h.reset('reset',_('Reset'),class_="btn")}
</div>
</div>
</div>
${h.end_form()}
<script type="text/javascript">
function ajaxActionRevoke(obj_id, obj_type, field_id, obj_name) {
url = "${h.url('edit_user_group_perms', id=c.user_group.users_group_id)}";
var revoke_msg = _TM['Confirm to revoke permission for {0}: {1} ?'].format(obj_type.replace('_', ' '), obj_name);
if (confirm(revoke_msg)){
ajaxActionRevokePermission(url, obj_id, obj_type, field_id);
}
};
YUE.onDOMReady(function () {
if (!YUD.hasClass('perm_new_member_name', 'error')) {
YUD.setStyle('add_perm_input', 'display', 'none');
}
YAHOO.util.Event.addListener('add_perm', 'click', function () {
addPermAction(${_tmpl}, ${c.users_array|n}, ${c.user_groups_array|n});
});
});
</script>
|