##// END OF EJS Templates
UX: require confirmation of revoking permissions on...
marcink -
r4064:afe7c5e6 default
parent child Browse files
Show More
@@ -1,103 +1,106 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.repo_info.repo_to_perm:
11 %for r2p in c.repo_info.repo_to_perm:
12 %if r2p.user.username =='default' and c.repo_info.private:
12 %if r2p.user.username =='default' and c.repo_info.private:
13 <tr>
13 <tr>
14 <td colspan="4">
14 <td colspan="4">
15 <span class="private_repo_msg">
15 <span class="private_repo_msg">
16 ${_('private repository')}
16 ${_('private repository')}
17 </span>
17 </span>
18 </td>
18 </td>
19 <td class="private_repo_msg"><img style="vertical-align:bottom" src="${h.url('/images/icons/user.png')}"/>${_('default')}</td>
19 <td class="private_repo_msg"><img style="vertical-align:bottom" src="${h.url('/images/icons/user.png')}"/>${_('default')}</td>
20 </tr>
20 </tr>
21 %else:
21 %else:
22 <tr id="id${id(r2p.user.username)}">
22 <tr id="id${id(r2p.user.username)}">
23 <td>${h.radio('u_perm_%s' % r2p.user.username,'repository.none')}</td>
23 <td>${h.radio('u_perm_%s' % r2p.user.username,'repository.none')}</td>
24 <td>${h.radio('u_perm_%s' % r2p.user.username,'repository.read')}</td>
24 <td>${h.radio('u_perm_%s' % r2p.user.username,'repository.read')}</td>
25 <td>${h.radio('u_perm_%s' % r2p.user.username,'repository.write')}</td>
25 <td>${h.radio('u_perm_%s' % r2p.user.username,'repository.write')}</td>
26 <td>${h.radio('u_perm_%s' % r2p.user.username,'repository.admin')}</td>
26 <td>${h.radio('u_perm_%s' % r2p.user.username,'repository.admin')}</td>
27 <td style="white-space: nowrap;">
27 <td style="white-space: nowrap;">
28 <img class="perm-gravatar" src="${h.gravatar_url(r2p.user.email,14)}"/>${r2p.user.username if r2p.user.username != 'default' else _('default')}
28 <img class="perm-gravatar" src="${h.gravatar_url(r2p.user.email,14)}"/>${r2p.user.username if r2p.user.username != 'default' else _('default')}
29 </td>
29 </td>
30 <td>
30 <td>
31 %if r2p.user.username !='default':
31 %if r2p.user.username !='default':
32 <span class="delete_icon action_button" onclick="ajaxActionRevoke(${r2p.user.user_id}, 'user', '${'id%s'%id(r2p.user.username)}')">
32 <span class="delete_icon action_button" onclick="ajaxActionRevoke(${r2p.user.user_id}, 'user', '${'id%s'%id(r2p.user.username)}', '${r2p.user.username}')">
33 ${_('revoke')}
33 ${_('revoke')}
34 </span>
34 </span>
35 %endif
35 %endif
36 </td>
36 </td>
37 </tr>
37 </tr>
38 %endif
38 %endif
39 %endfor
39 %endfor
40
40
41 ## USER GROUPS
41 ## USER GROUPS
42 %for g2p in c.repo_info.users_group_to_perm:
42 %for g2p in c.repo_info.users_group_to_perm:
43 <tr id="id${id(g2p.users_group.users_group_name)}">
43 <tr id="id${id(g2p.users_group.users_group_name)}">
44 <td>${h.radio('g_perm_%s' % g2p.users_group.users_group_name,'repository.none')}</td>
44 <td>${h.radio('g_perm_%s' % g2p.users_group.users_group_name,'repository.none')}</td>
45 <td>${h.radio('g_perm_%s' % g2p.users_group.users_group_name,'repository.read')}</td>
45 <td>${h.radio('g_perm_%s' % g2p.users_group.users_group_name,'repository.read')}</td>
46 <td>${h.radio('g_perm_%s' % g2p.users_group.users_group_name,'repository.write')}</td>
46 <td>${h.radio('g_perm_%s' % g2p.users_group.users_group_name,'repository.write')}</td>
47 <td>${h.radio('g_perm_%s' % g2p.users_group.users_group_name,'repository.admin')}</td>
47 <td>${h.radio('g_perm_%s' % g2p.users_group.users_group_name,'repository.admin')}</td>
48 <td style="white-space: nowrap;">
48 <td style="white-space: nowrap;">
49 <img class="perm-gravatar" src="${h.url('/images/icons/group.png')}"/>
49 <img class="perm-gravatar" src="${h.url('/images/icons/group.png')}"/>
50 %if h.HasPermissionAny('hg.admin')():
50 %if h.HasPermissionAny('hg.admin')():
51 <a href="${h.url('edit_users_group',id=g2p.users_group.users_group_id)}">${g2p.users_group.users_group_name}</a>
51 <a href="${h.url('edit_users_group',id=g2p.users_group.users_group_id)}">${g2p.users_group.users_group_name}</a>
52 %else:
52 %else:
53 ${g2p.users_group.users_group_name}
53 ${g2p.users_group.users_group_name}
54 %endif
54 %endif
55 </td>
55 </td>
56 <td>
56 <td>
57 <span class="delete_icon action_button" onclick="ajaxActionRevoke(${g2p.users_group.users_group_id}, 'user_group', '${'id%s'%id(g2p.users_group.users_group_name)}')">
57 <span class="delete_icon action_button" onclick="ajaxActionRevoke(${g2p.users_group.users_group_id}, 'user_group', '${'id%s'%id(g2p.users_group.users_group_name)}', '${g2p.users_group.users_group_name}')">
58 ${_('revoke')}
58 ${_('revoke')}
59 </span>
59 </span>
60 </td>
60 </td>
61 </tr>
61 </tr>
62 %endfor
62 %endfor
63 <%
63 <%
64 _tmpl = h.literal("""' \
64 _tmpl = h.literal("""' \
65 <td><input type="radio" value="repository.none" name="perm_new_member_{0}" id="perm_new_member_{0}"></td> \
65 <td><input type="radio" value="repository.none" name="perm_new_member_{0}" id="perm_new_member_{0}"></td> \
66 <td><input type="radio" value="repository.read" name="perm_new_member_{0}" id="perm_new_member_{0}"></td> \
66 <td><input type="radio" value="repository.read" name="perm_new_member_{0}" id="perm_new_member_{0}"></td> \
67 <td><input type="radio" value="repository.write" name="perm_new_member_{0}" id="perm_new_member_{0}"></td> \
67 <td><input type="radio" value="repository.write" name="perm_new_member_{0}" id="perm_new_member_{0}"></td> \
68 <td><input type="radio" value="repository.admin" name="perm_new_member_{0}" id="perm_new_member_{0}"></td> \
68 <td><input type="radio" value="repository.admin" name="perm_new_member_{0}" id="perm_new_member_{0}"></td> \
69 <td class="ac"> \
69 <td class="ac"> \
70 <div class="perm_ac" id="perm_ac_{0}"> \
70 <div class="perm_ac" id="perm_ac_{0}"> \
71 <input class="yui-ac-input" id="perm_new_member_name_{0}" name="perm_new_member_name_{0}" value="" type="text"> \
71 <input class="yui-ac-input" id="perm_new_member_name_{0}" name="perm_new_member_name_{0}" value="" type="text"> \
72 <input id="perm_new_member_type_{0}" name="perm_new_member_type_{0}" value="" type="hidden"> \
72 <input id="perm_new_member_type_{0}" name="perm_new_member_type_{0}" value="" type="hidden"> \
73 <div id="perm_container_{0}"></div> \
73 <div id="perm_container_{0}"></div> \
74 </div> \
74 </div> \
75 </td> \
75 </td> \
76 <td></td>'""")
76 <td></td>'""")
77 %>
77 %>
78 ## ADD HERE DYNAMICALLY NEW INPUTS FROM THE '_tmpl'
78 ## ADD HERE DYNAMICALLY NEW INPUTS FROM THE '_tmpl'
79 <tr class="new_members last_new_member" id="add_perm_input"></tr>
79 <tr class="new_members last_new_member" id="add_perm_input"></tr>
80 <tr>
80 <tr>
81 <td colspan="6">
81 <td colspan="6">
82 <span id="add_perm" class="add_icon" style="cursor: pointer;">
82 <span id="add_perm" class="add_icon" style="cursor: pointer;">
83 ${_('Add another member')}
83 ${_('Add another member')}
84 </span>
84 </span>
85 </td>
85 </td>
86 </tr>
86 </tr>
87 </table>
87 </table>
88 <script type="text/javascript">
88 <script type="text/javascript">
89 function ajaxActionRevoke(obj_id, obj_type, field_id) {
89 function ajaxActionRevoke(obj_id, obj_type, field_id, obj_name) {
90 url = "${h.url('delete_repo_perm_member',repo_name=c.repo_name)}";
90 url = "${h.url('delete_repo_perm_member',repo_name=c.repo_name)}";
91 var revoke_msg = _TM['Confirm to revoke permission for {0}: {1} ?'].format(obj_type.replace('_', ' '), obj_name);
92 if (confirm(revoke_msg)){
91 ajaxActionRevokePermission(url, obj_id, obj_type, field_id);
93 ajaxActionRevokePermission(url, obj_id, obj_type, field_id);
94 }
92 };
95 };
93
96
94 YUE.onDOMReady(function () {
97 YUE.onDOMReady(function () {
95 if (!YUD.hasClass('perm_new_member_name', 'error')) {
98 if (!YUD.hasClass('perm_new_member_name', 'error')) {
96 YUD.setStyle('add_perm_input', 'display', 'none');
99 YUD.setStyle('add_perm_input', 'display', 'none');
97 }
100 }
98 YAHOO.util.Event.addListener('add_perm', 'click', function () {
101 YAHOO.util.Event.addListener('add_perm', 'click', function () {
99 addPermAction(${_tmpl}, ${c.users_array|n}, ${c.users_groups_array|n});
102 addPermAction(${_tmpl}, ${c.users_array|n}, ${c.users_groups_array|n});
100 });
103 });
101 });
104 });
102
105
103 </script>
106 </script>
@@ -1,107 +1,110 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 ##forbid revoking permission from yourself
12 ##forbid revoking permission from yourself
13 <tr id="id${id(r2p.user.username)}">
13 <tr id="id${id(r2p.user.username)}">
14 %if c.rhodecode_user.user_id != r2p.user.user_id or c.rhodecode_user.is_admin:
14 %if c.rhodecode_user.user_id != r2p.user.user_id or c.rhodecode_user.is_admin:
15 <td>${h.radio('u_perm_%s' % r2p.user.username,'group.none')}</td>
15 <td>${h.radio('u_perm_%s' % r2p.user.username,'group.none')}</td>
16 <td>${h.radio('u_perm_%s' % r2p.user.username,'group.read')}</td>
16 <td>${h.radio('u_perm_%s' % r2p.user.username,'group.read')}</td>
17 <td>${h.radio('u_perm_%s' % r2p.user.username,'group.write')}</td>
17 <td>${h.radio('u_perm_%s' % r2p.user.username,'group.write')}</td>
18 <td>${h.radio('u_perm_%s' % r2p.user.username,'group.admin')}</td>
18 <td>${h.radio('u_perm_%s' % r2p.user.username,'group.admin')}</td>
19 <td style="white-space: nowrap;">
19 <td style="white-space: nowrap;">
20 <img class="perm-gravatar" src="${h.gravatar_url(r2p.user.email,14)}"/>${r2p.user.username if r2p.user.username != 'default' else _('default')}
20 <img class="perm-gravatar" src="${h.gravatar_url(r2p.user.email,14)}"/>${r2p.user.username if r2p.user.username != 'default' else _('default')}
21 </td>
21 </td>
22 <td>
22 <td>
23 %if r2p.user.username !='default':
23 %if r2p.user.username !='default':
24 <span class="delete_icon action_button" onclick="ajaxActionRevoke(${r2p.user.user_id}, 'user', '${'id%s'%id(r2p.user.username)}')">
24 <span class="delete_icon action_button" onclick="ajaxActionRevoke(${r2p.user.user_id}, 'user', '${'id%s'%id(r2p.user.username)}', '${r2p.user.username}')">
25 ${_('revoke')}
25 ${_('revoke')}
26 </span>
26 </span>
27 %endif
27 %endif
28 </td>
28 </td>
29 %else:
29 %else:
30 <td>${h.radio('u_perm_%s' % r2p.user.username,'group.none', disabled="disabled")}</td>
30 <td>${h.radio('u_perm_%s' % r2p.user.username,'group.none', disabled="disabled")}</td>
31 <td>${h.radio('u_perm_%s' % r2p.user.username,'group.read', disabled="disabled")}</td>
31 <td>${h.radio('u_perm_%s' % r2p.user.username,'group.read', disabled="disabled")}</td>
32 <td>${h.radio('u_perm_%s' % r2p.user.username,'group.write', disabled="disabled")}</td>
32 <td>${h.radio('u_perm_%s' % r2p.user.username,'group.write', disabled="disabled")}</td>
33 <td>${h.radio('u_perm_%s' % r2p.user.username,'group.admin', disabled="disabled")}</td>
33 <td>${h.radio('u_perm_%s' % r2p.user.username,'group.admin', disabled="disabled")}</td>
34 <td style="white-space: nowrap;">
34 <td style="white-space: nowrap;">
35 <img class="perm-gravatar" src="${h.gravatar_url(r2p.user.email,14)}"/>${r2p.user.username if r2p.user.username != 'default' else _('default')}
35 <img class="perm-gravatar" src="${h.gravatar_url(r2p.user.email,14)}"/>${r2p.user.username if r2p.user.username != 'default' else _('default')}
36 </td>
36 </td>
37 <td>
37 <td>
38 </td>
38 </td>
39 %endif
39 %endif
40 </tr>
40 </tr>
41 %endfor
41 %endfor
42
42
43 ## USER GROUPS
43 ## USER GROUPS
44 %for g2p in c.repos_group.users_group_to_perm:
44 %for g2p in c.repos_group.users_group_to_perm:
45 <tr id="id${id(g2p.users_group.users_group_name)}">
45 <tr id="id${id(g2p.users_group.users_group_name)}">
46 <td>${h.radio('g_perm_%s' % g2p.users_group.users_group_name,'group.none')}</td>
46 <td>${h.radio('g_perm_%s' % g2p.users_group.users_group_name,'group.none')}</td>
47 <td>${h.radio('g_perm_%s' % g2p.users_group.users_group_name,'group.read')}</td>
47 <td>${h.radio('g_perm_%s' % g2p.users_group.users_group_name,'group.read')}</td>
48 <td>${h.radio('g_perm_%s' % g2p.users_group.users_group_name,'group.write')}</td>
48 <td>${h.radio('g_perm_%s' % g2p.users_group.users_group_name,'group.write')}</td>
49 <td>${h.radio('g_perm_%s' % g2p.users_group.users_group_name,'group.admin')}</td>
49 <td>${h.radio('g_perm_%s' % g2p.users_group.users_group_name,'group.admin')}</td>
50 <td style="white-space: nowrap;">
50 <td style="white-space: nowrap;">
51 <img class="perm-gravatar" src="${h.url('/images/icons/group.png')}"/>${g2p.users_group.users_group_name}
51 <img class="perm-gravatar" src="${h.url('/images/icons/group.png')}"/>${g2p.users_group.users_group_name}
52 </td>
52 </td>
53 <td>
53 <td>
54 <span class="delete_icon action_button" onclick="ajaxActionRevoke(${g2p.users_group.users_group_id}, 'user_group', '${'id%s'%id(g2p.users_group.users_group_name)}')">
54 <span class="delete_icon action_button" onclick="ajaxActionRevoke(${g2p.users_group.users_group_id}, 'user_group', '${'id%s'%id(g2p.users_group.users_group_name)}', '${g2p.users_group.users_group_name}')">
55 ${_('revoke')}
55 ${_('revoke')}
56 </span>
56 </span>
57 </td>
57 </td>
58 </tr>
58 </tr>
59 %endfor
59 %endfor
60
60
61 <%
61 <%
62 _tmpl = h.literal("""' \
62 _tmpl = h.literal("""' \
63 <td><input type="radio" value="group.none" name="perm_new_member_{0}" id="perm_new_member_{0}"></td> \
63 <td><input type="radio" value="group.none" name="perm_new_member_{0}" id="perm_new_member_{0}"></td> \
64 <td><input type="radio" value="group.read" name="perm_new_member_{0}" id="perm_new_member_{0}"></td> \
64 <td><input type="radio" value="group.read" name="perm_new_member_{0}" id="perm_new_member_{0}"></td> \
65 <td><input type="radio" value="group.write" name="perm_new_member_{0}" id="perm_new_member_{0}"></td> \
65 <td><input type="radio" value="group.write" name="perm_new_member_{0}" id="perm_new_member_{0}"></td> \
66 <td><input type="radio" value="group.admin" name="perm_new_member_{0}" id="perm_new_member_{0}"></td> \
66 <td><input type="radio" value="group.admin" name="perm_new_member_{0}" id="perm_new_member_{0}"></td> \
67 <td class="ac"> \
67 <td class="ac"> \
68 <div class="perm_ac" id="perm_ac_{0}"> \
68 <div class="perm_ac" id="perm_ac_{0}"> \
69 <input class="yui-ac-input" id="perm_new_member_name_{0}" name="perm_new_member_name_{0}" value="" type="text"> \
69 <input class="yui-ac-input" id="perm_new_member_name_{0}" name="perm_new_member_name_{0}" value="" type="text"> \
70 <input id="perm_new_member_type_{0}" name="perm_new_member_type_{0}" value="" type="hidden"> \
70 <input id="perm_new_member_type_{0}" name="perm_new_member_type_{0}" value="" type="hidden"> \
71 <div id="perm_container_{0}"></div> \
71 <div id="perm_container_{0}"></div> \
72 </div> \
72 </div> \
73 </td> \
73 </td> \
74 <td></td>'""")
74 <td></td>'""")
75 %>
75 %>
76 ## ADD HERE DYNAMICALLY NEW INPUTS FROM THE '_tmpl'
76 ## ADD HERE DYNAMICALLY NEW INPUTS FROM THE '_tmpl'
77 <tr class="new_members last_new_member" id="add_perm_input"></tr>
77 <tr class="new_members last_new_member" id="add_perm_input"></tr>
78 <tr>
78 <tr>
79 <td colspan="6">
79 <td colspan="6">
80 <span id="add_perm" class="add_icon" style="cursor: pointer;">
80 <span id="add_perm" class="add_icon" style="cursor: pointer;">
81 ${_('Add another member')}
81 ${_('Add another member')}
82 </span>
82 </span>
83 </td>
83 </td>
84 </tr>
84 </tr>
85 <tr>
85 <tr>
86 <td colspan="6">
86 <td colspan="6">
87 ${h.checkbox('recursive',value="True", label=_('apply to children'))}
87 ${h.checkbox('recursive',value="True", label=_('apply to children'))}
88 <span class="help-block">${_('Set or revoke permission to all children of that group, including non-private repositories and other groups')}</span>
88 <span class="help-block">${_('Set or revoke permission to all children of that group, including non-private repositories and other groups')}</span>
89 </td>
89 </td>
90 </tr>
90 </tr>
91 </table>
91 </table>
92 <script type="text/javascript">
92 <script type="text/javascript">
93 function ajaxActionRevoke(obj_id, obj_type, field_id) {
93 function ajaxActionRevoke(obj_id, obj_type, field_id, obj_name) {
94 url = "${h.url('delete_repo_group_perm_member', group_name=c.repos_group.group_name)}";
94 url = "${h.url('delete_repo_group_perm_member', group_name=c.repos_group.group_name)}";
95 var revoke_msg = _TM['Confirm to revoke permission for {0}: {1} ?'].format(obj_type.replace('_', ' '), obj_name);
96 if (confirm(revoke_msg)){
95 ajaxActionRevokePermission(url, obj_id, obj_type, field_id, {recursive:YUD.get('recursive').checked});
97 ajaxActionRevokePermission(url, obj_id, obj_type, field_id, {recursive:YUD.get('recursive').checked});
98 }
96 };
99 };
97
100
98 YUE.onDOMReady(function () {
101 YUE.onDOMReady(function () {
99 if (!YUD.hasClass('perm_new_member_name', 'error')) {
102 if (!YUD.hasClass('perm_new_member_name', 'error')) {
100 YUD.setStyle('add_perm_input', 'display', 'none');
103 YUD.setStyle('add_perm_input', 'display', 'none');
101 }
104 }
102 YAHOO.util.Event.addListener('add_perm', 'click', function () {
105 YAHOO.util.Event.addListener('add_perm', 'click', function () {
103 addPermAction(${_tmpl}, ${c.users_array|n}, ${c.users_groups_array|n});
106 addPermAction(${_tmpl}, ${c.users_array|n}, ${c.users_groups_array|n});
104 });
107 });
105 });
108 });
106
109
107 </script>
110 </script>
@@ -1,101 +1,104 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.users_group.user_user_group_to_perm:
11 %for r2p in c.users_group.user_user_group_to_perm:
12 ##forbid revoking permission from yourself
12 ##forbid revoking permission from yourself
13 <tr id="id${id(r2p.user.username)}">
13 <tr id="id${id(r2p.user.username)}">
14 %if c.rhodecode_user.user_id != r2p.user.user_id or c.rhodecode_user.is_admin:
14 %if c.rhodecode_user.user_id != r2p.user.user_id or c.rhodecode_user.is_admin:
15 <td>${h.radio('u_perm_%s' % r2p.user.username,'usergroup.none')}</td>
15 <td>${h.radio('u_perm_%s' % r2p.user.username,'usergroup.none')}</td>
16 <td>${h.radio('u_perm_%s' % r2p.user.username,'usergroup.read')}</td>
16 <td>${h.radio('u_perm_%s' % r2p.user.username,'usergroup.read')}</td>
17 <td>${h.radio('u_perm_%s' % r2p.user.username,'usergroup.write')}</td>
17 <td>${h.radio('u_perm_%s' % r2p.user.username,'usergroup.write')}</td>
18 <td>${h.radio('u_perm_%s' % r2p.user.username,'usergroup.admin')}</td>
18 <td>${h.radio('u_perm_%s' % r2p.user.username,'usergroup.admin')}</td>
19 <td style="white-space: nowrap;">
19 <td style="white-space: nowrap;">
20 <img class="perm-gravatar" src="${h.gravatar_url(r2p.user.email,14)}"/>${r2p.user.username if r2p.user.username != 'default' else _('default')}
20 <img class="perm-gravatar" src="${h.gravatar_url(r2p.user.email,14)}"/>${r2p.user.username if r2p.user.username != 'default' else _('default')}
21 </td>
21 </td>
22 <td>
22 <td>
23 %if r2p.user.username !='default':
23 %if r2p.user.username !='default':
24 <span class="delete_icon action_button" onclick="ajaxActionRevoke(${r2p.user.user_id}, 'user', '${'id%s'%id(r2p.user.username)}')">
24 <span class="delete_icon action_button" onclick="ajaxActionRevoke(${r2p.user.user_id}, 'user', '${'id%s'%id(r2p.user.username)}', '${r2p.user.username}')">
25 ${_('revoke')}
25 ${_('revoke')}
26 </span>
26 </span>
27 %endif
27 %endif
28 </td>
28 </td>
29 %else:
29 %else:
30 <td>${h.radio('u_perm_%s' % r2p.user.username,'usergroup.none', disabled="disabled")}</td>
30 <td>${h.radio('u_perm_%s' % r2p.user.username,'usergroup.none', disabled="disabled")}</td>
31 <td>${h.radio('u_perm_%s' % r2p.user.username,'usergroup.read', disabled="disabled")}</td>
31 <td>${h.radio('u_perm_%s' % r2p.user.username,'usergroup.read', disabled="disabled")}</td>
32 <td>${h.radio('u_perm_%s' % r2p.user.username,'usergroup.write', disabled="disabled")}</td>
32 <td>${h.radio('u_perm_%s' % r2p.user.username,'usergroup.write', disabled="disabled")}</td>
33 <td>${h.radio('u_perm_%s' % r2p.user.username,'usergroup.admin', disabled="disabled")}</td>
33 <td>${h.radio('u_perm_%s' % r2p.user.username,'usergroup.admin', disabled="disabled")}</td>
34 <td style="white-space: nowrap;">
34 <td style="white-space: nowrap;">
35 <img class="perm-gravatar" src="${h.gravatar_url(r2p.user.email,14)}"/>${r2p.user.username if r2p.user.username != 'default' else _('default')}
35 <img class="perm-gravatar" src="${h.gravatar_url(r2p.user.email,14)}"/>${r2p.user.username if r2p.user.username != 'default' else _('default')}
36 </td>
36 </td>
37 <td>
37 <td>
38 </td>
38 </td>
39 %endif
39 %endif
40 </tr>
40 </tr>
41 %endfor
41 %endfor
42
42
43 ## USER GROUPS
43 ## USER GROUPS
44 %for g2p in c.users_group.user_group_user_group_to_perm:
44 %for g2p in c.users_group.user_group_user_group_to_perm:
45 <tr id="id${id(g2p.user_group.users_group_name)}">
45 <tr id="id${id(g2p.user_group.users_group_name)}">
46 <td>${h.radio('g_perm_%s' % g2p.user_group.users_group_name,'usergroup.none')}</td>
46 <td>${h.radio('g_perm_%s' % g2p.user_group.users_group_name,'usergroup.none')}</td>
47 <td>${h.radio('g_perm_%s' % g2p.user_group.users_group_name,'usergroup.read')}</td>
47 <td>${h.radio('g_perm_%s' % g2p.user_group.users_group_name,'usergroup.read')}</td>
48 <td>${h.radio('g_perm_%s' % g2p.user_group.users_group_name,'usergroup.write')}</td>
48 <td>${h.radio('g_perm_%s' % g2p.user_group.users_group_name,'usergroup.write')}</td>
49 <td>${h.radio('g_perm_%s' % g2p.user_group.users_group_name,'usergroup.admin')}</td>
49 <td>${h.radio('g_perm_%s' % g2p.user_group.users_group_name,'usergroup.admin')}</td>
50 <td style="white-space: nowrap;">
50 <td style="white-space: nowrap;">
51 <img class="perm-gravatar" src="${h.url('/images/icons/group.png')}"/>${g2p.user_group.users_group_name}
51 <img class="perm-gravatar" src="${h.url('/images/icons/group.png')}"/>${g2p.user_group.users_group_name}
52 </td>
52 </td>
53 <td>
53 <td>
54 <span class="delete_icon action_button" onclick="ajaxActionRevoke(${g2p.user_group.users_group_id}, 'user_group', '${'id%s'%id(g2p.user_group.users_group_name)}')">
54 <span class="delete_icon action_button" onclick="ajaxActionRevoke(${g2p.user_group.users_group_id}, 'user_group', '${'id%s'%id(g2p.user_group.users_group_name)}', '${g2p.user_group.users_group_name}')">
55 ${_('revoke')}
55 ${_('revoke')}
56 </span>
56 </span>
57 </td>
57 </td>
58 </tr>
58 </tr>
59 %endfor
59 %endfor
60
60
61 <%
61 <%
62 _tmpl = h.literal("""' \
62 _tmpl = h.literal("""' \
63 <td><input type="radio" value="usergroup.none" name="perm_new_member_{0}" id="perm_new_member_{0}"></td> \
63 <td><input type="radio" value="usergroup.none" name="perm_new_member_{0}" id="perm_new_member_{0}"></td> \
64 <td><input type="radio" value="usergroup.read" name="perm_new_member_{0}" id="perm_new_member_{0}"></td> \
64 <td><input type="radio" value="usergroup.read" name="perm_new_member_{0}" id="perm_new_member_{0}"></td> \
65 <td><input type="radio" value="usergroup.write" name="perm_new_member_{0}" id="perm_new_member_{0}"></td> \
65 <td><input type="radio" value="usergroup.write" name="perm_new_member_{0}" id="perm_new_member_{0}"></td> \
66 <td><input type="radio" value="usergroup.admin" name="perm_new_member_{0}" id="perm_new_member_{0}"></td> \
66 <td><input type="radio" value="usergroup.admin" name="perm_new_member_{0}" id="perm_new_member_{0}"></td> \
67 <td class="ac"> \
67 <td class="ac"> \
68 <div class="perm_ac" id="perm_ac_{0}"> \
68 <div class="perm_ac" id="perm_ac_{0}"> \
69 <input class="yui-ac-input" id="perm_new_member_name_{0}" name="perm_new_member_name_{0}" value="" type="text"> \
69 <input class="yui-ac-input" id="perm_new_member_name_{0}" name="perm_new_member_name_{0}" value="" type="text"> \
70 <input id="perm_new_member_type_{0}" name="perm_new_member_type_{0}" value="" type="hidden"> \
70 <input id="perm_new_member_type_{0}" name="perm_new_member_type_{0}" value="" type="hidden"> \
71 <div id="perm_container_{0}"></div> \
71 <div id="perm_container_{0}"></div> \
72 </div> \
72 </div> \
73 </td> \
73 </td> \
74 <td></td>'""")
74 <td></td>'""")
75 %>
75 %>
76 ## ADD HERE DYNAMICALLY NEW INPUTS FROM THE '_tmpl'
76 ## ADD HERE DYNAMICALLY NEW INPUTS FROM THE '_tmpl'
77 <tr class="new_members last_new_member" id="add_perm_input"></tr>
77 <tr class="new_members last_new_member" id="add_perm_input"></tr>
78 <tr>
78 <tr>
79 <td colspan="6">
79 <td colspan="6">
80 <span id="add_perm" class="add_icon" style="cursor: pointer;">
80 <span id="add_perm" class="add_icon" style="cursor: pointer;">
81 ${_('Add another member')}
81 ${_('Add another member')}
82 </span>
82 </span>
83 </td>
83 </td>
84 </tr>
84 </tr>
85 </table>
85 </table>
86 <script type="text/javascript">
86 <script type="text/javascript">
87 function ajaxActionRevoke(obj_id, obj_type, field_id) {
87 function ajaxActionRevoke(obj_id, obj_type, field_id, obj_name) {
88 url = "${h.url('delete_user_group_perm_member', id=c.users_group.users_group_id)}";
88 url = "${h.url('delete_user_group_perm_member', id=c.users_group.users_group_id)}";
89 var revoke_msg = _TM['Confirm to revoke permission for {0}: {1} ?'].format(obj_type.replace('_', ' '), obj_name);
90 if (confirm(revoke_msg)){
89 ajaxActionRevokePermission(url, obj_id, obj_type, field_id);
91 ajaxActionRevokePermission(url, obj_id, obj_type, field_id);
92 }
90 };
93 };
91
94
92 YUE.onDOMReady(function () {
95 YUE.onDOMReady(function () {
93 if (!YUD.hasClass('perm_new_member_name', 'error')) {
96 if (!YUD.hasClass('perm_new_member_name', 'error')) {
94 YUD.setStyle('add_perm_input', 'display', 'none');
97 YUD.setStyle('add_perm_input', 'display', 'none');
95 }
98 }
96 YAHOO.util.Event.addListener('add_perm', 'click', function () {
99 YAHOO.util.Event.addListener('add_perm', 'click', function () {
97 addPermAction(${_tmpl}, ${c.users_array|n}, ${c.users_groups_array|n});
100 addPermAction(${_tmpl}, ${c.users_array|n}, ${c.users_groups_array|n});
98 });
101 });
99 });
102 });
100
103
101 </script>
104 </script>
@@ -1,123 +1,124 b''
1 ## -*- coding: utf-8 -*-
1 ## -*- coding: utf-8 -*-
2 <!DOCTYPE html>
2 <!DOCTYPE html>
3
3
4 <html xmlns="http://www.w3.org/1999/xhtml">
4 <html xmlns="http://www.w3.org/1999/xhtml">
5 <head>
5 <head>
6 <title>${self.title()}</title>
6 <title>${self.title()}</title>
7 <meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
7 <meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
8 <meta name="robots" content="index, nofollow"/>
8 <meta name="robots" content="index, nofollow"/>
9 <link rel="icon" href="${h.url('/images/favicon.ico')}" type="image/png" />
9 <link rel="icon" href="${h.url('/images/favicon.ico')}" type="image/png" />
10
10
11 ## CSS ###
11 ## CSS ###
12 <%def name="css()">
12 <%def name="css()">
13 <link rel="stylesheet" type="text/css" href="${h.url('/css/style.css', ver=c.rhodecode_version)}" media="screen"/>
13 <link rel="stylesheet" type="text/css" href="${h.url('/css/style.css', ver=c.rhodecode_version)}" media="screen"/>
14 <link rel="stylesheet" type="text/css" href="${h.url('/css/pygments.css', ver=c.rhodecode_version)}"/>
14 <link rel="stylesheet" type="text/css" href="${h.url('/css/pygments.css', ver=c.rhodecode_version)}"/>
15 <link rel="stylesheet" type="text/css" href="${h.url('/css/contextbar.css', ver=c.rhodecode_version)}"/>
15 <link rel="stylesheet" type="text/css" href="${h.url('/css/contextbar.css', ver=c.rhodecode_version)}"/>
16 ## EXTRA FOR CSS
16 ## EXTRA FOR CSS
17 ${self.css_extra()}
17 ${self.css_extra()}
18 </%def>
18 </%def>
19
19
20 <%def name="css_extra()"></%def>
20 <%def name="css_extra()"></%def>
21
21
22 ${self.css()}
22 ${self.css()}
23
23
24 %if c.ga_code:
24 %if c.ga_code:
25 <!-- Analytics -->
25 <!-- Analytics -->
26 <script type="text/javascript">
26 <script type="text/javascript">
27 var _gaq = _gaq || [];
27 var _gaq = _gaq || [];
28 _gaq.push(['_setAccount', '${c.ga_code}']);
28 _gaq.push(['_setAccount', '${c.ga_code}']);
29 _gaq.push(['_trackPageview']);
29 _gaq.push(['_trackPageview']);
30
30
31 (function() {
31 (function() {
32 var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
32 var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
33 ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
33 ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
34 var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
34 var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
35 })();
35 })();
36 </script>
36 </script>
37 %endif
37 %endif
38
38
39 ## JAVASCRIPT ##
39 ## JAVASCRIPT ##
40 <%def name="js()">
40 <%def name="js()">
41 <script type="text/javascript">
41 <script type="text/javascript">
42 //JS translations map
42 //JS translations map
43 var TRANSLATION_MAP = {
43 var TRANSLATION_MAP = {
44 'Add another comment':'${_("Add another comment")}',
44 'Add another comment':'${_("Add another comment")}',
45 'Stop following this repository':"${_('Stop following this repository')}",
45 'Stop following this repository':"${_('Stop following this repository')}",
46 'Start following this repository':"${_('Start following this repository')}",
46 'Start following this repository':"${_('Start following this repository')}",
47 'Group':"${_('Group')}",
47 'Group':"${_('Group')}",
48 'members':"${_('members')}",
48 'members':"${_('members')}",
49 'Loading ...':"${_('Loading ...')}",
49 'Loading ...':"${_('Loading ...')}",
50 'loading ...':"${_('loading ...')}",
50 'loading ...':"${_('loading ...')}",
51 'Search truncated': "${_('Search truncated')}",
51 'Search truncated': "${_('Search truncated')}",
52 'No matching files': "${_('No matching files')}",
52 'No matching files': "${_('No matching files')}",
53 'Open new pull request': "${_('Open new pull request')}",
53 'Open new pull request': "${_('Open new pull request')}",
54 'Open new pull request for selected changesets': "${_('Open new pull request for selected changesets')}",
54 'Open new pull request for selected changesets': "${_('Open new pull request for selected changesets')}",
55 'Show selected changesets __S -> __E': "${_('Show selected changesets __S -> __E')}",
55 'Show selected changesets __S -> __E': "${_('Show selected changesets __S -> __E')}",
56 'Show selected changeset __S': "${_('Show selected changeset __S')}",
56 'Show selected changeset __S': "${_('Show selected changeset __S')}",
57 'Selection link': "${_('Selection link')}",
57 'Selection link': "${_('Selection link')}",
58 'Collapse diff': "${_('Collapse diff')}",
58 'Collapse diff': "${_('Collapse diff')}",
59 'Expand diff': "${_('Expand diff')}",
59 'Expand diff': "${_('Expand diff')}",
60 'Failed to revoke permission': "${_('Failed to revoke permission')}"
60 'Failed to revoke permission': "${_('Failed to revoke permission')}",
61 'Confirm to revoke permission for {0}: {1} ?': "${_('confirm to revoke permission for {0}: {1} ?')}",
61 };
62 };
62 var _TM = TRANSLATION_MAP;
63 var _TM = TRANSLATION_MAP;
63
64
64 var TOGGLE_FOLLOW_URL = "${h.url('toggle_following')}";
65 var TOGGLE_FOLLOW_URL = "${h.url('toggle_following')}";
65
66
66 var REPO_NAME = "";
67 var REPO_NAME = "";
67 %if hasattr(c, 'repo_name'):
68 %if hasattr(c, 'repo_name'):
68 var REPO_NAME = "${c.repo_name}";
69 var REPO_NAME = "${c.repo_name}";
69 %endif
70 %endif
70 </script>
71 </script>
71 <script type="text/javascript" src="${h.url('/js/yui.2.9.js', ver=c.rhodecode_version)}"></script>
72 <script type="text/javascript" src="${h.url('/js/yui.2.9.js', ver=c.rhodecode_version)}"></script>
72 <!--[if lt IE 9]>
73 <!--[if lt IE 9]>
73 <script language="javascript" type="text/javascript" src="${h.url('/js/excanvas.min.js')}"></script>
74 <script language="javascript" type="text/javascript" src="${h.url('/js/excanvas.min.js')}"></script>
74 <![endif]-->
75 <![endif]-->
75 <script type="text/javascript" src="${h.url('/js/yui.flot.js', ver=c.rhodecode_version)}"></script>
76 <script type="text/javascript" src="${h.url('/js/yui.flot.js', ver=c.rhodecode_version)}"></script>
76 <script type="text/javascript" src="${h.url('/js/native.history.js', ver=c.rhodecode_version)}"></script>
77 <script type="text/javascript" src="${h.url('/js/native.history.js', ver=c.rhodecode_version)}"></script>
77 <script type="text/javascript" src="${h.url('/js/pyroutes_map.js', ver=c.rhodecode_version)}"></script>
78 <script type="text/javascript" src="${h.url('/js/pyroutes_map.js', ver=c.rhodecode_version)}"></script>
78 <script type="text/javascript" src="${h.url('/js/rhodecode.js', ver=c.rhodecode_version)}"></script>
79 <script type="text/javascript" src="${h.url('/js/rhodecode.js', ver=c.rhodecode_version)}"></script>
79 ## EXTRA FOR JS
80 ## EXTRA FOR JS
80 ${self.js_extra()}
81 ${self.js_extra()}
81 <script type="text/javascript">
82 <script type="text/javascript">
82 (function(window,undefined){
83 (function(window,undefined){
83 // Prepare
84 // Prepare
84 var History = window.History; // Note: We are using a capital H instead of a lower h
85 var History = window.History; // Note: We are using a capital H instead of a lower h
85 if ( !History.enabled ) {
86 if ( !History.enabled ) {
86 // History.js is disabled for this browser.
87 // History.js is disabled for this browser.
87 // This is because we can optionally choose to support HTML4 browsers or not.
88 // This is because we can optionally choose to support HTML4 browsers or not.
88 return false;
89 return false;
89 }
90 }
90 })(window);
91 })(window);
91
92
92 YUE.onDOMReady(function(){
93 YUE.onDOMReady(function(){
93 tooltip_activate();
94 tooltip_activate();
94 show_more_event();
95 show_more_event();
95 show_changeset_tooltip();
96 show_changeset_tooltip();
96 // routes registration
97 // routes registration
97 pyroutes.register('toggle_following', "${h.url('toggle_following')}");
98 pyroutes.register('toggle_following', "${h.url('toggle_following')}");
98 pyroutes.register('changeset_info', "${h.url('changeset_info', repo_name='%(repo_name)s', revision='%(revision)s')}", ['repo_name', 'revision']);
99 pyroutes.register('changeset_info', "${h.url('changeset_info', repo_name='%(repo_name)s', revision='%(revision)s')}", ['repo_name', 'revision']);
99 pyroutes.register('repo_size', "${h.url('repo_size', repo_name='%(repo_name)s')}", ['repo_name']);
100 pyroutes.register('repo_size', "${h.url('repo_size', repo_name='%(repo_name)s')}", ['repo_name']);
100 pyroutes.register('changeset_comment_preview', "${h.url('changeset_comment_preview', repo_name='%(repo_name)s')}", ['repo_name']);
101 pyroutes.register('changeset_comment_preview', "${h.url('changeset_comment_preview', repo_name='%(repo_name)s')}", ['repo_name']);
101 })
102 })
102 </script>
103 </script>
103 </%def>
104 </%def>
104 <%def name="js_extra()"></%def>
105 <%def name="js_extra()"></%def>
105 ${self.js()}
106 ${self.js()}
106 <%def name="head_extra()"></%def>
107 <%def name="head_extra()"></%def>
107 ${self.head_extra()}
108 ${self.head_extra()}
108 </head>
109 </head>
109 <body id="body">
110 <body id="body">
110 ## IE hacks
111 ## IE hacks
111 <!--[if IE 7]>
112 <!--[if IE 7]>
112 <script>YUD.addClass(document.body,'ie7')</script>
113 <script>YUD.addClass(document.body,'ie7')</script>
113 <![endif]-->
114 <![endif]-->
114 <!--[if IE 8]>
115 <!--[if IE 8]>
115 <script>YUD.addClass(document.body,'ie8')</script>
116 <script>YUD.addClass(document.body,'ie8')</script>
116 <![endif]-->
117 <![endif]-->
117 <!--[if IE 9]>
118 <!--[if IE 9]>
118 <script>YUD.addClass(document.body,'ie9')</script>
119 <script>YUD.addClass(document.body,'ie9')</script>
119 <![endif]-->
120 <![endif]-->
120
121
121 ${next.body()}
122 ${next.body()}
122 </body>
123 </body>
123 </html>
124 </html>
General Comments 0
You need to be logged in to leave comments. Login now