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