annotate rhodecode/templates/admin/repos_groups/repos_group_edit_perms.html @ 2369:c2f131502037 beta

Autocomplete fixes - use translation MAP - move translation to top level in order to be used inside rhodecode.js - re-use user and groups data in changesets page
author Marcin Kuzminski <marcin@python-works.com>
date Fri, 01 Jun 2012 23:29:41 +0200
parents a8c9c0094ddf
children e5c8472ac0ac
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
1982
87f0800abc7b #227 Initial version of repository groups permissions system
Marcin Kuzminski <marcin@python-works.com>
parents:
diff changeset
1 <table id="permissions_manage" class="noborder">
87f0800abc7b #227 Initial version of repository groups permissions system
Marcin Kuzminski <marcin@python-works.com>
parents:
diff changeset
2 <tr>
87f0800abc7b #227 Initial version of repository groups permissions system
Marcin Kuzminski <marcin@python-works.com>
parents:
diff changeset
3 <td>${_('none')}</td>
87f0800abc7b #227 Initial version of repository groups permissions system
Marcin Kuzminski <marcin@python-works.com>
parents:
diff changeset
4 <td>${_('read')}</td>
87f0800abc7b #227 Initial version of repository groups permissions system
Marcin Kuzminski <marcin@python-works.com>
parents:
diff changeset
5 <td>${_('write')}</td>
87f0800abc7b #227 Initial version of repository groups permissions system
Marcin Kuzminski <marcin@python-works.com>
parents:
diff changeset
6 <td>${_('admin')}</td>
87f0800abc7b #227 Initial version of repository groups permissions system
Marcin Kuzminski <marcin@python-works.com>
parents:
diff changeset
7 <td>${_('member')}</td>
87f0800abc7b #227 Initial version of repository groups permissions system
Marcin Kuzminski <marcin@python-works.com>
parents:
diff changeset
8 <td></td>
87f0800abc7b #227 Initial version of repository groups permissions system
Marcin Kuzminski <marcin@python-works.com>
parents:
diff changeset
9 </tr>
87f0800abc7b #227 Initial version of repository groups permissions system
Marcin Kuzminski <marcin@python-works.com>
parents:
diff changeset
10 ## USERS
87f0800abc7b #227 Initial version of repository groups permissions system
Marcin Kuzminski <marcin@python-works.com>
parents:
diff changeset
11 %for r2p in c.repos_group.repo_group_to_perm:
87f0800abc7b #227 Initial version of repository groups permissions system
Marcin Kuzminski <marcin@python-works.com>
parents:
diff changeset
12 <tr id="id${id(r2p.user.username)}">
87f0800abc7b #227 Initial version of repository groups permissions system
Marcin Kuzminski <marcin@python-works.com>
parents:
diff changeset
13 <td>${h.radio('u_perm_%s' % r2p.user.username,'group.none')}</td>
87f0800abc7b #227 Initial version of repository groups permissions system
Marcin Kuzminski <marcin@python-works.com>
parents:
diff changeset
14 <td>${h.radio('u_perm_%s' % r2p.user.username,'group.read')}</td>
87f0800abc7b #227 Initial version of repository groups permissions system
Marcin Kuzminski <marcin@python-works.com>
parents:
diff changeset
15 <td>${h.radio('u_perm_%s' % r2p.user.username,'group.write')}</td>
87f0800abc7b #227 Initial version of repository groups permissions system
Marcin Kuzminski <marcin@python-works.com>
parents:
diff changeset
16 <td>${h.radio('u_perm_%s' % r2p.user.username,'group.admin')}</td>
87f0800abc7b #227 Initial version of repository groups permissions system
Marcin Kuzminski <marcin@python-works.com>
parents:
diff changeset
17 <td style="white-space: nowrap;">
2142
a21eab6ff42f Added gravatars into permissions view and permissions autocomplete
Marcin Kuzminski <marcin@python-works.com>
parents: 2126
diff changeset
18 <img class="perm-gravatar" src="${h.gravatar_url(r2p.user.email,14)}"/>${r2p.user.username}
1982
87f0800abc7b #227 Initial version of repository groups permissions system
Marcin Kuzminski <marcin@python-works.com>
parents:
diff changeset
19 </td>
87f0800abc7b #227 Initial version of repository groups permissions system
Marcin Kuzminski <marcin@python-works.com>
parents:
diff changeset
20 <td>
87f0800abc7b #227 Initial version of repository groups permissions system
Marcin Kuzminski <marcin@python-works.com>
parents:
diff changeset
21 %if r2p.user.username !='default':
87f0800abc7b #227 Initial version of repository groups permissions system
Marcin Kuzminski <marcin@python-works.com>
parents:
diff changeset
22 <span class="delete_icon action_button" onclick="ajaxActionUser(${r2p.user.user_id},'${'id%s'%id(r2p.user.username)}')">
87f0800abc7b #227 Initial version of repository groups permissions system
Marcin Kuzminski <marcin@python-works.com>
parents:
diff changeset
23 ${_('revoke')}
87f0800abc7b #227 Initial version of repository groups permissions system
Marcin Kuzminski <marcin@python-works.com>
parents:
diff changeset
24 </span>
87f0800abc7b #227 Initial version of repository groups permissions system
Marcin Kuzminski <marcin@python-works.com>
parents:
diff changeset
25 %endif
87f0800abc7b #227 Initial version of repository groups permissions system
Marcin Kuzminski <marcin@python-works.com>
parents:
diff changeset
26 </td>
87f0800abc7b #227 Initial version of repository groups permissions system
Marcin Kuzminski <marcin@python-works.com>
parents:
diff changeset
27 </tr>
87f0800abc7b #227 Initial version of repository groups permissions system
Marcin Kuzminski <marcin@python-works.com>
parents:
diff changeset
28 %endfor
87f0800abc7b #227 Initial version of repository groups permissions system
Marcin Kuzminski <marcin@python-works.com>
parents:
diff changeset
29
87f0800abc7b #227 Initial version of repository groups permissions system
Marcin Kuzminski <marcin@python-works.com>
parents:
diff changeset
30 ## USERS GROUPS
87f0800abc7b #227 Initial version of repository groups permissions system
Marcin Kuzminski <marcin@python-works.com>
parents:
diff changeset
31 %for g2p in c.repos_group.users_group_to_perm:
87f0800abc7b #227 Initial version of repository groups permissions system
Marcin Kuzminski <marcin@python-works.com>
parents:
diff changeset
32 <tr id="id${id(g2p.users_group.users_group_name)}">
87f0800abc7b #227 Initial version of repository groups permissions system
Marcin Kuzminski <marcin@python-works.com>
parents:
diff changeset
33 <td>${h.radio('g_perm_%s' % g2p.users_group.users_group_name,'group.none')}</td>
87f0800abc7b #227 Initial version of repository groups permissions system
Marcin Kuzminski <marcin@python-works.com>
parents:
diff changeset
34 <td>${h.radio('g_perm_%s' % g2p.users_group.users_group_name,'group.read')}</td>
87f0800abc7b #227 Initial version of repository groups permissions system
Marcin Kuzminski <marcin@python-works.com>
parents:
diff changeset
35 <td>${h.radio('g_perm_%s' % g2p.users_group.users_group_name,'group.write')}</td>
87f0800abc7b #227 Initial version of repository groups permissions system
Marcin Kuzminski <marcin@python-works.com>
parents:
diff changeset
36 <td>${h.radio('g_perm_%s' % g2p.users_group.users_group_name,'group.admin')}</td>
87f0800abc7b #227 Initial version of repository groups permissions system
Marcin Kuzminski <marcin@python-works.com>
parents:
diff changeset
37 <td style="white-space: nowrap;">
2142
a21eab6ff42f Added gravatars into permissions view and permissions autocomplete
Marcin Kuzminski <marcin@python-works.com>
parents: 2126
diff changeset
38 <img class="perm-gravatar" src="${h.url('/images/icons/group.png')}"/>${g2p.users_group.users_group_name}
1982
87f0800abc7b #227 Initial version of repository groups permissions system
Marcin Kuzminski <marcin@python-works.com>
parents:
diff changeset
39 </td>
87f0800abc7b #227 Initial version of repository groups permissions system
Marcin Kuzminski <marcin@python-works.com>
parents:
diff changeset
40 <td>
87f0800abc7b #227 Initial version of repository groups permissions system
Marcin Kuzminski <marcin@python-works.com>
parents:
diff changeset
41 <span class="delete_icon action_button" onclick="ajaxActionUsersGroup(${g2p.users_group.users_group_id},'${'id%s'%id(g2p.users_group.users_group_name)}')">
87f0800abc7b #227 Initial version of repository groups permissions system
Marcin Kuzminski <marcin@python-works.com>
parents:
diff changeset
42 ${_('revoke')}
87f0800abc7b #227 Initial version of repository groups permissions system
Marcin Kuzminski <marcin@python-works.com>
parents:
diff changeset
43 </span>
87f0800abc7b #227 Initial version of repository groups permissions system
Marcin Kuzminski <marcin@python-works.com>
parents:
diff changeset
44 </td>
87f0800abc7b #227 Initial version of repository groups permissions system
Marcin Kuzminski <marcin@python-works.com>
parents:
diff changeset
45 </tr>
87f0800abc7b #227 Initial version of repository groups permissions system
Marcin Kuzminski <marcin@python-works.com>
parents:
diff changeset
46 %endfor
87f0800abc7b #227 Initial version of repository groups permissions system
Marcin Kuzminski <marcin@python-works.com>
parents:
diff changeset
47 <tr id="add_perm_input">
87f0800abc7b #227 Initial version of repository groups permissions system
Marcin Kuzminski <marcin@python-works.com>
parents:
diff changeset
48 <td>${h.radio('perm_new_member','group.none')}</td>
87f0800abc7b #227 Initial version of repository groups permissions system
Marcin Kuzminski <marcin@python-works.com>
parents:
diff changeset
49 <td>${h.radio('perm_new_member','group.read')}</td>
87f0800abc7b #227 Initial version of repository groups permissions system
Marcin Kuzminski <marcin@python-works.com>
parents:
diff changeset
50 <td>${h.radio('perm_new_member','group.write')}</td>
87f0800abc7b #227 Initial version of repository groups permissions system
Marcin Kuzminski <marcin@python-works.com>
parents:
diff changeset
51 <td>${h.radio('perm_new_member','group.admin')}</td>
87f0800abc7b #227 Initial version of repository groups permissions system
Marcin Kuzminski <marcin@python-works.com>
parents:
diff changeset
52 <td class='ac'>
87f0800abc7b #227 Initial version of repository groups permissions system
Marcin Kuzminski <marcin@python-works.com>
parents:
diff changeset
53 <div class="perm_ac" id="perm_ac">
87f0800abc7b #227 Initial version of repository groups permissions system
Marcin Kuzminski <marcin@python-works.com>
parents:
diff changeset
54 ${h.text('perm_new_member_name',class_='yui-ac-input')}
87f0800abc7b #227 Initial version of repository groups permissions system
Marcin Kuzminski <marcin@python-works.com>
parents:
diff changeset
55 ${h.hidden('perm_new_member_type')}
87f0800abc7b #227 Initial version of repository groups permissions system
Marcin Kuzminski <marcin@python-works.com>
parents:
diff changeset
56 <div id="perm_container"></div>
87f0800abc7b #227 Initial version of repository groups permissions system
Marcin Kuzminski <marcin@python-works.com>
parents:
diff changeset
57 </div>
87f0800abc7b #227 Initial version of repository groups permissions system
Marcin Kuzminski <marcin@python-works.com>
parents:
diff changeset
58 </td>
87f0800abc7b #227 Initial version of repository groups permissions system
Marcin Kuzminski <marcin@python-works.com>
parents:
diff changeset
59 <td></td>
87f0800abc7b #227 Initial version of repository groups permissions system
Marcin Kuzminski <marcin@python-works.com>
parents:
diff changeset
60 </tr>
87f0800abc7b #227 Initial version of repository groups permissions system
Marcin Kuzminski <marcin@python-works.com>
parents:
diff changeset
61 <tr>
87f0800abc7b #227 Initial version of repository groups permissions system
Marcin Kuzminski <marcin@python-works.com>
parents:
diff changeset
62 <td colspan="6">
87f0800abc7b #227 Initial version of repository groups permissions system
Marcin Kuzminski <marcin@python-works.com>
parents:
diff changeset
63 <span id="add_perm" class="add_icon" style="cursor: pointer;">
87f0800abc7b #227 Initial version of repository groups permissions system
Marcin Kuzminski <marcin@python-works.com>
parents:
diff changeset
64 ${_('Add another member')}
87f0800abc7b #227 Initial version of repository groups permissions system
Marcin Kuzminski <marcin@python-works.com>
parents:
diff changeset
65 </span>
87f0800abc7b #227 Initial version of repository groups permissions system
Marcin Kuzminski <marcin@python-works.com>
parents:
diff changeset
66 </td>
87f0800abc7b #227 Initial version of repository groups permissions system
Marcin Kuzminski <marcin@python-works.com>
parents:
diff changeset
67 </tr>
87f0800abc7b #227 Initial version of repository groups permissions system
Marcin Kuzminski <marcin@python-works.com>
parents:
diff changeset
68 </table>
87f0800abc7b #227 Initial version of repository groups permissions system
Marcin Kuzminski <marcin@python-works.com>
parents:
diff changeset
69 <script type="text/javascript">
87f0800abc7b #227 Initial version of repository groups permissions system
Marcin Kuzminski <marcin@python-works.com>
parents:
diff changeset
70 function ajaxActionUser(user_id, field_id) {
2126
de72388c713d fixed #396 fixed problems with revoking users in nested groups
Marcin Kuzminski <marcin@python-works.com>
parents: 1982
diff changeset
71 var sUrl = "${h.url('delete_repos_group_user_perm',group_name=c.repos_group.group_name)}";
1982
87f0800abc7b #227 Initial version of repository groups permissions system
Marcin Kuzminski <marcin@python-works.com>
parents:
diff changeset
72 var callback = {
87f0800abc7b #227 Initial version of repository groups permissions system
Marcin Kuzminski <marcin@python-works.com>
parents:
diff changeset
73 success: function (o) {
87f0800abc7b #227 Initial version of repository groups permissions system
Marcin Kuzminski <marcin@python-works.com>
parents:
diff changeset
74 var tr = YUD.get(String(field_id));
87f0800abc7b #227 Initial version of repository groups permissions system
Marcin Kuzminski <marcin@python-works.com>
parents:
diff changeset
75 tr.parentNode.removeChild(tr);
87f0800abc7b #227 Initial version of repository groups permissions system
Marcin Kuzminski <marcin@python-works.com>
parents:
diff changeset
76 },
87f0800abc7b #227 Initial version of repository groups permissions system
Marcin Kuzminski <marcin@python-works.com>
parents:
diff changeset
77 failure: function (o) {
87f0800abc7b #227 Initial version of repository groups permissions system
Marcin Kuzminski <marcin@python-works.com>
parents:
diff changeset
78 alert("${_('Failed to remove user')}");
87f0800abc7b #227 Initial version of repository groups permissions system
Marcin Kuzminski <marcin@python-works.com>
parents:
diff changeset
79 },
87f0800abc7b #227 Initial version of repository groups permissions system
Marcin Kuzminski <marcin@python-works.com>
parents:
diff changeset
80 };
87f0800abc7b #227 Initial version of repository groups permissions system
Marcin Kuzminski <marcin@python-works.com>
parents:
diff changeset
81 var postData = '_method=delete&user_id=' + user_id;
87f0800abc7b #227 Initial version of repository groups permissions system
Marcin Kuzminski <marcin@python-works.com>
parents:
diff changeset
82 var request = YAHOO.util.Connect.asyncRequest('POST', sUrl, callback, postData);
87f0800abc7b #227 Initial version of repository groups permissions system
Marcin Kuzminski <marcin@python-works.com>
parents:
diff changeset
83 };
87f0800abc7b #227 Initial version of repository groups permissions system
Marcin Kuzminski <marcin@python-works.com>
parents:
diff changeset
84
87f0800abc7b #227 Initial version of repository groups permissions system
Marcin Kuzminski <marcin@python-works.com>
parents:
diff changeset
85 function ajaxActionUsersGroup(users_group_id,field_id){
2126
de72388c713d fixed #396 fixed problems with revoking users in nested groups
Marcin Kuzminski <marcin@python-works.com>
parents: 1982
diff changeset
86 var sUrl = "${h.url('delete_repos_group_users_group_perm',group_name=c.repos_group.group_name)}";
1982
87f0800abc7b #227 Initial version of repository groups permissions system
Marcin Kuzminski <marcin@python-works.com>
parents:
diff changeset
87 var callback = {
87f0800abc7b #227 Initial version of repository groups permissions system
Marcin Kuzminski <marcin@python-works.com>
parents:
diff changeset
88 success:function(o){
87f0800abc7b #227 Initial version of repository groups permissions system
Marcin Kuzminski <marcin@python-works.com>
parents:
diff changeset
89 var tr = YUD.get(String(field_id));
87f0800abc7b #227 Initial version of repository groups permissions system
Marcin Kuzminski <marcin@python-works.com>
parents:
diff changeset
90 tr.parentNode.removeChild(tr);
87f0800abc7b #227 Initial version of repository groups permissions system
Marcin Kuzminski <marcin@python-works.com>
parents:
diff changeset
91 },
87f0800abc7b #227 Initial version of repository groups permissions system
Marcin Kuzminski <marcin@python-works.com>
parents:
diff changeset
92 failure:function(o){
87f0800abc7b #227 Initial version of repository groups permissions system
Marcin Kuzminski <marcin@python-works.com>
parents:
diff changeset
93 alert("${_('Failed to remove users group')}");
87f0800abc7b #227 Initial version of repository groups permissions system
Marcin Kuzminski <marcin@python-works.com>
parents:
diff changeset
94 },
87f0800abc7b #227 Initial version of repository groups permissions system
Marcin Kuzminski <marcin@python-works.com>
parents:
diff changeset
95 };
87f0800abc7b #227 Initial version of repository groups permissions system
Marcin Kuzminski <marcin@python-works.com>
parents:
diff changeset
96 var postData = '_method=delete&users_group_id='+users_group_id;
87f0800abc7b #227 Initial version of repository groups permissions system
Marcin Kuzminski <marcin@python-works.com>
parents:
diff changeset
97 var request = YAHOO.util.Connect.asyncRequest('POST', sUrl, callback, postData);
87f0800abc7b #227 Initial version of repository groups permissions system
Marcin Kuzminski <marcin@python-works.com>
parents:
diff changeset
98 };
87f0800abc7b #227 Initial version of repository groups permissions system
Marcin Kuzminski <marcin@python-works.com>
parents:
diff changeset
99
87f0800abc7b #227 Initial version of repository groups permissions system
Marcin Kuzminski <marcin@python-works.com>
parents:
diff changeset
100 YUE.onDOMReady(function () {
87f0800abc7b #227 Initial version of repository groups permissions system
Marcin Kuzminski <marcin@python-works.com>
parents:
diff changeset
101 if (!YUD.hasClass('perm_new_member_name', 'error')) {
87f0800abc7b #227 Initial version of repository groups permissions system
Marcin Kuzminski <marcin@python-works.com>
parents:
diff changeset
102 YUD.setStyle('add_perm_input', 'display', 'none');
87f0800abc7b #227 Initial version of repository groups permissions system
Marcin Kuzminski <marcin@python-works.com>
parents:
diff changeset
103 }
87f0800abc7b #227 Initial version of repository groups permissions system
Marcin Kuzminski <marcin@python-works.com>
parents:
diff changeset
104 YAHOO.util.Event.addListener('add_perm', 'click', function () {
87f0800abc7b #227 Initial version of repository groups permissions system
Marcin Kuzminski <marcin@python-works.com>
parents:
diff changeset
105 YUD.setStyle('add_perm_input', 'display', '');
87f0800abc7b #227 Initial version of repository groups permissions system
Marcin Kuzminski <marcin@python-works.com>
parents:
diff changeset
106 YUD.setStyle('add_perm', 'opacity', '0.6');
87f0800abc7b #227 Initial version of repository groups permissions system
Marcin Kuzminski <marcin@python-works.com>
parents:
diff changeset
107 YUD.setStyle('add_perm', 'cursor', 'default');
87f0800abc7b #227 Initial version of repository groups permissions system
Marcin Kuzminski <marcin@python-works.com>
parents:
diff changeset
108 });
2369
c2f131502037 Autocomplete fixes
Marcin Kuzminski <marcin@python-works.com>
parents: 2150
diff changeset
109 MembersAutoComplete(${c.users_array|n}, ${c.users_groups_array|n});
1982
87f0800abc7b #227 Initial version of repository groups permissions system
Marcin Kuzminski <marcin@python-works.com>
parents:
diff changeset
110 });
87f0800abc7b #227 Initial version of repository groups permissions system
Marcin Kuzminski <marcin@python-works.com>
parents:
diff changeset
111
87f0800abc7b #227 Initial version of repository groups permissions system
Marcin Kuzminski <marcin@python-works.com>
parents:
diff changeset
112 </script>