Mercurial > kallithea
annotate rhodecode/templates/admin/repos/repo_edit_perms.html @ 1015:65129c332d37 beta
#56 added ajax removal of users groups,
fixed permission edition templates by regular non admin users
found bugfixes in forms for users groups
author | Marcin Kuzminski <marcin@python-works.com> |
---|---|
date | Wed, 09 Feb 2011 17:41:27 +0100 |
parents | |
children | 90eadff2c2a8 |
rev | line source |
---|---|
1015
65129c332d37
#56 added ajax removal of users groups,
Marcin Kuzminski <marcin@python-works.com>
parents:
diff
changeset
|
1 <table id="permissions_manage"> |
65129c332d37
#56 added ajax removal of users groups,
Marcin Kuzminski <marcin@python-works.com>
parents:
diff
changeset
|
2 <tr> |
65129c332d37
#56 added ajax removal of users groups,
Marcin Kuzminski <marcin@python-works.com>
parents:
diff
changeset
|
3 <td>${_('none')}</td> |
65129c332d37
#56 added ajax removal of users groups,
Marcin Kuzminski <marcin@python-works.com>
parents:
diff
changeset
|
4 <td>${_('read')}</td> |
65129c332d37
#56 added ajax removal of users groups,
Marcin Kuzminski <marcin@python-works.com>
parents:
diff
changeset
|
5 <td>${_('write')}</td> |
65129c332d37
#56 added ajax removal of users groups,
Marcin Kuzminski <marcin@python-works.com>
parents:
diff
changeset
|
6 <td>${_('admin')}</td> |
65129c332d37
#56 added ajax removal of users groups,
Marcin Kuzminski <marcin@python-works.com>
parents:
diff
changeset
|
7 <td>${_('member')}</td> |
65129c332d37
#56 added ajax removal of users groups,
Marcin Kuzminski <marcin@python-works.com>
parents:
diff
changeset
|
8 <td></td> |
65129c332d37
#56 added ajax removal of users groups,
Marcin Kuzminski <marcin@python-works.com>
parents:
diff
changeset
|
9 </tr> |
65129c332d37
#56 added ajax removal of users groups,
Marcin Kuzminski <marcin@python-works.com>
parents:
diff
changeset
|
10 ## USERS |
65129c332d37
#56 added ajax removal of users groups,
Marcin Kuzminski <marcin@python-works.com>
parents:
diff
changeset
|
11 <script type="text/javascript"> |
65129c332d37
#56 added ajax removal of users groups,
Marcin Kuzminski <marcin@python-works.com>
parents:
diff
changeset
|
12 function ajaxActionUser(user_id,field_id){ |
65129c332d37
#56 added ajax removal of users groups,
Marcin Kuzminski <marcin@python-works.com>
parents:
diff
changeset
|
13 var sUrl = "${h.url('delete_repo_user',repo_name=c.repo_name)}"; |
65129c332d37
#56 added ajax removal of users groups,
Marcin Kuzminski <marcin@python-works.com>
parents:
diff
changeset
|
14 var callback = { success:function(o){ |
65129c332d37
#56 added ajax removal of users groups,
Marcin Kuzminski <marcin@python-works.com>
parents:
diff
changeset
|
15 var tr = YUD.get(String(field_id)); |
65129c332d37
#56 added ajax removal of users groups,
Marcin Kuzminski <marcin@python-works.com>
parents:
diff
changeset
|
16 tr.parentNode.removeChild(tr);}, |
65129c332d37
#56 added ajax removal of users groups,
Marcin Kuzminski <marcin@python-works.com>
parents:
diff
changeset
|
17 failure:function(o){ |
65129c332d37
#56 added ajax removal of users groups,
Marcin Kuzminski <marcin@python-works.com>
parents:
diff
changeset
|
18 alert("${_('Failed to remove user')}");},}; |
65129c332d37
#56 added ajax removal of users groups,
Marcin Kuzminski <marcin@python-works.com>
parents:
diff
changeset
|
19 var postData = '_method=delete&user_id='+user_id; |
65129c332d37
#56 added ajax removal of users groups,
Marcin Kuzminski <marcin@python-works.com>
parents:
diff
changeset
|
20 var request = YAHOO.util.Connect.asyncRequest('POST', sUrl, callback, postData);}; |
65129c332d37
#56 added ajax removal of users groups,
Marcin Kuzminski <marcin@python-works.com>
parents:
diff
changeset
|
21 </script> |
65129c332d37
#56 added ajax removal of users groups,
Marcin Kuzminski <marcin@python-works.com>
parents:
diff
changeset
|
22 %for r2p in c.repo_info.repo_to_perm: |
65129c332d37
#56 added ajax removal of users groups,
Marcin Kuzminski <marcin@python-works.com>
parents:
diff
changeset
|
23 %if r2p.user.username =='default' and c.repo_info.private: |
65129c332d37
#56 added ajax removal of users groups,
Marcin Kuzminski <marcin@python-works.com>
parents:
diff
changeset
|
24 <tr> |
65129c332d37
#56 added ajax removal of users groups,
Marcin Kuzminski <marcin@python-works.com>
parents:
diff
changeset
|
25 <td colspan="4"> |
65129c332d37
#56 added ajax removal of users groups,
Marcin Kuzminski <marcin@python-works.com>
parents:
diff
changeset
|
26 <span class="private_repo_msg"> |
65129c332d37
#56 added ajax removal of users groups,
Marcin Kuzminski <marcin@python-works.com>
parents:
diff
changeset
|
27 ${_('private repository')} |
65129c332d37
#56 added ajax removal of users groups,
Marcin Kuzminski <marcin@python-works.com>
parents:
diff
changeset
|
28 </span> |
65129c332d37
#56 added ajax removal of users groups,
Marcin Kuzminski <marcin@python-works.com>
parents:
diff
changeset
|
29 </td> |
65129c332d37
#56 added ajax removal of users groups,
Marcin Kuzminski <marcin@python-works.com>
parents:
diff
changeset
|
30 <td class="private_repo_msg"><img style="vertical-align:bottom" src="/images/icons/user.png"/>${r2p.user.username}</td> |
65129c332d37
#56 added ajax removal of users groups,
Marcin Kuzminski <marcin@python-works.com>
parents:
diff
changeset
|
31 </tr> |
65129c332d37
#56 added ajax removal of users groups,
Marcin Kuzminski <marcin@python-works.com>
parents:
diff
changeset
|
32 %else: |
65129c332d37
#56 added ajax removal of users groups,
Marcin Kuzminski <marcin@python-works.com>
parents:
diff
changeset
|
33 <tr id="id${id(r2p.user.username)}"> |
65129c332d37
#56 added ajax removal of users groups,
Marcin Kuzminski <marcin@python-works.com>
parents:
diff
changeset
|
34 <td>${h.radio('u_perm_%s' % r2p.user.username,'repository.none')}</td> |
65129c332d37
#56 added ajax removal of users groups,
Marcin Kuzminski <marcin@python-works.com>
parents:
diff
changeset
|
35 <td>${h.radio('u_perm_%s' % r2p.user.username,'repository.read')}</td> |
65129c332d37
#56 added ajax removal of users groups,
Marcin Kuzminski <marcin@python-works.com>
parents:
diff
changeset
|
36 <td>${h.radio('u_perm_%s' % r2p.user.username,'repository.write')}</td> |
65129c332d37
#56 added ajax removal of users groups,
Marcin Kuzminski <marcin@python-works.com>
parents:
diff
changeset
|
37 <td>${h.radio('u_perm_%s' % r2p.user.username,'repository.admin')}</td> |
65129c332d37
#56 added ajax removal of users groups,
Marcin Kuzminski <marcin@python-works.com>
parents:
diff
changeset
|
38 <td style="white-space: nowrap;"><img style="vertical-align:bottom" src="/images/icons/user.png"/>${r2p.user.username}</td> |
65129c332d37
#56 added ajax removal of users groups,
Marcin Kuzminski <marcin@python-works.com>
parents:
diff
changeset
|
39 <td> |
65129c332d37
#56 added ajax removal of users groups,
Marcin Kuzminski <marcin@python-works.com>
parents:
diff
changeset
|
40 %if r2p.user.username !='default': |
65129c332d37
#56 added ajax removal of users groups,
Marcin Kuzminski <marcin@python-works.com>
parents:
diff
changeset
|
41 <span class="delete_icon action_button" onclick="ajaxActionUser(${r2p.user.user_id},'${'id%s'%id(r2p.user.username)}')"> |
65129c332d37
#56 added ajax removal of users groups,
Marcin Kuzminski <marcin@python-works.com>
parents:
diff
changeset
|
42 </span> |
65129c332d37
#56 added ajax removal of users groups,
Marcin Kuzminski <marcin@python-works.com>
parents:
diff
changeset
|
43 %endif |
65129c332d37
#56 added ajax removal of users groups,
Marcin Kuzminski <marcin@python-works.com>
parents:
diff
changeset
|
44 </td> |
65129c332d37
#56 added ajax removal of users groups,
Marcin Kuzminski <marcin@python-works.com>
parents:
diff
changeset
|
45 </tr> |
65129c332d37
#56 added ajax removal of users groups,
Marcin Kuzminski <marcin@python-works.com>
parents:
diff
changeset
|
46 %endif |
65129c332d37
#56 added ajax removal of users groups,
Marcin Kuzminski <marcin@python-works.com>
parents:
diff
changeset
|
47 %endfor |
65129c332d37
#56 added ajax removal of users groups,
Marcin Kuzminski <marcin@python-works.com>
parents:
diff
changeset
|
48 |
65129c332d37
#56 added ajax removal of users groups,
Marcin Kuzminski <marcin@python-works.com>
parents:
diff
changeset
|
49 ## USERS GROUPS |
65129c332d37
#56 added ajax removal of users groups,
Marcin Kuzminski <marcin@python-works.com>
parents:
diff
changeset
|
50 <script type="text/javascript"> |
65129c332d37
#56 added ajax removal of users groups,
Marcin Kuzminski <marcin@python-works.com>
parents:
diff
changeset
|
51 function ajaxActionUsersGroup(users_group_id,field_id){ |
65129c332d37
#56 added ajax removal of users groups,
Marcin Kuzminski <marcin@python-works.com>
parents:
diff
changeset
|
52 var sUrl = "${h.url('delete_repo_users_group',repo_name=c.repo_name)}"; |
65129c332d37
#56 added ajax removal of users groups,
Marcin Kuzminski <marcin@python-works.com>
parents:
diff
changeset
|
53 var callback = { success:function(o){ |
65129c332d37
#56 added ajax removal of users groups,
Marcin Kuzminski <marcin@python-works.com>
parents:
diff
changeset
|
54 var tr = YUD.get(String(field_id)); |
65129c332d37
#56 added ajax removal of users groups,
Marcin Kuzminski <marcin@python-works.com>
parents:
diff
changeset
|
55 tr.parentNode.removeChild(tr);}, |
65129c332d37
#56 added ajax removal of users groups,
Marcin Kuzminski <marcin@python-works.com>
parents:
diff
changeset
|
56 failure:function(o){ |
65129c332d37
#56 added ajax removal of users groups,
Marcin Kuzminski <marcin@python-works.com>
parents:
diff
changeset
|
57 alert("${_('Failed to remove users group')}");},}; |
65129c332d37
#56 added ajax removal of users groups,
Marcin Kuzminski <marcin@python-works.com>
parents:
diff
changeset
|
58 var postData = '_method=delete&users_group_id='+users_group_id; |
65129c332d37
#56 added ajax removal of users groups,
Marcin Kuzminski <marcin@python-works.com>
parents:
diff
changeset
|
59 var request = YAHOO.util.Connect.asyncRequest('POST', sUrl, callback, postData);}; |
65129c332d37
#56 added ajax removal of users groups,
Marcin Kuzminski <marcin@python-works.com>
parents:
diff
changeset
|
60 </script> |
65129c332d37
#56 added ajax removal of users groups,
Marcin Kuzminski <marcin@python-works.com>
parents:
diff
changeset
|
61 %for g2p in c.repo_info.users_group_to_perm: |
65129c332d37
#56 added ajax removal of users groups,
Marcin Kuzminski <marcin@python-works.com>
parents:
diff
changeset
|
62 <tr id="id${id(g2p.users_group.users_group_name)}"> |
65129c332d37
#56 added ajax removal of users groups,
Marcin Kuzminski <marcin@python-works.com>
parents:
diff
changeset
|
63 <td>${h.radio('g_perm_%s' % g2p.users_group.users_group_name,'repository.none')}</td> |
65129c332d37
#56 added ajax removal of users groups,
Marcin Kuzminski <marcin@python-works.com>
parents:
diff
changeset
|
64 <td>${h.radio('g_perm_%s' % g2p.users_group.users_group_name,'repository.read')}</td> |
65129c332d37
#56 added ajax removal of users groups,
Marcin Kuzminski <marcin@python-works.com>
parents:
diff
changeset
|
65 <td>${h.radio('g_perm_%s' % g2p.users_group.users_group_name,'repository.write')}</td> |
65129c332d37
#56 added ajax removal of users groups,
Marcin Kuzminski <marcin@python-works.com>
parents:
diff
changeset
|
66 <td>${h.radio('g_perm_%s' % g2p.users_group.users_group_name,'repository.admin')}</td> |
65129c332d37
#56 added ajax removal of users groups,
Marcin Kuzminski <marcin@python-works.com>
parents:
diff
changeset
|
67 <td><img style="vertical-align:bottom" src="/images/icons/group.png"/>${g2p.users_group.users_group_name}</td> |
65129c332d37
#56 added ajax removal of users groups,
Marcin Kuzminski <marcin@python-works.com>
parents:
diff
changeset
|
68 <td> |
65129c332d37
#56 added ajax removal of users groups,
Marcin Kuzminski <marcin@python-works.com>
parents:
diff
changeset
|
69 <span class="delete_icon action_button" onclick="ajaxActionUsersGroup(${g2p.users_group.users_group_id},'${'id%s'%id(g2p.users_group.users_group_name)}')"> |
65129c332d37
#56 added ajax removal of users groups,
Marcin Kuzminski <marcin@python-works.com>
parents:
diff
changeset
|
70 </span> |
65129c332d37
#56 added ajax removal of users groups,
Marcin Kuzminski <marcin@python-works.com>
parents:
diff
changeset
|
71 </td> |
65129c332d37
#56 added ajax removal of users groups,
Marcin Kuzminski <marcin@python-works.com>
parents:
diff
changeset
|
72 </tr> |
65129c332d37
#56 added ajax removal of users groups,
Marcin Kuzminski <marcin@python-works.com>
parents:
diff
changeset
|
73 %endfor |
65129c332d37
#56 added ajax removal of users groups,
Marcin Kuzminski <marcin@python-works.com>
parents:
diff
changeset
|
74 <tr id="add_perm_input"> |
65129c332d37
#56 added ajax removal of users groups,
Marcin Kuzminski <marcin@python-works.com>
parents:
diff
changeset
|
75 <td>${h.radio('perm_new_member','repository.none')}</td> |
65129c332d37
#56 added ajax removal of users groups,
Marcin Kuzminski <marcin@python-works.com>
parents:
diff
changeset
|
76 <td>${h.radio('perm_new_member','repository.read')}</td> |
65129c332d37
#56 added ajax removal of users groups,
Marcin Kuzminski <marcin@python-works.com>
parents:
diff
changeset
|
77 <td>${h.radio('perm_new_member','repository.write')}</td> |
65129c332d37
#56 added ajax removal of users groups,
Marcin Kuzminski <marcin@python-works.com>
parents:
diff
changeset
|
78 <td>${h.radio('perm_new_member','repository.admin')}</td> |
65129c332d37
#56 added ajax removal of users groups,
Marcin Kuzminski <marcin@python-works.com>
parents:
diff
changeset
|
79 <td class='ac'> |
65129c332d37
#56 added ajax removal of users groups,
Marcin Kuzminski <marcin@python-works.com>
parents:
diff
changeset
|
80 <div class="perm_ac" id="perm_ac"> |
65129c332d37
#56 added ajax removal of users groups,
Marcin Kuzminski <marcin@python-works.com>
parents:
diff
changeset
|
81 ${h.text('perm_new_member_name',class_='yui-ac-input')} |
65129c332d37
#56 added ajax removal of users groups,
Marcin Kuzminski <marcin@python-works.com>
parents:
diff
changeset
|
82 ${h.hidden('perm_new_member_type')} |
65129c332d37
#56 added ajax removal of users groups,
Marcin Kuzminski <marcin@python-works.com>
parents:
diff
changeset
|
83 <div id="perm_container"></div> |
65129c332d37
#56 added ajax removal of users groups,
Marcin Kuzminski <marcin@python-works.com>
parents:
diff
changeset
|
84 </div> |
65129c332d37
#56 added ajax removal of users groups,
Marcin Kuzminski <marcin@python-works.com>
parents:
diff
changeset
|
85 </td> |
65129c332d37
#56 added ajax removal of users groups,
Marcin Kuzminski <marcin@python-works.com>
parents:
diff
changeset
|
86 <td></td> |
65129c332d37
#56 added ajax removal of users groups,
Marcin Kuzminski <marcin@python-works.com>
parents:
diff
changeset
|
87 </tr> |
65129c332d37
#56 added ajax removal of users groups,
Marcin Kuzminski <marcin@python-works.com>
parents:
diff
changeset
|
88 <tr> |
65129c332d37
#56 added ajax removal of users groups,
Marcin Kuzminski <marcin@python-works.com>
parents:
diff
changeset
|
89 <td colspan="6"> |
65129c332d37
#56 added ajax removal of users groups,
Marcin Kuzminski <marcin@python-works.com>
parents:
diff
changeset
|
90 <span id="add_perm" class="add_icon" style="cursor: pointer;"> |
65129c332d37
#56 added ajax removal of users groups,
Marcin Kuzminski <marcin@python-works.com>
parents:
diff
changeset
|
91 ${_('Add another member')} |
65129c332d37
#56 added ajax removal of users groups,
Marcin Kuzminski <marcin@python-works.com>
parents:
diff
changeset
|
92 </span> |
65129c332d37
#56 added ajax removal of users groups,
Marcin Kuzminski <marcin@python-works.com>
parents:
diff
changeset
|
93 </td> |
65129c332d37
#56 added ajax removal of users groups,
Marcin Kuzminski <marcin@python-works.com>
parents:
diff
changeset
|
94 </tr> |
65129c332d37
#56 added ajax removal of users groups,
Marcin Kuzminski <marcin@python-works.com>
parents:
diff
changeset
|
95 </table> |