Show More
@@ -1,128 +1,128 | |||
|
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.repo_info.repo_to_perm: |
|
12 | 12 | %if r2p.user.username =='default' and c.repo_info.private: |
|
13 | 13 | <tr> |
|
14 | 14 | <td colspan="4"> |
|
15 | 15 | <span class="private_repo_msg"> |
|
16 | 16 | ${_('private repository')} |
|
17 | 17 | </span> |
|
18 | 18 | </td> |
|
19 |
<td class="private_repo_msg"><img style="vertical-align:bottom" src="${h.url('/images/icons/user.png')}"/>${ |
|
|
19 | <td class="private_repo_msg"><img style="vertical-align:bottom" src="${h.url('/images/icons/user.png')}"/>${_('default')}</td> | |
|
20 | 20 | </tr> |
|
21 | 21 | %else: |
|
22 | 22 | <tr id="id${id(r2p.user.username)}"> |
|
23 | 23 | <td>${h.radio('u_perm_%s' % r2p.user.username,'repository.none')}</td> |
|
24 | 24 | <td>${h.radio('u_perm_%s' % r2p.user.username,'repository.read')}</td> |
|
25 | 25 | <td>${h.radio('u_perm_%s' % r2p.user.username,'repository.write')}</td> |
|
26 | 26 | <td>${h.radio('u_perm_%s' % r2p.user.username,'repository.admin')}</td> |
|
27 | 27 | <td style="white-space: nowrap;"> |
|
28 | <img class="perm-gravatar" src="${h.gravatar_url(r2p.user.email,14)}"/>${r2p.user.username} | |
|
28 | <img class="perm-gravatar" src="${h.gravatar_url(r2p.user.email,14)}"/>${r2p.user.username if r2p.user.username != 'default' else _('default')} | |
|
29 | 29 | </td> |
|
30 | 30 | <td> |
|
31 | 31 | %if r2p.user.username !='default': |
|
32 | 32 | <span class="delete_icon action_button" onclick="ajaxActionUser(${r2p.user.user_id},'${'id%s'%id(r2p.user.username)}')"> |
|
33 | 33 | ${_('revoke')} |
|
34 | 34 | </span> |
|
35 | 35 | %endif |
|
36 | 36 | </td> |
|
37 | 37 | </tr> |
|
38 | 38 | %endif |
|
39 | 39 | %endfor |
|
40 | 40 | |
|
41 | 41 | ## USERS GROUPS |
|
42 | 42 | %for g2p in c.repo_info.users_group_to_perm: |
|
43 | 43 | <tr id="id${id(g2p.users_group.users_group_name)}"> |
|
44 | 44 | <td>${h.radio('g_perm_%s' % g2p.users_group.users_group_name,'repository.none')}</td> |
|
45 | 45 | <td>${h.radio('g_perm_%s' % g2p.users_group.users_group_name,'repository.read')}</td> |
|
46 | 46 | <td>${h.radio('g_perm_%s' % g2p.users_group.users_group_name,'repository.write')}</td> |
|
47 | 47 | <td>${h.radio('g_perm_%s' % g2p.users_group.users_group_name,'repository.admin')}</td> |
|
48 | 48 | <td style="white-space: nowrap;"> |
|
49 | 49 | <img class="perm-gravatar" src="${h.url('/images/icons/group.png')}"/> |
|
50 | 50 | %if h.HasPermissionAny('hg.admin')(): |
|
51 | 51 | <a href="${h.url('edit_users_group',id=g2p.users_group.users_group_id)}">${g2p.users_group.users_group_name}</a> |
|
52 | 52 | %else: |
|
53 | 53 | ${g2p.users_group.users_group_name} |
|
54 | 54 | %endif |
|
55 | 55 | </td> |
|
56 | 56 | <td> |
|
57 | 57 | <span class="delete_icon action_button" onclick="ajaxActionUsersGroup(${g2p.users_group.users_group_id},'${'id%s'%id(g2p.users_group.users_group_name)}')"> |
|
58 | 58 | ${_('revoke')} |
|
59 | 59 | </span> |
|
60 | 60 | </td> |
|
61 | 61 | </tr> |
|
62 | 62 | %endfor |
|
63 | 63 | <tr id="add_perm_input"> |
|
64 | 64 | <td>${h.radio('perm_new_member','repository.none')}</td> |
|
65 | 65 | <td>${h.radio('perm_new_member','repository.read')}</td> |
|
66 | 66 | <td>${h.radio('perm_new_member','repository.write')}</td> |
|
67 | 67 | <td>${h.radio('perm_new_member','repository.admin')}</td> |
|
68 | 68 | <td class='ac'> |
|
69 | 69 | <div class="perm_ac" id="perm_ac"> |
|
70 | 70 | ${h.text('perm_new_member_name',class_='yui-ac-input')} |
|
71 | 71 | ${h.hidden('perm_new_member_type')} |
|
72 | 72 | <div id="perm_container"></div> |
|
73 | 73 | </div> |
|
74 | 74 | </td> |
|
75 | 75 | <td></td> |
|
76 | 76 | </tr> |
|
77 | 77 | <tr> |
|
78 | 78 | <td colspan="6"> |
|
79 | 79 | <span id="add_perm" class="add_icon" style="cursor: pointer;"> |
|
80 | 80 | ${_('Add another member')} |
|
81 | 81 | </span> |
|
82 | 82 | </td> |
|
83 | 83 | </tr> |
|
84 | 84 | </table> |
|
85 | 85 | <script type="text/javascript"> |
|
86 | 86 | function ajaxActionUser(user_id, field_id) { |
|
87 | 87 | var sUrl = "${h.url('delete_repo_user',repo_name=c.repo_name)}"; |
|
88 | 88 | var callback = { |
|
89 | 89 | success: function (o) { |
|
90 | 90 | var tr = YUD.get(String(field_id)); |
|
91 | 91 | tr.parentNode.removeChild(tr); |
|
92 | 92 | }, |
|
93 | 93 | failure: function (o) { |
|
94 | 94 | alert("${_('Failed to remove user')}"); |
|
95 | 95 | }, |
|
96 | 96 | }; |
|
97 | 97 | var postData = '_method=delete&user_id=' + user_id; |
|
98 | 98 | var request = YAHOO.util.Connect.asyncRequest('POST', sUrl, callback, postData); |
|
99 | 99 | }; |
|
100 | 100 | |
|
101 | 101 | function ajaxActionUsersGroup(users_group_id,field_id){ |
|
102 | 102 | var sUrl = "${h.url('delete_repo_users_group',repo_name=c.repo_name)}"; |
|
103 | 103 | var callback = { |
|
104 | 104 | success:function(o){ |
|
105 | 105 | var tr = YUD.get(String(field_id)); |
|
106 | 106 | tr.parentNode.removeChild(tr); |
|
107 | 107 | }, |
|
108 | 108 | failure:function(o){ |
|
109 | 109 | alert("${_('Failed to remove users group')}"); |
|
110 | 110 | }, |
|
111 | 111 | }; |
|
112 | 112 | var postData = '_method=delete&users_group_id='+users_group_id; |
|
113 | 113 | var request = YAHOO.util.Connect.asyncRequest('POST', sUrl, callback, postData); |
|
114 | 114 | }; |
|
115 | 115 | |
|
116 | 116 | YUE.onDOMReady(function () { |
|
117 | 117 | if (!YUD.hasClass('perm_new_member_name', 'error')) { |
|
118 | 118 | YUD.setStyle('add_perm_input', 'display', 'none'); |
|
119 | 119 | } |
|
120 | 120 | YAHOO.util.Event.addListener('add_perm', 'click', function () { |
|
121 | 121 | YUD.setStyle('add_perm_input', 'display', ''); |
|
122 | 122 | YUD.setStyle('add_perm', 'opacity', '0.6'); |
|
123 | 123 | YUD.setStyle('add_perm', 'cursor', 'default'); |
|
124 | 124 | }); |
|
125 | 125 | MembersAutoComplete(${c.users_array|n}, ${c.users_groups_array|n}); |
|
126 | 126 | }); |
|
127 | 127 | |
|
128 | 128 | </script> |
@@ -1,112 +1,112 | |||
|
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 | <img class="perm-gravatar" src="${h.gravatar_url(r2p.user.email,14)}"/>${r2p.user.username} | |
|
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 | <tr id="add_perm_input"> |
|
48 | 48 | <td>${h.radio('perm_new_member','group.none')}</td> |
|
49 | 49 | <td>${h.radio('perm_new_member','group.read')}</td> |
|
50 | 50 | <td>${h.radio('perm_new_member','group.write')}</td> |
|
51 | 51 | <td>${h.radio('perm_new_member','group.admin')}</td> |
|
52 | 52 | <td class='ac'> |
|
53 | 53 | <div class="perm_ac" id="perm_ac"> |
|
54 | 54 | ${h.text('perm_new_member_name',class_='yui-ac-input')} |
|
55 | 55 | ${h.hidden('perm_new_member_type')} |
|
56 | 56 | <div id="perm_container"></div> |
|
57 | 57 | </div> |
|
58 | 58 | </td> |
|
59 | 59 | <td></td> |
|
60 | 60 | </tr> |
|
61 | 61 | <tr> |
|
62 | 62 | <td colspan="6"> |
|
63 | 63 | <span id="add_perm" class="add_icon" style="cursor: pointer;"> |
|
64 | 64 | ${_('Add another member')} |
|
65 | 65 | </span> |
|
66 | 66 | </td> |
|
67 | 67 | </tr> |
|
68 | 68 | </table> |
|
69 | 69 | <script type="text/javascript"> |
|
70 | 70 | function ajaxActionUser(user_id, field_id) { |
|
71 | 71 | var sUrl = "${h.url('delete_repos_group_user_perm',group_name=c.repos_group.group_name)}"; |
|
72 | 72 | var callback = { |
|
73 | 73 | success: function (o) { |
|
74 | 74 | var tr = YUD.get(String(field_id)); |
|
75 | 75 | tr.parentNode.removeChild(tr); |
|
76 | 76 | }, |
|
77 | 77 | failure: function (o) { |
|
78 | 78 | alert("${_('Failed to remove user')}"); |
|
79 | 79 | }, |
|
80 | 80 | }; |
|
81 | 81 | var postData = '_method=delete&user_id=' + user_id; |
|
82 | 82 | var request = YAHOO.util.Connect.asyncRequest('POST', sUrl, callback, postData); |
|
83 | 83 | }; |
|
84 | 84 | |
|
85 | 85 | function ajaxActionUsersGroup(users_group_id,field_id){ |
|
86 | 86 | var sUrl = "${h.url('delete_repos_group_users_group_perm',group_name=c.repos_group.group_name)}"; |
|
87 | 87 | var callback = { |
|
88 | 88 | success:function(o){ |
|
89 | 89 | var tr = YUD.get(String(field_id)); |
|
90 | 90 | tr.parentNode.removeChild(tr); |
|
91 | 91 | }, |
|
92 | 92 | failure:function(o){ |
|
93 | 93 | alert("${_('Failed to remove users group')}"); |
|
94 | 94 | }, |
|
95 | 95 | }; |
|
96 | 96 | var postData = '_method=delete&users_group_id='+users_group_id; |
|
97 | 97 | var request = YAHOO.util.Connect.asyncRequest('POST', sUrl, callback, postData); |
|
98 | 98 | }; |
|
99 | 99 | |
|
100 | 100 | YUE.onDOMReady(function () { |
|
101 | 101 | if (!YUD.hasClass('perm_new_member_name', 'error')) { |
|
102 | 102 | YUD.setStyle('add_perm_input', 'display', 'none'); |
|
103 | 103 | } |
|
104 | 104 | YAHOO.util.Event.addListener('add_perm', 'click', function () { |
|
105 | 105 | YUD.setStyle('add_perm_input', 'display', ''); |
|
106 | 106 | YUD.setStyle('add_perm', 'opacity', '0.6'); |
|
107 | 107 | YUD.setStyle('add_perm', 'cursor', 'default'); |
|
108 | 108 | }); |
|
109 | 109 | MembersAutoComplete(${c.users_array|n}, ${c.users_groups_array|n}); |
|
110 | 110 | }); |
|
111 | 111 | |
|
112 | 112 | </script> |
General Comments 0
You need to be logged in to leave comments.
Login now