##// END OF EJS Templates
move repo actions from their own menu line to Options menu
move repo actions from their own menu line to Options menu

File last commit:

r3417:fa6ba672 beta
r3611:ceb7fdf4 beta
Show More
repos_group_edit_perms.html
133 lines | 6.1 KiB | text/html | HtmlLexer
#227 Initial version of repository groups permissions system...
r1982 <table id="permissions_manage" class="noborder">
<tr>
<td>${_('none')}</td>
<td>${_('read')}</td>
<td>${_('write')}</td>
<td>${_('admin')}</td>
<td>${_('member')}</td>
<td></td>
</tr>
## USERS
%for r2p in c.repos_group.repo_group_to_perm:
forbid removing yourself as beeing an admin of a group
r3332 ##forbid revoking permission from yourself
#227 Initial version of repository groups permissions system...
r1982 <tr id="id${id(r2p.user.username)}">
forbid removing yourself as beeing an admin of a group
r3332 %if c.rhodecode_user.user_id != r2p.user.user_id or c.rhodecode_user.is_admin:
#227 Initial version of repository groups permissions system...
r1982 <td>${h.radio('u_perm_%s' % r2p.user.username,'group.none')}</td>
<td>${h.radio('u_perm_%s' % r2p.user.username,'group.read')}</td>
<td>${h.radio('u_perm_%s' % r2p.user.username,'group.write')}</td>
<td>${h.radio('u_perm_%s' % r2p.user.username,'group.admin')}</td>
<td style="white-space: nowrap;">
Vincent Duvert
The ‘default’ username on the permission panels is now translatable.
r2418 <img class="perm-gravatar" src="${h.gravatar_url(r2p.user.email,14)}"/>${r2p.user.username if r2p.user.username != 'default' else _('default')}
#227 Initial version of repository groups permissions system...
r1982 </td>
<td>
%if r2p.user.username !='default':
<span class="delete_icon action_button" onclick="ajaxActionUser(${r2p.user.user_id},'${'id%s'%id(r2p.user.username)}')">
${_('revoke')}
</span>
%endif
</td>
forbid removing yourself as beeing an admin of a group
r3332 %else:
<td>${h.radio('u_perm_%s' % r2p.user.username,'group.none', disabled="disabled")}</td>
<td>${h.radio('u_perm_%s' % r2p.user.username,'group.read', disabled="disabled")}</td>
<td>${h.radio('u_perm_%s' % r2p.user.username,'group.write', disabled="disabled")}</td>
<td>${h.radio('u_perm_%s' % r2p.user.username,'group.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>
</td>
%endif
#227 Initial version of repository groups permissions system...
r1982 </tr>
%endfor
Mads Kiilerich
"Users groups" is grammatically incorrect English - rename to "user groups"...
r3410 ## USER GROUPS
#227 Initial version of repository groups permissions system...
r1982 %for g2p in c.repos_group.users_group_to_perm:
<tr id="id${id(g2p.users_group.users_group_name)}">
<td>${h.radio('g_perm_%s' % g2p.users_group.users_group_name,'group.none')}</td>
<td>${h.radio('g_perm_%s' % g2p.users_group.users_group_name,'group.read')}</td>
<td>${h.radio('g_perm_%s' % g2p.users_group.users_group_name,'group.write')}</td>
<td>${h.radio('g_perm_%s' % g2p.users_group.users_group_name,'group.admin')}</td>
<td style="white-space: nowrap;">
Added gravatars into permissions view and permissions autocomplete
r2142 <img class="perm-gravatar" src="${h.url('/images/icons/group.png')}"/>${g2p.users_group.users_group_name}
#227 Initial version of repository groups permissions system...
r1982 </td>
<td>
Mads Kiilerich
further cleanup of UsersGroup...
r3417 <span class="delete_icon action_button" onclick="ajaxActionUserGroup(${g2p.users_group.users_group_id},'${'id%s'%id(g2p.users_group.users_group_name)}')">
#227 Initial version of repository groups permissions system...
r1982 ${_('revoke')}
</span>
</td>
</tr>
%endfor
#538 form for permissions can handle multiple users at once
r2759 <%
_tmpl = h.literal("""' \
<td><input type="radio" value="group.none" name="perm_new_member_{0}" id="perm_new_member_{0}"></td> \
<td><input type="radio" value="group.read" name="perm_new_member_{0}" id="perm_new_member_{0}"></td> \
<td><input type="radio" value="group.write" name="perm_new_member_{0}" id="perm_new_member_{0}"></td> \
<td><input type="radio" value="group.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>'""")
White space cleanup
r2815 %>
## ADD HERE DYNAMICALLY NEW INPUTS FROM THE '_tmpl'
#538 form for permissions can handle multiple users at once
r2759 <tr class="new_members last_new_member" id="add_perm_input"></tr>
#227 Initial version of repository groups permissions system...
r1982 <tr>
<td colspan="6">
<span id="add_perm" class="add_icon" style="cursor: pointer;">
${_('Add another member')}
</span>
</td>
</tr>
Permissions on group can be set in recursive mode setting defined permission to all children...
r2820 <tr>
<td colspan="6">
typo fix
r2832 ${h.checkbox('recursive',value="True", label=_('apply to children'))}
recursive mode of setting permission should skip private repositories, they should remain private, it's proper thing to do !
r3221 <span class="help-block">${_('Set or revoke permission to all children of that group, including non-private repositories and other groups')}</span>
Permissions on group can be set in recursive mode setting defined permission to all children...
r2820 </td>
</tr>
#227 Initial version of repository groups permissions system...
r1982 </table>
<script type="text/javascript">
function ajaxActionUser(user_id, field_id) {
fixed #396 fixed problems with revoking users in nested groups
r2126 var sUrl = "${h.url('delete_repos_group_user_perm',group_name=c.repos_group.group_name)}";
#227 Initial version of repository groups permissions system...
r1982 var callback = {
success: function (o) {
var tr = YUD.get(String(field_id));
tr.parentNode.removeChild(tr);
},
failure: function (o) {
alert("${_('Failed to remove user')}");
},
};
Permissions on group can be set in recursive mode setting defined permission to all children...
r2820 var recursive = YUD.get('recursive').checked;
var postData = '_method=delete&recursive={0}&user_id={1}'.format(recursive,user_id);
#227 Initial version of repository groups permissions system...
r1982 var request = YAHOO.util.Connect.asyncRequest('POST', sUrl, callback, postData);
};
Mads Kiilerich
further cleanup of UsersGroup...
r3417 function ajaxActionUserGroup(users_group_id,field_id){
fixed #396 fixed problems with revoking users in nested groups
r2126 var sUrl = "${h.url('delete_repos_group_users_group_perm',group_name=c.repos_group.group_name)}";
#227 Initial version of repository groups permissions system...
r1982 var callback = {
success:function(o){
var tr = YUD.get(String(field_id));
tr.parentNode.removeChild(tr);
},
failure:function(o){
Mads Kiilerich
"Users groups" is grammatically incorrect English - rename to "user groups"...
r3410 alert("${_('Failed to remove user group')}");
#227 Initial version of repository groups permissions system...
r1982 },
};
Permissions on group can be set in recursive mode setting defined permission to all children...
r2820 var recursive = YUD.get('recursive').checked;
var postData = '_method=delete&recursive={0}&users_group_id={1}'.format(recursive,users_group_id);
#227 Initial version of repository groups permissions system...
r1982 var request = YAHOO.util.Connect.asyncRequest('POST', sUrl, callback, postData);
};
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 () {
Mads Kiilerich
html: don't use tabs
r3197 addPermAction(${_tmpl}, ${c.users_array|n}, ${c.users_groups_array|n});
#227 Initial version of repository groups permissions system...
r1982 });
});
</script>