##// END OF EJS Templates
typo fix
marcink -
r2832:b711b337 beta
parent child Browse files
Show More
@@ -1,120 +1,120 b''
1 1 <table id="permissions_manage" class="noborder">
2 2 <tr>
3 3 <td>${_('none')}</td>
4 4 <td>${_('read')}</td>
5 5 <td>${_('write')}</td>
6 6 <td>${_('admin')}</td>
7 7 <td>${_('member')}</td>
8 8 <td></td>
9 9 </tr>
10 10 ## USERS
11 11 %for r2p in c.repos_group.repo_group_to_perm:
12 12 <tr id="id${id(r2p.user.username)}">
13 13 <td>${h.radio('u_perm_%s' % r2p.user.username,'group.none')}</td>
14 14 <td>${h.radio('u_perm_%s' % r2p.user.username,'group.read')}</td>
15 15 <td>${h.radio('u_perm_%s' % r2p.user.username,'group.write')}</td>
16 16 <td>${h.radio('u_perm_%s' % r2p.user.username,'group.admin')}</td>
17 17 <td style="white-space: nowrap;">
18 18 <img class="perm-gravatar" src="${h.gravatar_url(r2p.user.email,14)}"/>${r2p.user.username if r2p.user.username != 'default' else _('default')}
19 19 </td>
20 20 <td>
21 21 %if r2p.user.username !='default':
22 22 <span class="delete_icon action_button" onclick="ajaxActionUser(${r2p.user.user_id},'${'id%s'%id(r2p.user.username)}')">
23 23 ${_('revoke')}
24 24 </span>
25 25 %endif
26 26 </td>
27 27 </tr>
28 28 %endfor
29 29
30 30 ## USERS GROUPS
31 31 %for g2p in c.repos_group.users_group_to_perm:
32 32 <tr id="id${id(g2p.users_group.users_group_name)}">
33 33 <td>${h.radio('g_perm_%s' % g2p.users_group.users_group_name,'group.none')}</td>
34 34 <td>${h.radio('g_perm_%s' % g2p.users_group.users_group_name,'group.read')}</td>
35 35 <td>${h.radio('g_perm_%s' % g2p.users_group.users_group_name,'group.write')}</td>
36 36 <td>${h.radio('g_perm_%s' % g2p.users_group.users_group_name,'group.admin')}</td>
37 37 <td style="white-space: nowrap;">
38 38 <img class="perm-gravatar" src="${h.url('/images/icons/group.png')}"/>${g2p.users_group.users_group_name}
39 39 </td>
40 40 <td>
41 41 <span class="delete_icon action_button" onclick="ajaxActionUsersGroup(${g2p.users_group.users_group_id},'${'id%s'%id(g2p.users_group.users_group_name)}')">
42 42 ${_('revoke')}
43 43 </span>
44 44 </td>
45 45 </tr>
46 46 %endfor
47 47 <%
48 48 _tmpl = h.literal("""' \
49 49 <td><input type="radio" value="group.none" name="perm_new_member_{0}" id="perm_new_member_{0}"></td> \
50 50 <td><input type="radio" value="group.read" name="perm_new_member_{0}" id="perm_new_member_{0}"></td> \
51 51 <td><input type="radio" value="group.write" name="perm_new_member_{0}" id="perm_new_member_{0}"></td> \
52 52 <td><input type="radio" value="group.admin" name="perm_new_member_{0}" id="perm_new_member_{0}"></td> \
53 53 <td class="ac"> \
54 54 <div class="perm_ac" id="perm_ac_{0}"> \
55 55 <input class="yui-ac-input" id="perm_new_member_name_{0}" name="perm_new_member_name_{0}" value="" type="text"> \
56 56 <input id="perm_new_member_type_{0}" name="perm_new_member_type_{0}" value="" type="hidden"> \
57 57 <div id="perm_container_{0}"></div> \
58 58 </div> \
59 59 </td> \
60 60 <td></td>'""")
61 61 %>
62 62 ## ADD HERE DYNAMICALLY NEW INPUTS FROM THE '_tmpl'
63 63 <tr class="new_members last_new_member" id="add_perm_input"></tr>
64 64 <tr>
65 65 <td colspan="6">
66 66 <span id="add_perm" class="add_icon" style="cursor: pointer;">
67 67 ${_('Add another member')}
68 68 </span>
69 69 </td>
70 70 </tr>
71 71 <tr>
72 72 <td colspan="6">
73 ${h.checkbox('recursive',value="True", label=_('apply to parents'))}
73 ${h.checkbox('recursive',value="True", label=_('apply to children'))}
74 74 <span class="help-block">${_('Set or revoke permission to all children of that group, including repositories and other groups')}</span>
75 75 </td>
76 76 </tr>
77 77 </table>
78 78 <script type="text/javascript">
79 79 function ajaxActionUser(user_id, field_id) {
80 80 var sUrl = "${h.url('delete_repos_group_user_perm',group_name=c.repos_group.group_name)}";
81 81 var callback = {
82 82 success: function (o) {
83 83 var tr = YUD.get(String(field_id));
84 84 tr.parentNode.removeChild(tr);
85 85 },
86 86 failure: function (o) {
87 87 alert("${_('Failed to remove user')}");
88 88 },
89 89 };
90 90 var recursive = YUD.get('recursive').checked;
91 91 var postData = '_method=delete&recursive={0}&user_id={1}'.format(recursive,user_id);
92 92 var request = YAHOO.util.Connect.asyncRequest('POST', sUrl, callback, postData);
93 93 };
94 94
95 95 function ajaxActionUsersGroup(users_group_id,field_id){
96 96 var sUrl = "${h.url('delete_repos_group_users_group_perm',group_name=c.repos_group.group_name)}";
97 97 var callback = {
98 98 success:function(o){
99 99 var tr = YUD.get(String(field_id));
100 100 tr.parentNode.removeChild(tr);
101 101 },
102 102 failure:function(o){
103 103 alert("${_('Failed to remove users group')}");
104 104 },
105 105 };
106 106 var recursive = YUD.get('recursive').checked;
107 107 var postData = '_method=delete&recursive={0}&users_group_id={1}'.format(recursive,users_group_id);
108 108 var request = YAHOO.util.Connect.asyncRequest('POST', sUrl, callback, postData);
109 109 };
110 110
111 111 YUE.onDOMReady(function () {
112 112 if (!YUD.hasClass('perm_new_member_name', 'error')) {
113 113 YUD.setStyle('add_perm_input', 'display', 'none');
114 114 }
115 115 YAHOO.util.Event.addListener('add_perm', 'click', function () {
116 116 addPermAction(${_tmpl}, ${c.users_array|n}, ${c.users_groups_array|n});
117 117 });
118 118 });
119 119
120 120 </script>
General Comments 0
You need to be logged in to leave comments. Login now