##// END OF EJS Templates
ui: make super admin named consistently across ui.
Bartlomiej Wolynczyk -
r4134:cc0663d2 default
parent child Browse files
Show More
@@ -1,220 +1,220 b''
1 1 <%namespace name="base" file="/base/base.mako"/>
2 2
3 3 <div class="panel panel-default">
4 4 <div class="panel-heading">
5 5 <h3 class="panel-title">${_('Repository Group Permissions: {}').format(c.repo_group.name)}</h3>
6 6 </div>
7 7 <div class="panel-body">
8 8 ${h.secure_form(h.route_path('edit_repo_group_perms_update', repo_group_name=c.repo_group.group_name), request=request)}
9 9 <table id="permissions_manage" class="rctable permissions">
10 10 <tr>
11 11 <th class="td-radio">${_('None')}</th>
12 12 <th class="td-radio">${_('Read')}</th>
13 13 <th class="td-radio">${_('Write')}</th>
14 14 <th class="td-radio">${_('Admin')}</th>
15 15 <th class="td-owner">${_('User/User Group')}</th>
16 16 <th class="td-action"></th>
17 17 <th class="td-action"></th>
18 18 </tr>
19 19 ## USERS
20 20 %for _user in c.repo_group.permissions():
21 21 ## super admin/owner row
22 22 %if getattr(_user, 'admin_row', None) or getattr(_user, 'owner_row', None):
23 23 <tr class="perm_admin_row">
24 24 <td class="td-radio">${h.radio('admin_perm_%s' % _user.user_id,'repository.none', disabled="disabled")}</td>
25 25 <td class="td-radio">${h.radio('admin_perm_%s' % _user.user_id,'repository.read', disabled="disabled")}</td>
26 26 <td class="td-radio">${h.radio('admin_perm_%s' % _user.user_id,'repository.write', disabled="disabled")}</td>
27 27 <td class="td-radio">${h.radio('admin_perm_%s' % _user.user_id,'repository.admin', 'repository.admin', disabled="disabled")}</td>
28 28 <td class="td-user">
29 29 ${base.gravatar(_user.email, 16, user=_user, tooltip=True)}
30 30 ${h.link_to_user(_user.username)}
31 31 %if getattr(_user, 'admin_row', None):
32 (${_('super admin')})
32 (${_('super-admin')})
33 33 %endif
34 34 %if getattr(_user, 'owner_row', None):
35 35 (${_('owner')})
36 36 %endif
37 37 </td>
38 38 <td></td>
39 39 <td class="quick_repo_menu">
40 40 % if c.rhodecode_user.is_admin:
41 41 <i class="icon-more"></i>
42 42 <div class="menu_items_container" style="display: none;">
43 43 <ul class="menu_items">
44 44 <li>
45 45 ${h.link_to('show permissions', h.route_path('edit_user_perms_summary', user_id=_user.user_id, _anchor='repositories-groups-permissions'))}
46 46 </li>
47 47 </ul>
48 48 </div>
49 49 % endif
50 50 </td>
51 51 </tr>
52 52 %else:
53 53 <tr>
54 54 ##forbid revoking permission from yourself, except if you're an super admin
55 55 %if c.rhodecode_user.user_id != _user.user_id or c.rhodecode_user.is_admin:
56 56 <td class="td-radio">${h.radio('u_perm_%s' % _user.user_id,'group.none', checked=_user.permission=='group.none')}</td>
57 57 <td class="td-radio">${h.radio('u_perm_%s' % _user.user_id,'group.read', checked=_user.permission=='group.read')}</td>
58 58 <td class="td-radio">${h.radio('u_perm_%s' % _user.user_id,'group.write', checked=_user.permission=='group.write')}</td>
59 59 <td class="td-radio">${h.radio('u_perm_%s' % _user.user_id,'group.admin', checked=_user.permission=='group.admin')}</td>
60 60 <td class="td-user">
61 61 ${base.gravatar(_user.email, 16, user=_user, tooltip=True)}
62 62 <span class="user">
63 63 % if _user.username == h.DEFAULT_USER:
64 64 ${h.DEFAULT_USER} <span class="user-perm-help-text"> - ${_('permission for all other users')}</span>
65 65 % else:
66 66 ${h.link_to_user(_user.username)}
67 67 %if getattr(_user, 'duplicate_perm', None):
68 68 (${_('inactive duplicate')})
69 69 %endif
70 70 % endif
71 71 </span>
72 72 </td>
73 73 <td class="td-action">
74 74 %if _user.username != h.DEFAULT_USER:
75 75 <span class="btn btn-link btn-danger revoke_perm"
76 76 member="${_user.user_id}" member_type="user">
77 77 ${_('Remove')}
78 78 </span>
79 79 %endif
80 80 </td>
81 81 <td class="quick_repo_menu">
82 82 % if c.rhodecode_user.is_admin:
83 83 <i class="icon-more"></i>
84 84 <div class="menu_items_container" style="display: none;">
85 85 <ul class="menu_items">
86 86 <li>
87 87 % if _user.username == h.DEFAULT_USER:
88 88 ${h.link_to('show permissions', h.route_path('admin_permissions_overview', _anchor='repositories-groups-permissions'))}
89 89 % else:
90 90 ${h.link_to('show permissions', h.route_path('edit_user_perms_summary', user_id=_user.user_id, _anchor='repositories-groups-permissions'))}
91 91 % endif
92 92 </li>
93 93 </ul>
94 94 </div>
95 95 % endif
96 96 </td>
97 97 %else:
98 98 ## special case for currently logged-in user permissions, we make sure he cannot take his own permissions
99 99 <td class="td-radio">${h.radio('u_perm_%s' % _user.user_id,'group.none', disabled="disabled")}</td>
100 100 <td class="td-radio">${h.radio('u_perm_%s' % _user.user_id,'group.read', disabled="disabled")}</td>
101 101 <td class="td-radio">${h.radio('u_perm_%s' % _user.user_id,'group.write', disabled="disabled")}</td>
102 102 <td class="td-radio">${h.radio('u_perm_%s' % _user.user_id,'group.admin', disabled="disabled")}</td>
103 103 <td class="td-user">
104 104 ${base.gravatar(_user.email, 16, user=_user, tooltip=True)}
105 105 <span class="user">
106 106 % if _user.username == h.DEFAULT_USER:
107 107 ${h.DEFAULT_USER} <span class="user-perm-help-text"> - ${_('permission for all other users')}</span>
108 108 % else:
109 109 ${h.link_to_user(_user.username)}
110 110 %if getattr(_user, 'duplicate_perm', None):
111 111 (${_('inactive duplicate')})
112 112 %endif
113 113 % endif
114 114 <span class="user-perm-help-text">(${_('delegated admin')})</span>
115 115 </span>
116 116 </td>
117 117 <td></td>
118 118 <td class="quick_repo_menu">
119 119 % if c.rhodecode_user.is_admin:
120 120 <i class="icon-more"></i>
121 121 <div class="menu_items_container" style="display: none;">
122 122 <ul class="menu_items">
123 123 <li>
124 124 ${h.link_to('show permissions', h.route_path('edit_user_perms_summary', user_id=_user.user_id, _anchor='repositories-groups-permissions'))}
125 125 </li>
126 126 </ul>
127 127 </div>
128 128 % endif
129 129 </td>
130 130 %endif
131 131 </tr>
132 132 %endif
133 133 %endfor
134 134
135 135 ## USER GROUPS
136 136 %for _user_group in c.repo_group.permission_user_groups(with_members=True):
137 137 <tr id="id${id(_user_group.users_group_name)}">
138 138 <td class="td-radio">${h.radio('g_perm_%s' % _user_group.users_group_id,'group.none', checked=_user_group.permission=='group.none')}</td>
139 139 <td class="td-radio">${h.radio('g_perm_%s' % _user_group.users_group_id,'group.read', checked=_user_group.permission=='group.read')}</td>
140 140 <td class="td-radio">${h.radio('g_perm_%s' % _user_group.users_group_id,'group.write', checked=_user_group.permission=='group.write')}</td>
141 141 <td class="td-radio">${h.radio('g_perm_%s' % _user_group.users_group_id,'group.admin', checked=_user_group.permission=='group.admin')}</td>
142 142 <td class="td-componentname">
143 143 ${base.user_group_icon(_user_group, tooltip=True)}
144 144
145 145 %if c.is_super_admin:
146 146 <a href="${h.route_path('edit_user_group',user_group_id=_user_group.users_group_id)}">
147 147 ${_user_group.users_group_name}
148 148 </a>
149 149 %else:
150 150 ${h.link_to_group(_user_group.users_group_name)}
151 151 %endif
152 152 (${_('members')}: ${len(_user_group.members)})
153 153 </td>
154 154 <td class="td-action">
155 155 <span class="btn btn-link btn-danger revoke_perm"
156 156 member="${_user_group.users_group_id}" member_type="user_group">
157 157 ${_('Remove')}
158 158 </span>
159 159 </td>
160 160 <td class="quick_repo_menu">
161 161 % if c.rhodecode_user.is_admin:
162 162 <i class="icon-more"></i>
163 163 <div class="menu_items_container" style="display: none;">
164 164 <ul class="menu_items">
165 165 <li>
166 166 ${h.link_to('show permissions', h.route_path('edit_user_group_perms_summary', user_group_id=_user_group.users_group_id, _anchor='repositories-groups-permissions'))}
167 167 </li>
168 168 </ul>
169 169 </div>
170 170 % endif
171 171 </td>
172 172 </tr>
173 173 %endfor
174 174
175 175 <tr class="new_members" id="add_perm_input"></tr>
176 176 <tr>
177 177 <td></td>
178 178 <td></td>
179 179 <td></td>
180 180 <td></td>
181 181 <td></td>
182 182 <td>
183 183 <span id="add_perm" class="link">
184 184 ${_('Add user/user group')}
185 185 </span>
186 186 </td>
187 187 <td></td>
188 188 </tr>
189 189 </table>
190 190
191 191 <div class="fields">
192 192 <div class="field">
193 193 <div class="label label-radio">
194 194 ${_('Apply to children')}:
195 195 </div>
196 196 <div class="radios">
197 197 ${h.radio('recursive', 'none', label=_('None'), checked="checked")}
198 198 ${h.radio('recursive', 'groups', label=_('Repository Groups'))}
199 199 ${h.radio('recursive', 'repos', label=_('Repositories'))}
200 200 ${h.radio('recursive', 'all', label=_('Both'))}
201 201 <span class="help-block">${_('Set or revoke permissions to selected types of children of this group, including non-private repositories and other groups if chosen.')}</span>
202 202 </div>
203 203 </div>
204 204 </div>
205 205 <div class="buttons">
206 206 ${h.submit('save',_('Save'),class_="btn btn-primary")}
207 207 ${h.reset('reset',_('Reset'),class_="btn btn-danger")}
208 208 </div>
209 209 ${h.end_form()}
210 210 </div>
211 211 </div>
212 212 <script type="text/javascript">
213 213 $('#add_perm').on('click', function(e){
214 214 addNewPermInput($(this), 'group');
215 215 });
216 216 $('.revoke_perm').on('click', function(e){
217 217 markRevokePermInput($(this), 'group');
218 218 });
219 219 quick_repo_menu();
220 220 </script>
@@ -1,222 +1,222 b''
1 1 <%namespace name="base" file="/base/base.mako"/>
2 2
3 3 <div class="panel panel-default">
4 4 <div class="panel-heading">
5 5 <h3 class="panel-title">${_('Repository Access Permissions')}</h3>
6 6 </div>
7 7 <div class="panel-body">
8 8 ${h.secure_form(h.route_path('edit_repo_perms', repo_name=c.repo_name), request=request)}
9 9 <table id="permissions_manage" class="rctable permissions">
10 10 <tr>
11 11 <th class="td-radio">${_('None')}</th>
12 12 <th class="td-radio">${_('Read')}</th>
13 13 <th class="td-radio">${_('Write')}</th>
14 14 <th class="td-radio">${_('Admin')}</th>
15 15 <th class="td-owner">${_('User/User Group')}</th>
16 16 <th class="td-action"></th>
17 17 <th class="td-action"></th>
18 18 </tr>
19 19 ## USERS
20 20 %for _user in c.rhodecode_db_repo.permissions():
21 21 %if getattr(_user, 'admin_row', None) or getattr(_user, 'owner_row', None):
22 22 <tr class="perm_admin_row">
23 23 <td class="td-radio">${h.radio('admin_perm_%s' % _user.user_id,'repository.none', disabled="disabled")}</td>
24 24 <td class="td-radio">${h.radio('admin_perm_%s' % _user.user_id,'repository.read', disabled="disabled")}</td>
25 25 <td class="td-radio">${h.radio('admin_perm_%s' % _user.user_id,'repository.write', disabled="disabled")}</td>
26 26 <td class="td-radio">${h.radio('admin_perm_%s' % _user.user_id,'repository.admin', 'repository.admin', disabled="disabled")}</td>
27 27 <td class="td-user">
28 28 ${base.gravatar(_user.email, 16, user=_user, tooltip=True)}
29 29 ${h.link_to_user(_user.username)}
30 30 %if getattr(_user, 'admin_row', None):
31 (${_('super admin')})
31 (${_('super-admin')})
32 32 %endif
33 33 %if getattr(_user, 'owner_row', None):
34 34 (${_('owner')})
35 35 %endif
36 36 </td>
37 37 <td></td>
38 38 <td class="quick_repo_menu">
39 39 % if c.rhodecode_user.is_admin:
40 40 <i class="icon-more"></i>
41 41 <div class="menu_items_container" style="display: none;">
42 42 <ul class="menu_items">
43 43 <li>
44 44 ${h.link_to('show permissions', h.route_path('edit_user_perms_summary', user_id=_user.user_id, _anchor='repositories-permissions'))}
45 45 </li>
46 46 </ul>
47 47 </div>
48 48 % endif
49 49 </td>
50 50 </tr>
51 51 %elif _user.username == h.DEFAULT_USER and c.rhodecode_db_repo.private:
52 52 <tr>
53 53 <td colspan="4">
54 54 <span class="private_repo_msg">
55 55 <strong title="${h.tooltip(_user.permission)}">${_('private repository')}</strong>
56 56 </span>
57 57 </td>
58 58 <td class="private_repo_msg">
59 59 ${base.gravatar(h.DEFAULT_USER_EMAIL, 16)}
60 60 ${h.DEFAULT_USER} - ${_('only users/user groups explicitly added here will have access')}</td>
61 61 <td></td>
62 62 <td class="quick_repo_menu">
63 63 % if c.rhodecode_user.is_admin:
64 64 <i class="icon-more"></i>
65 65 <div class="menu_items_container" style="display: none;">
66 66 <ul class="menu_items">
67 67 <li>
68 68 ${h.link_to('show permissions', h.route_path('admin_permissions_overview', _anchor='repositories-permissions'))}
69 69 </li>
70 70 </ul>
71 71 </div>
72 72 % endif
73 73 </td>
74 74 </tr>
75 75 %else:
76 76 <% used_by_n_rules = len(getattr(_user, 'branch_rules', None) or []) %>
77 77 <tr>
78 78 <td class="td-radio">${h.radio('u_perm_%s' % _user.user_id,'repository.none', checked=_user.permission=='repository.none', disabled="disabled" if (used_by_n_rules and _user.username != h.DEFAULT_USER) else None)}</td>
79 79 <td class="td-radio">${h.radio('u_perm_%s' % _user.user_id,'repository.read', checked=_user.permission=='repository.read', disabled="disabled" if (used_by_n_rules and _user.username != h.DEFAULT_USER) else None)}</td>
80 80 <td class="td-radio">${h.radio('u_perm_%s' % _user.user_id,'repository.write', checked=_user.permission=='repository.write')}</td>
81 81 <td class="td-radio">${h.radio('u_perm_%s' % _user.user_id,'repository.admin', checked=_user.permission=='repository.admin')}</td>
82 82 <td class="td-user">
83 83 ${base.gravatar(_user.email, 16, user=_user, tooltip=True)}
84 84 <span class="user">
85 85 % if _user.username == h.DEFAULT_USER:
86 86 ${h.DEFAULT_USER} <span class="user-perm-help-text"> - ${_('permission for all other users')}</span>
87 87 % else:
88 88 ${h.link_to_user(_user.username)}
89 89 %if getattr(_user, 'duplicate_perm', None):
90 90 (${_('inactive duplicate')})
91 91 %endif
92 92 %if getattr(_user, 'branch_rules', None):
93 93 % if used_by_n_rules == 1:
94 94 (${_('used by {} branch rule, requires write+ permissions').format(used_by_n_rules)})
95 95 % else:
96 96 (${_('used by {} branch rules, requires write+ permissions').format(used_by_n_rules)})
97 97 % endif
98 98 %endif
99 99 % endif
100 100 </span>
101 101 </td>
102 102 <td class="td-action">
103 103 %if _user.username != h.DEFAULT_USER and getattr(_user, 'branch_rules', None) is None:
104 104 <span class="btn btn-link btn-danger revoke_perm"
105 105 member="${_user.user_id}" member_type="user">
106 106 ${_('Remove')}
107 107 </span>
108 108 %elif _user.username == h.DEFAULT_USER:
109 109 <span class="tooltip btn btn-link btn-default" onclick="enablePrivateRepo(); return false" title="${_('Private repositories are only visible to people explicitly added as collaborators.')}">
110 110 ${_('set private mode')}
111 111 </span>
112 112 %endif
113 113 </td>
114 114 <td class="quick_repo_menu">
115 115 % if c.rhodecode_user.is_admin:
116 116 <i class="icon-more"></i>
117 117 <div class="menu_items_container" style="display: none;">
118 118 <ul class="menu_items">
119 119 <li>
120 120 % if _user.username == h.DEFAULT_USER:
121 121 ${h.link_to('show permissions', h.route_path('admin_permissions_overview', _anchor='repositories-permissions'))}
122 122 % else:
123 123 ${h.link_to('show permissions', h.route_path('edit_user_perms_summary', user_id=_user.user_id, _anchor='repositories-permissions'))}
124 124 % endif
125 125 </li>
126 126 </ul>
127 127 </div>
128 128 % endif
129 129 </td>
130 130 </tr>
131 131 %endif
132 132 %endfor
133 133
134 134 ## USER GROUPS
135 135 %for _user_group in c.rhodecode_db_repo.permission_user_groups(with_members=True):
136 136 <tr>
137 137 <td class="td-radio">${h.radio('g_perm_%s' % _user_group.users_group_id,'repository.none', checked=_user_group.permission=='repository.none')}</td>
138 138 <td class="td-radio">${h.radio('g_perm_%s' % _user_group.users_group_id,'repository.read', checked=_user_group.permission=='repository.read')}</td>
139 139 <td class="td-radio">${h.radio('g_perm_%s' % _user_group.users_group_id,'repository.write', checked=_user_group.permission=='repository.write')}</td>
140 140 <td class="td-radio">${h.radio('g_perm_%s' % _user_group.users_group_id,'repository.admin', checked=_user_group.permission=='repository.admin')}</td>
141 141 <td class="td-componentname">
142 142 ${base.user_group_icon(_user_group, tooltip=True)}
143 143 %if c.is_super_admin:
144 144 <a href="${h.route_path('edit_user_group',user_group_id=_user_group.users_group_id)}">
145 145 ${_user_group.users_group_name}
146 146 </a>
147 147 %else:
148 148 ${h.link_to_group(_user_group.users_group_name)}
149 149 %endif
150 150 (${_('members')}: ${len(_user_group.members)})
151 151 </td>
152 152 <td class="td-action">
153 153 <span class="btn btn-link btn-danger revoke_perm"
154 154 member="${_user_group.users_group_id}" member_type="user_group">
155 155 ${_('Remove')}
156 156 </span>
157 157 </td>
158 158 <td class="quick_repo_menu">
159 159 % if c.rhodecode_user.is_admin:
160 160 <i class="icon-more"></i>
161 161 <div class="menu_items_container" style="display: none;">
162 162 <ul class="menu_items">
163 163 <li>
164 164 ${h.link_to('show permissions', h.route_path('edit_user_group_perms_summary', user_group_id=_user_group.users_group_id, _anchor='repositories-permissions'))}
165 165 </li>
166 166 </ul>
167 167 </div>
168 168 % endif
169 169 </td>
170 170 </tr>
171 171 %endfor
172 172 <tr class="new_members" id="add_perm_input"></tr>
173 173
174 174 <tr>
175 175 <td></td>
176 176 <td></td>
177 177 <td></td>
178 178 <td></td>
179 179 <td></td>
180 180 <td>
181 181 <span id="add_perm" class="link">
182 182 ${_('Add user/user group')}
183 183 </span>
184 184 </td>
185 185 <td></td>
186 186 </tr>
187 187
188 188 </table>
189 189
190 190 <div class="buttons">
191 191 ${h.submit('save',_('Save'),class_="btn btn-primary")}
192 192 ${h.reset('reset',_('Reset'),class_="btn btn-danger")}
193 193 </div>
194 194 ${h.end_form()}
195 195 </div>
196 196 </div>
197 197
198 198 <script type="text/javascript">
199 199 $('#add_perm').on('click', function(e){
200 200 addNewPermInput($(this), 'repository');
201 201 });
202 202 $('.revoke_perm').on('click', function(e){
203 203 markRevokePermInput($(this), 'repository');
204 204 });
205 205 quick_repo_menu();
206 206
207 207 var enablePrivateRepo = function () {
208 208 var postData = {
209 209 'csrf_token': CSRF_TOKEN
210 210 };
211 211
212 212 var success = function(o) {
213 213 var defaultUrl = pyroutes.url('edit_repo_perms', {"repo_name": templateContext.repo_name});
214 214 window.location = o.redirect_url || defaultUrl;
215 215 };
216 216
217 217 ajaxPOST(
218 218 pyroutes.url('edit_repo_perms_set_private', {"repo_name": templateContext.repo_name}),
219 219 postData,
220 220 success);
221 221 }
222 222 </script>
@@ -1,207 +1,207 b''
1 1 <%namespace name="base" file="/base/base.mako"/>
2 2
3 3 <div class="panel panel-default">
4 4 <div class="panel-heading">
5 5 <h3 class="panel-title">${_('User Group Permissions')}</h3>
6 6 </div>
7 7 <div class="panel-body">
8 8 ${h.secure_form(h.route_path('edit_user_group_perms_update', user_group_id=c.user_group.users_group_id), request=request)}
9 9 <table id="permissions_manage" class="rctable permissions">
10 10 <tr>
11 11 <th class="td-radio">${_('None')}</th>
12 12 <th class="td-radio">${_('Read')}</th>
13 13 <th class="td-radio">${_('Write')}</th>
14 14 <th class="td-radio">${_('Admin')}</th>
15 15 <th>${_('User/User Group')}</th>
16 16 <th class="td-action"></th>
17 17 <th class="td-action"></th>
18 18 </tr>
19 19 ## USERS
20 20 %for _user in c.user_group.permissions():
21 21 ## super admin/owner row
22 22 %if getattr(_user, 'admin_row', None) or getattr(_user, 'owner_row', None):
23 23 <tr class="perm_admin_row">
24 24 <td class="td-radio">${h.radio('admin_perm_%s' % _user.user_id,'repository.none', disabled="disabled")}</td>
25 25 <td class="td-radio">${h.radio('admin_perm_%s' % _user.user_id,'repository.read', disabled="disabled")}</td>
26 26 <td class="td-radio">${h.radio('admin_perm_%s' % _user.user_id,'repository.write', disabled="disabled")}</td>
27 27 <td class="td-radio">${h.radio('admin_perm_%s' % _user.user_id,'repository.admin', 'repository.admin', disabled="disabled")}</td>
28 28 <td class="td-user">
29 29 ${base.gravatar(_user.email, 16, user=_user, tooltip=True)}
30 30 <span class="user">
31 31 ${h.link_to_user(_user.username)}
32 32 %if getattr(_user, 'admin_row', None):
33 (${_('super admin')})
33 (${_('super-admin')})
34 34 %endif
35 35 %if getattr(_user, 'owner_row', None):
36 36 (${_('owner')})
37 37 %endif
38 38 </span>
39 39 </td>
40 40 <td></td>
41 41 <td class="quick_repo_menu">
42 42 % if c.rhodecode_user.is_admin:
43 43 <i class="icon-more"></i>
44 44 <div class="menu_items_container" style="display: none;">
45 45 <ul class="menu_items">
46 46 <li>
47 47 ${h.link_to('show permissions', h.route_path('edit_user_perms_summary', user_id=_user.user_id, _anchor='user-groups-permissions'))}
48 48 </li>
49 49 </ul>
50 50 </div>
51 51 % endif
52 52 </td>
53 53 </tr>
54 54 %else:
55 55 ##forbid revoking permission from yourself, except if you're an super admin
56 56 <tr>
57 57 %if c.rhodecode_user.user_id != _user.user_id or c.rhodecode_user.is_admin:
58 58 <td class="td-radio">${h.radio('u_perm_%s' % _user.user_id,'usergroup.none')}</td>
59 59 <td class="td-radio">${h.radio('u_perm_%s' % _user.user_id,'usergroup.read')}</td>
60 60 <td class="td-radio">${h.radio('u_perm_%s' % _user.user_id,'usergroup.write')}</td>
61 61 <td class="td-radio">${h.radio('u_perm_%s' % _user.user_id,'usergroup.admin')}</td>
62 62 <td class="td-user">
63 63 ${base.gravatar(_user.email, 16, user=_user, tooltip=True)}
64 64 <span class="user">
65 65 % if _user.username == h.DEFAULT_USER:
66 66 ${h.DEFAULT_USER} <span class="user-perm-help-text"> - ${_('permission for all other users')}</span>
67 67 % else:
68 68 ${h.link_to_user(_user.username)}
69 69 %if getattr(_user, 'duplicate_perm', None):
70 70 (${_('inactive duplicate')})
71 71 %endif
72 72 % endif
73 73 </span>
74 74 </td>
75 75 <td class="td-action">
76 76 %if _user.username != h.DEFAULT_USER:
77 77 <span class="btn btn-link btn-danger revoke_perm"
78 78 member="${_user.user_id}" member_type="user">
79 79 ${_('Remove')}
80 80 </span>
81 81 %endif
82 82 </td>
83 83 <td class="quick_repo_menu">
84 84 % if c.rhodecode_user.is_admin:
85 85 <i class="icon-more"></i>
86 86 <div class="menu_items_container" style="display: none;">
87 87 <ul class="menu_items">
88 88 <li>
89 89 % if _user.username == h.DEFAULT_USER:
90 90 ${h.link_to('show permissions', h.route_path('admin_permissions_overview', _anchor='user-groups-permissions'))}
91 91 % else:
92 92 ${h.link_to('show permissions', h.route_path('edit_user_perms_summary', user_id=_user.user_id, _anchor='user-groups-permissions'))}
93 93 % endif
94 94 </li>
95 95 </ul>
96 96 </div>
97 97 % endif
98 98 </td>
99 99 %else:
100 100 ## special case for currently logged-in user permissions, we make sure he cannot take his own permissions
101 101 <td class="td-radio">${h.radio('u_perm_%s' % _user.user_id,'usergroup.none', disabled="disabled")}</td>
102 102 <td class="td-radio">${h.radio('u_perm_%s' % _user.user_id,'usergroup.read', disabled="disabled")}</td>
103 103 <td class="td-radio">${h.radio('u_perm_%s' % _user.user_id,'usergroup.write', disabled="disabled")}</td>
104 104 <td class="td-radio">${h.radio('u_perm_%s' % _user.user_id,'usergroup.admin', disabled="disabled")}</td>
105 105 <td class="td-user">
106 106 ${base.gravatar(_user.email, 16, user=_user, tooltip=True)}
107 107 <span class="user">
108 108 % if _user.username == h.DEFAULT_USER:
109 109 ${h.DEFAULT_USER} <span class="user-perm-help-text"> - ${_('permission for all other users')}</span>
110 110 % else:
111 111 ${h.link_to_user(_user.username)}
112 112 %if getattr(_user, 'duplicate_perm', None):
113 113 (${_('inactive duplicate')})
114 114 %endif
115 115 % endif
116 116 <span class="user-perm-help-text">(${_('delegated admin')})</span>
117 117 </span>
118 118 </td>
119 119 <td></td>
120 120 <td class="quick_repo_menu">
121 121 % if c.rhodecode_user.is_admin:
122 122 <i class="icon-more"></i>
123 123 <div class="menu_items_container" style="display: none;">
124 124 <ul class="menu_items">
125 125 <li>
126 126 ${h.link_to('show permissions', h.route_path('edit_user_perms_summary', user_id=_user.user_id, _anchor='user-groups-permissions'))}
127 127 </li>
128 128 </ul>
129 129 </div>
130 130 % endif
131 131 </td>
132 132 %endif
133 133 </tr>
134 134 %endif
135 135 %endfor
136 136
137 137 ## USER GROUPS
138 138 %for _user_group in c.user_group.permission_user_groups(with_members=True):
139 139 <tr>
140 140 <td class="td-radio">${h.radio('g_perm_%s' % _user_group.users_group_id,'usergroup.none')}</td>
141 141 <td class="td-radio">${h.radio('g_perm_%s' % _user_group.users_group_id,'usergroup.read')}</td>
142 142 <td class="td-radio">${h.radio('g_perm_%s' % _user_group.users_group_id,'usergroup.write')}</td>
143 143 <td class="td-radio">${h.radio('g_perm_%s' % _user_group.users_group_id,'usergroup.admin')}</td>
144 144 <td class="td-user">
145 145 <i class="icon-user-group"></i>
146 146 %if c.is_super_admin:
147 147 <a href="${h.route_path('edit_user_group',user_group_id=_user_group.users_group_id)}">
148 148 ${_user_group.users_group_name}
149 149 </a>
150 150 %else:
151 151 ${h.link_to_group(_user_group.users_group_name)}
152 152 %endif
153 153 (${_('members')}: ${len(_user_group.members)})
154 154 </td>
155 155 <td class="td-action">
156 156 <span class="btn btn-link btn-danger revoke_perm"
157 157 member="${_user_group.users_group_id}" member_type="user_group">
158 158 ${_('Remove')}
159 159 </span>
160 160 </td>
161 161 <td class="quick_repo_menu">
162 162 % if c.rhodecode_user.is_admin:
163 163 <i class="icon-more"></i>
164 164 <div class="menu_items_container" style="display: none;">
165 165 <ul class="menu_items">
166 166 <li>
167 167 ${h.link_to('show permissions', h.route_path('edit_user_group_perms_summary', user_group_id=_user_group.users_group_id, _anchor='user-groups-permissions'))}
168 168 </li>
169 169 </ul>
170 170 </div>
171 171 % endif
172 172 </td>
173 173 </tr>
174 174 %endfor
175 175 <tr class="new_members" id="add_perm_input"></tr>
176 176 <tr>
177 177 <td></td>
178 178 <td></td>
179 179 <td></td>
180 180 <td></td>
181 181 <td></td>
182 182 <td>
183 183 <span id="add_perm" class="link">
184 184 ${_('Add user/user group')}
185 185 </span>
186 186 </td>
187 187 <td></td>
188 188 </tr>
189 189 </table>
190 190
191 191 <div class="buttons">
192 192 ${h.submit('save',_('Save'),class_="btn btn-primary")}
193 193 ${h.reset('reset',_('Reset'),class_="btn btn-danger")}
194 194 </div>
195 195 ${h.end_form()}
196 196 </div>
197 197 </div>
198 198
199 199 <script type="text/javascript">
200 200 $('#add_perm').on('click', function(e){
201 201 addNewPermInput($(this), 'usergroup');
202 202 });
203 203 $('.revoke_perm').on('click', function(e){
204 204 markRevokePermInput($(this), 'usergroup');
205 205 });
206 206 quick_repo_menu()
207 207 </script>
@@ -1,161 +1,161 b''
1 1 <%namespace name="base" file="/base/base.mako"/>
2 2
3 3 <div class="panel panel-default user-profile">
4 4 <div class="panel-heading">
5 5 <h3 class="panel-title">${_('User Profile')}</h3>
6 6 </div>
7 7 <div class="panel-body">
8 8 <div class="user-profile-content">
9 9 ${h.secure_form(h.route_path('user_update', user_id=c.user.user_id), class_='form', request=request)}
10 10 <% readonly = None %>
11 11 <% disabled = "" %>
12 12 %if c.extern_type != 'rhodecode':
13 13 <% readonly = "readonly" %>
14 14 <% disabled = " disabled" %>
15 15 <div class="alert-warning" style="margin:0px 0px 20px 0px; padding: 10px">
16 16 <strong>${_('This user was created from external source (%s). Editing some of the settings is limited.' % c.extern_type)}</strong>
17 17 </div>
18 18 %endif
19 19 <div class="form">
20 20 <div class="fields">
21 21 <div class="field">
22 22 <div class="label photo">
23 23 ${_('Photo')}:
24 24 </div>
25 25 <div class="input profile">
26 26 %if c.visual.use_gravatar:
27 27 ${base.gravatar(c.user.email, 100)}
28 28 <p class="help-block">${_('Change the avatar at')} <a href="http://gravatar.com">gravatar.com</a>.</p>
29 29 %else:
30 30 ${base.gravatar(c.user.email, 100)}
31 31 %endif
32 32 </div>
33 33 </div>
34 34 <div class="field">
35 35 <div class="label">
36 36 ${_('Username')}:
37 37 </div>
38 38 <div class="input">
39 39 ${h.text('username', class_='%s medium' % disabled, readonly=readonly)}
40 40 </div>
41 41 </div>
42 42 <div class="field">
43 43 <div class="label">
44 44 <label for="name">${_('First Name')}:</label>
45 45 </div>
46 46 <div class="input">
47 47 ${h.text('firstname', class_="medium")}
48 48 </div>
49 49 </div>
50 50
51 51 <div class="field">
52 52 <div class="label">
53 53 <label for="lastname">${_('Last Name')}:</label>
54 54 </div>
55 55 <div class="input">
56 56 ${h.text('lastname', class_="medium")}
57 57 </div>
58 58 </div>
59 59
60 60 <div class="field">
61 61 <div class="label">
62 62 <label for="email">${_('Email')}:</label>
63 63 </div>
64 64 <div class="input">
65 65 ## we should be able to edit email !
66 66 ${h.text('email', class_="medium")}
67 67 </div>
68 68 </div>
69 69 <div class="field">
70 70 <div class="label">
71 71 <label for="description">${_('Description')}:</label>
72 72 </div>
73 73 <div class="input textarea editor">
74 74 ${h.textarea('description', rows=10, class_="medium")}
75 75 <% metatags_url = h.literal('''<a href="#metatagsShow" onclick="$('#meta-tags-desc').toggle();return false">meta-tags</a>''') %>
76 76 <span class="help-block">${_('Plain text format with support of {metatags}. Add a README file for longer descriptions').format(metatags=metatags_url)|n}</span>
77 77 <span id="meta-tags-desc" style="display: none">
78 78 <%namespace name="dt" file="/data_table/_dt_elements.mako"/>
79 79 ${dt.metatags_help()}
80 80 </span>
81 81 </div>
82 82 </div>
83 83 <div class="field">
84 84 <div class="label">
85 85 ${_('New Password')}:
86 86 </div>
87 87 <div class="input">
88 88 ${h.password('new_password',class_='%s medium' % disabled,autocomplete="off",readonly=readonly)}
89 89 </div>
90 90 </div>
91 91 <div class="field">
92 92 <div class="label">
93 93 ${_('New Password Confirmation')}:
94 94 </div>
95 95 <div class="input">
96 96 ${h.password('password_confirmation',class_="%s medium" % disabled,autocomplete="off",readonly=readonly)}
97 97 </div>
98 98 </div>
99 99 <div class="field">
100 100 <div class="label-text">
101 101 ${_('Active')}:
102 102 </div>
103 103 <div class="input user-checkbox">
104 104 ${h.checkbox('active',value=True)}
105 105 </div>
106 106 </div>
107 107 <div class="field">
108 108 <div class="label-text">
109 ${_('Super Admin')}:
109 ${_('Super-admin')}:
110 110 </div>
111 111 <div class="input user-checkbox">
112 112 ${h.checkbox('admin',value=True)}
113 113 </div>
114 114 </div>
115 115 <div class="field">
116 116 <div class="label-text">
117 117 ${_('Authentication type')}:
118 118 </div>
119 119 <div class="input">
120 120 ${h.select('extern_type', c.extern_type, c.allowed_extern_types)}
121 121 <p class="help-block">${_('When user was created using an external source. He is bound to authentication using this method.')}</p>
122 122 </div>
123 123 </div>
124 124 <div class="field">
125 125 <div class="label-text">
126 126 ${_('Name in Source of Record')}:
127 127 </div>
128 128 <div class="input">
129 129 <p>${c.extern_name}</p>
130 130 ${h.hidden('extern_name', readonly="readonly")}
131 131 </div>
132 132 </div>
133 133 <div class="field">
134 134 <div class="label">
135 135 ${_('Language')}:
136 136 </div>
137 137 <div class="input">
138 138 ## allowed_languages is defined in the users.py
139 139 ## c.language comes from base.py as a default language
140 140 ${h.select('language', c.language, c.allowed_languages)}
141 141 <p class="help-block">${h.literal(_('User interface language. Help translate %(rc_link)s into your language.') % {'rc_link': h.link_to('RhodeCode Enterprise', h.route_url('rhodecode_translations'))})}</p>
142 142 </div>
143 143 </div>
144 144 <div class="buttons">
145 145 ${h.submit('save', _('Save'), class_="btn")}
146 146 ${h.reset('reset', _('Reset'), class_="btn")}
147 147 </div>
148 148 </div>
149 149 </div>
150 150 ${h.end_form()}
151 151 </div>
152 152 </div>
153 153 </div>
154 154
155 155 <script>
156 156 $('#language').select2({
157 157 'containerCssClass': "drop-menu",
158 158 'dropdownCssClass': "drop-menu-dropdown",
159 159 'dropdownAutoWidth': true
160 160 });
161 161 </script>
@@ -1,126 +1,126 b''
1 1 ## -*- coding: utf-8 -*-
2 2 <%inherit file="/base/base.mako"/>
3 3
4 4 <%def name="title()">
5 5 ${_('Users administration')}
6 6 %if c.rhodecode_name:
7 7 &middot; ${h.branding(c.rhodecode_name)}
8 8 %endif
9 9 </%def>
10 10
11 11 <%def name="breadcrumbs_links()"></%def>
12 12
13 13 <%def name="menu_bar_nav()">
14 14 ${self.menu_items(active='admin')}
15 15 </%def>
16 16
17 17 <%def name="menu_bar_subnav()">
18 18 ${self.admin_menu(active='users')}
19 19 </%def>
20 20
21 21 <%def name="main()">
22 22
23 23 <div class="box">
24 24
25 25 <div class="title">
26 26 <input class="q_filter_box" id="q_filter" size="15" type="text" name="filter" placeholder="${_('quick filter...')}" value=""/>
27 27 <span id="user_count">0</span>
28 28
29 29 <ul class="links">
30 30 <li>
31 31 <a href="${h.route_path('users_new')}" class="btn btn-small btn-success">${_(u'Add User')}</a>
32 32 </li>
33 33 </ul>
34 34 </div>
35 35
36 36 <div id="repos_list_wrap">
37 37 <table id="user_list_table" class="display"></table>
38 38 </div>
39 39 </div>
40 40
41 41 <script type="text/javascript">
42 42
43 43 $(document).ready(function() {
44 44 var $userListTable = $('#user_list_table');
45 45 // user list
46 46 $userListTable.DataTable({
47 47 processing: true,
48 48 serverSide: true,
49 49 ajax: {
50 50 "url": "${h.route_path('users_data')}",
51 51 "dataSrc": function ( json ) {
52 52 var filteredCount = json.recordsFiltered;
53 53 var filteredInactiveCount = json.recordsFilteredInactive;
54 54 var totalInactive = json.recordsTotalInactive;
55 55 var total = json.recordsTotal;
56 56
57 57 var _text = _gettext(
58 58 "{0} ({1} inactive) of {2} users ({3} inactive)").format(
59 59 filteredCount, filteredInactiveCount, total, totalInactive);
60 60
61 61 if(total === filteredCount){
62 62 _text = _gettext(
63 63 "{0} users ({1} inactive)").format(total, totalInactive);
64 64 }
65 65 $('#user_count').text(_text);
66 66 return json.data;
67 67 }
68 68 },
69 69 dom: 'rtp',
70 70 pageLength: ${c.visual.admin_grid_items},
71 71 order: [[ 0, "asc" ]],
72 72 columns: [
73 73 { data: {"_": "username",
74 74 "sort": "username"}, title: "${_('Username')}", className: "td-user" },
75 75 { data: {"_": "email",
76 76 "sort": "email"}, title: "${_('Email')}", className: "td-email" },
77 77 { data: {"_": "first_name",
78 78 "sort": "first_name"}, title: "${_('First Name')}", className: "td-user" },
79 79 { data: {"_": "last_name",
80 80 "sort": "last_name"}, title: "${_('Last Name')}", className: "td-user" },
81 81 { data: {"_": "last_activity",
82 82 "sort": "last_activity",
83 83 "type": Number}, title: "${_('Last activity')}", className: "td-time" },
84 84 { data: {"_": "active",
85 85 "sort": "active"}, title: "${_('Active')}", className: "td-active" },
86 86 { data: {"_": "admin",
87 "sort": "admin"}, title: "${_('Super admin')}", className: "td-admin" },
87 "sort": "admin"}, title: "${_('Super-admin')}", className: "td-admin" },
88 88 { data: {"_": "extern_type",
89 89 "sort": "extern_type"}, title: "${_('Auth type')}", className: "td-type" },
90 90 { data: {"_": "action",
91 91 "sort": "action"}, title: "${_('Action')}", className: "td-action", orderable: false }
92 92 ],
93 93 language: {
94 94 paginate: DEFAULT_GRID_PAGINATION,
95 95 sProcessing: _gettext('loading...'),
96 96 emptyTable: _gettext("No users available yet.")
97 97 },
98 98
99 99 "createdRow": function ( row, data, index ) {
100 100 if (!data['active_raw']){
101 101 $(row).addClass('closed')
102 102 }
103 103 }
104 104 });
105 105
106 106 $userListTable.on('xhr.dt', function(e, settings, json, xhr){
107 107 $userListTable.css('opacity', 1);
108 108 });
109 109
110 110 $userListTable.on('preXhr.dt', function(e, settings, data){
111 111 $userListTable.css('opacity', 0.3);
112 112 });
113 113
114 114 // filter
115 115 $('#q_filter').on('keyup',
116 116 $.debounce(250, function() {
117 117 $userListTable.DataTable().search(
118 118 $('#q_filter').val()
119 119 ).draw();
120 120 })
121 121 );
122 122
123 123 });
124 124 </script>
125 125
126 126 </%def>
@@ -1,1139 +1,1139 b''
1 1 ## -*- coding: utf-8 -*-
2 2
3 3 <%!
4 4 ## base64 filter e.g ${ example | base64 }
5 5 def base64(text):
6 6 import base64
7 7 from rhodecode.lib.helpers import safe_str
8 8 return base64.encodestring(safe_str(text))
9 9 %>
10 10
11 11 <%inherit file="root.mako"/>
12 12
13 13 <%include file="/ejs_templates/templates.html"/>
14 14
15 15 <div class="outerwrapper">
16 16 <!-- HEADER -->
17 17 <div class="header">
18 18 <div id="header-inner" class="wrapper">
19 19 <div id="logo">
20 20 <div class="logo-wrapper">
21 21 <a href="${h.route_path('home')}"><img src="${h.asset('images/rhodecode-logo-white-60x60.png')}" alt="RhodeCode"/></a>
22 22 </div>
23 23 % if c.rhodecode_name:
24 24 <div class="branding">
25 25 <a href="${h.route_path('home')}">${h.branding(c.rhodecode_name)}</a>
26 26 </div>
27 27 % endif
28 28 </div>
29 29 <!-- MENU BAR NAV -->
30 30 ${self.menu_bar_nav()}
31 31 <!-- END MENU BAR NAV -->
32 32 </div>
33 33 </div>
34 34 ${self.menu_bar_subnav()}
35 35 <!-- END HEADER -->
36 36
37 37 <!-- CONTENT -->
38 38 <div id="content" class="wrapper">
39 39
40 40 <rhodecode-toast id="notifications"></rhodecode-toast>
41 41
42 42 <div class="main">
43 43 ${next.main()}
44 44 </div>
45 45 </div>
46 46 <!-- END CONTENT -->
47 47
48 48 </div>
49 49 <!-- FOOTER -->
50 50 <div id="footer">
51 51 <div id="footer-inner" class="title wrapper">
52 52 <div>
53 53 <p class="footer-link-right">
54 54 % if c.visual.show_version:
55 55 RhodeCode Enterprise ${c.rhodecode_version} ${c.rhodecode_edition}
56 56 % endif
57 57 &copy; 2010-${h.datetime.today().year}, <a href="${h.route_url('rhodecode_official')}" target="_blank">RhodeCode GmbH</a>. All rights reserved.
58 58 % if c.visual.rhodecode_support_url:
59 59 <a href="${c.visual.rhodecode_support_url}" target="_blank">${_('Support')}</a>
60 60 % endif
61 61 </p>
62 62 <% sid = 'block' if request.GET.get('showrcid') else 'none' %>
63 63 <p class="server-instance" style="display:${sid}">
64 64 ## display hidden instance ID if specially defined
65 65 % if c.rhodecode_instanceid:
66 66 ${_('RhodeCode instance id: {}').format(c.rhodecode_instanceid)}
67 67 % endif
68 68 </p>
69 69 </div>
70 70 </div>
71 71 </div>
72 72
73 73 <!-- END FOOTER -->
74 74
75 75 ### MAKO DEFS ###
76 76
77 77 <%def name="menu_bar_subnav()">
78 78 </%def>
79 79
80 80 <%def name="breadcrumbs(class_='breadcrumbs')">
81 81 <div class="${class_}">
82 82 ${self.breadcrumbs_links()}
83 83 </div>
84 84 </%def>
85 85
86 86 <%def name="admin_menu(active=None)">
87 87
88 88 <div id="context-bar">
89 89 <div class="wrapper">
90 90 <div class="title">
91 91 <div class="title-content">
92 92 <div class="title-main">
93 93 % if c.is_super_admin:
94 ${_('Super Admin Panel')}
94 ${_('Super-admin Panel')}
95 95 % else:
96 96 ${_('Delegated Admin Panel')}
97 97 % endif
98 98 </div>
99 99 </div>
100 100 </div>
101 101
102 102 <ul id="context-pages" class="navigation horizontal-list">
103 103
104 ## super admin case
104 ## super-admin case
105 105 % if c.is_super_admin:
106 106 <li class="${h.is_active('audit_logs', active)}"><a href="${h.route_path('admin_audit_logs')}">${_('Admin audit logs')}</a></li>
107 107 <li class="${h.is_active('repositories', active)}"><a href="${h.route_path('repos')}">${_('Repositories')}</a></li>
108 108 <li class="${h.is_active('repository_groups', active)}"><a href="${h.route_path('repo_groups')}">${_('Repository groups')}</a></li>
109 109 <li class="${h.is_active('users', active)}"><a href="${h.route_path('users')}">${_('Users')}</a></li>
110 110 <li class="${h.is_active('user_groups', active)}"><a href="${h.route_path('user_groups')}">${_('User groups')}</a></li>
111 111 <li class="${h.is_active('permissions', active)}"><a href="${h.route_path('admin_permissions_application')}">${_('Permissions')}</a></li>
112 112 <li class="${h.is_active('authentication', active)}"><a href="${h.route_path('auth_home', traverse='')}">${_('Authentication')}</a></li>
113 113 <li class="${h.is_active('integrations', active)}"><a href="${h.route_path('global_integrations_home')}">${_('Integrations')}</a></li>
114 114 <li class="${h.is_active('defaults', active)}"><a href="${h.route_path('admin_defaults_repositories')}">${_('Defaults')}</a></li>
115 115 <li class="${h.is_active('settings', active)}"><a href="${h.route_path('admin_settings')}">${_('Settings')}</a></li>
116 116
117 117 ## delegated admin
118 118 % elif c.is_delegated_admin:
119 119 <%
120 120 repositories=c.auth_user.repositories_admin or c.can_create_repo
121 121 repository_groups=c.auth_user.repository_groups_admin or c.can_create_repo_group
122 122 user_groups=c.auth_user.user_groups_admin or c.can_create_user_group
123 123 %>
124 124
125 125 %if repositories:
126 126 <li class="${h.is_active('repositories', active)} local-admin-repos"><a href="${h.route_path('repos')}">${_('Repositories')}</a></li>
127 127 %endif
128 128 %if repository_groups:
129 129 <li class="${h.is_active('repository_groups', active)} local-admin-repo-groups"><a href="${h.route_path('repo_groups')}">${_('Repository groups')}</a></li>
130 130 %endif
131 131 %if user_groups:
132 132 <li class="${h.is_active('user_groups', active)} local-admin-user-groups"><a href="${h.route_path('user_groups')}">${_('User groups')}</a></li>
133 133 %endif
134 134 % endif
135 135 </ul>
136 136
137 137 </div>
138 138 <div class="clear"></div>
139 139 </div>
140 140 </%def>
141 141
142 142 <%def name="dt_info_panel(elements)">
143 143 <dl class="dl-horizontal">
144 144 %for dt, dd, title, show_items in elements:
145 145 <dt>${dt}:</dt>
146 146 <dd title="${h.tooltip(title)}">
147 147 %if callable(dd):
148 148 ## allow lazy evaluation of elements
149 149 ${dd()}
150 150 %else:
151 151 ${dd}
152 152 %endif
153 153 %if show_items:
154 154 <span class="btn-collapse" data-toggle="item-${h.md5_safe(dt)[:6]}-details">${_('Show More')} </span>
155 155 %endif
156 156 </dd>
157 157
158 158 %if show_items:
159 159 <div class="collapsable-content" data-toggle="item-${h.md5_safe(dt)[:6]}-details" style="display: none">
160 160 %for item in show_items:
161 161 <dt></dt>
162 162 <dd>${item}</dd>
163 163 %endfor
164 164 </div>
165 165 %endif
166 166
167 167 %endfor
168 168 </dl>
169 169 </%def>
170 170
171 171 <%def name="tr_info_entry(element)">
172 172 <% key, val, title, show_items = element %>
173 173
174 174 <tr>
175 175 <td style="vertical-align: top">${key}</td>
176 176 <td title="${h.tooltip(title)}">
177 177 %if callable(val):
178 178 ## allow lazy evaluation of elements
179 179 ${val()}
180 180 %else:
181 181 ${val}
182 182 %endif
183 183 %if show_items:
184 184 <div class="collapsable-content" data-toggle="item-${h.md5_safe(val)[:6]}-details" style="display: none">
185 185 % for item in show_items:
186 186 <dt></dt>
187 187 <dd>${item}</dd>
188 188 % endfor
189 189 </div>
190 190 %endif
191 191 </td>
192 192 <td style="vertical-align: top">
193 193 %if show_items:
194 194 <span class="btn-collapse" data-toggle="item-${h.md5_safe(val)[:6]}-details">${_('Show More')} </span>
195 195 %endif
196 196 </td>
197 197 </tr>
198 198
199 199 </%def>
200 200
201 201 <%def name="gravatar(email, size=16, tooltip=False, tooltip_alt=None, user=None)">
202 202 <%
203 203 if size > 16:
204 204 gravatar_class = ['gravatar','gravatar-large']
205 205 else:
206 206 gravatar_class = ['gravatar']
207 207
208 208 data_hovercard_url = ''
209 209 data_hovercard_alt = tooltip_alt.replace('<', '&lt;').replace('>', '&gt;') if tooltip_alt else ''
210 210
211 211 if tooltip:
212 212 gravatar_class += ['tooltip-hovercard']
213 213
214 214 if tooltip and user:
215 215 if user.username == h.DEFAULT_USER:
216 216 gravatar_class.pop(-1)
217 217 else:
218 218 data_hovercard_url = request.route_path('hovercard_user', user_id=getattr(user, 'user_id', ''))
219 219 gravatar_class = ' '.join(gravatar_class)
220 220
221 221 %>
222 222 <%doc>
223 223 TODO: johbo: For now we serve double size images to make it smooth
224 224 for retina. This is how it worked until now. Should be replaced
225 225 with a better solution at some point.
226 226 </%doc>
227 227
228 228 <img class="${gravatar_class}" height="${size}" width="${size}" data-hovercard-url="${data_hovercard_url}" data-hovercard-alt="${data_hovercard_alt}" src="${h.gravatar_url(email, size * 2)}" />
229 229 </%def>
230 230
231 231
232 232 <%def name="gravatar_with_user(contact, size=16, show_disabled=False, tooltip=False)">
233 233 <%
234 234 email = h.email_or_none(contact)
235 235 rc_user = h.discover_user(contact)
236 236 %>
237 237
238 238 <div class="rc-user">
239 239 ${self.gravatar(email, size, tooltip=tooltip, tooltip_alt=contact, user=rc_user)}
240 240 <span class="${('user user-disabled' if show_disabled else 'user')}"> ${h.link_to_user(rc_user or contact)}</span>
241 241 </div>
242 242 </%def>
243 243
244 244
245 245 <%def name="user_group_icon(user_group=None, size=16, tooltip=False)">
246 246 <%
247 247 if (size > 16):
248 248 gravatar_class = 'icon-user-group-alt'
249 249 else:
250 250 gravatar_class = 'icon-user-group-alt'
251 251
252 252 if tooltip:
253 253 gravatar_class += ' tooltip-hovercard'
254 254
255 255 data_hovercard_url = request.route_path('hovercard_user_group', user_group_id=user_group.users_group_id)
256 256 %>
257 257 <%doc>
258 258 TODO: johbo: For now we serve double size images to make it smooth
259 259 for retina. This is how it worked until now. Should be replaced
260 260 with a better solution at some point.
261 261 </%doc>
262 262
263 263 <i style="font-size: ${size}px" class="${gravatar_class} x-icon-size-${size}" data-hovercard-url="${data_hovercard_url}"></i>
264 264 </%def>
265 265
266 266 <%def name="repo_page_title(repo_instance)">
267 267 <div class="title-content repo-title">
268 268
269 269 <div class="title-main">
270 270 ## SVN/HG/GIT icons
271 271 %if h.is_hg(repo_instance):
272 272 <i class="icon-hg"></i>
273 273 %endif
274 274 %if h.is_git(repo_instance):
275 275 <i class="icon-git"></i>
276 276 %endif
277 277 %if h.is_svn(repo_instance):
278 278 <i class="icon-svn"></i>
279 279 %endif
280 280
281 281 ## public/private
282 282 %if repo_instance.private:
283 283 <i class="icon-repo-private"></i>
284 284 %else:
285 285 <i class="icon-repo-public"></i>
286 286 %endif
287 287
288 288 ## repo name with group name
289 289 ${h.breadcrumb_repo_link(repo_instance)}
290 290
291 291 ## Context Actions
292 292 <div class="pull-right">
293 293 %if c.rhodecode_user.username != h.DEFAULT_USER:
294 294 <a href="${h.route_path('atom_feed_home', repo_name=c.rhodecode_db_repo.repo_uid, _query=dict(auth_token=c.rhodecode_user.feed_token))}" title="${_('RSS Feed')}" class="btn btn-sm"><i class="icon-rss-sign"></i>RSS</a>
295 295
296 296 <a href="#WatchRepo" onclick="toggleFollowingRepo(this, templateContext.repo_id); return false" title="${_('Watch this Repository and actions on it in your personalized journal')}" class="btn btn-sm ${('watching' if c.repository_is_user_following else '')}">
297 297 % if c.repository_is_user_following:
298 298 <i class="icon-eye-off"></i>${_('Unwatch')}
299 299 % else:
300 300 <i class="icon-eye"></i>${_('Watch')}
301 301 % endif
302 302
303 303 </a>
304 304 %else:
305 305 <a href="${h.route_path('atom_feed_home', repo_name=c.rhodecode_db_repo.repo_uid)}" title="${_('RSS Feed')}" class="btn btn-sm"><i class="icon-rss-sign"></i>RSS</a>
306 306 %endif
307 307 </div>
308 308
309 309 </div>
310 310
311 311 ## FORKED
312 312 %if repo_instance.fork:
313 313 <p class="discreet">
314 314 <i class="icon-code-fork"></i> ${_('Fork of')}
315 315 ${h.link_to_if(c.has_origin_repo_read_perm,repo_instance.fork.repo_name, h.route_path('repo_summary', repo_name=repo_instance.fork.repo_name))}
316 316 </p>
317 317 %endif
318 318
319 319 ## IMPORTED FROM REMOTE
320 320 %if repo_instance.clone_uri:
321 321 <p class="discreet">
322 322 <i class="icon-code-fork"></i> ${_('Clone from')}
323 323 <a href="${h.safe_str(h.hide_credentials(repo_instance.clone_uri))}">${h.hide_credentials(repo_instance.clone_uri)}</a>
324 324 </p>
325 325 %endif
326 326
327 327 ## LOCKING STATUS
328 328 %if repo_instance.locked[0]:
329 329 <p class="locking_locked discreet">
330 330 <i class="icon-repo-lock"></i>
331 331 ${_('Repository locked by %(user)s') % {'user': h.person_by_id(repo_instance.locked[0])}}
332 332 </p>
333 333 %elif repo_instance.enable_locking:
334 334 <p class="locking_unlocked discreet">
335 335 <i class="icon-repo-unlock"></i>
336 336 ${_('Repository not locked. Pull repository to lock it.')}
337 337 </p>
338 338 %endif
339 339
340 340 </div>
341 341 </%def>
342 342
343 343 <%def name="repo_menu(active=None)">
344 344 <%
345 345 ## determine if we have "any" option available
346 346 can_lock = h.HasRepoPermissionAny('repository.write','repository.admin')(c.repo_name) and c.rhodecode_db_repo.enable_locking
347 347 has_actions = can_lock
348 348
349 349 %>
350 350 % if c.rhodecode_db_repo.archived:
351 351 <div class="alert alert-warning text-center">
352 352 <strong>${_('This repository has been archived. It is now read-only.')}</strong>
353 353 </div>
354 354 % endif
355 355
356 356 <!--- REPO CONTEXT BAR -->
357 357 <div id="context-bar">
358 358 <div class="wrapper">
359 359
360 360 <div class="title">
361 361 ${self.repo_page_title(c.rhodecode_db_repo)}
362 362 </div>
363 363
364 364 <ul id="context-pages" class="navigation horizontal-list">
365 365 <li class="${h.is_active('summary', active)}"><a class="menulink" href="${h.route_path('repo_summary', repo_name=c.repo_name)}"><div class="menulabel">${_('Summary')}</div></a></li>
366 366 <li class="${h.is_active('commits', active)}"><a class="menulink" href="${h.route_path('repo_commits', repo_name=c.repo_name)}"><div class="menulabel">${_('Commits')}</div></a></li>
367 367 <li class="${h.is_active('files', active)}"><a class="menulink" href="${h.route_path('repo_files', repo_name=c.repo_name, commit_id=c.rhodecode_db_repo.landing_rev[1], f_path='')}"><div class="menulabel">${_('Files')}</div></a></li>
368 368 <li class="${h.is_active('compare', active)}"><a class="menulink" href="${h.route_path('repo_compare_select',repo_name=c.repo_name)}"><div class="menulabel">${_('Compare')}</div></a></li>
369 369
370 370 ## TODO: anderson: ideally it would have a function on the scm_instance "enable_pullrequest() and enable_fork()"
371 371 %if c.rhodecode_db_repo.repo_type in ['git','hg']:
372 372 <li class="${h.is_active('showpullrequest', active)}">
373 373 <a class="menulink" href="${h.route_path('pullrequest_show_all', repo_name=c.repo_name)}" title="${h.tooltip(_('Show Pull Requests for %s') % c.repo_name)}">
374 374 <div class="menulabel">
375 375 ${_('Pull Requests')} <span class="menulink-counter">${c.repository_pull_requests}</span>
376 376 </div>
377 377 </a>
378 378 </li>
379 379 %endif
380 380
381 381 <li class="${h.is_active('artifacts', active)}">
382 382 <a class="menulink" href="${h.route_path('repo_artifacts_list',repo_name=c.repo_name)}">
383 383 <div class="menulabel">
384 384 ${_('Artifacts')} <span class="menulink-counter">${c.repository_artifacts}</span>
385 385 </div>
386 386 </a>
387 387 </li>
388 388
389 389 %if h.HasRepoPermissionAll('repository.admin')(c.repo_name):
390 390 <li class="${h.is_active('settings', active)}"><a class="menulink" href="${h.route_path('edit_repo',repo_name=c.repo_name)}"><div class="menulabel">${_('Repository Settings')}</div></a></li>
391 391 %endif
392 392
393 393 <li class="${h.is_active('options', active)}">
394 394 % if has_actions:
395 395 <a class="menulink dropdown">
396 396 <div class="menulabel">${_('Options')}<div class="show_more"></div></div>
397 397 </a>
398 398 <ul class="submenu">
399 399 %if can_lock:
400 400 %if c.rhodecode_db_repo.locked[0]:
401 401 <li><a class="locking_del" href="${h.route_path('repo_edit_toggle_locking',repo_name=c.repo_name)}">${_('Unlock Repository')}</a></li>
402 402 %else:
403 403 <li><a class="locking_add" href="${h.route_path('repo_edit_toggle_locking',repo_name=c.repo_name)}">${_('Lock Repository')}</a></li>
404 404 %endif
405 405 %endif
406 406 </ul>
407 407 % else:
408 408 <a class="menulink disabled">
409 409 <div class="menulabel">${_('Options')}<div class="show_more"></div></div>
410 410 </a>
411 411 % endif
412 412 </li>
413 413
414 414 </ul>
415 415 </div>
416 416 <div class="clear"></div>
417 417 </div>
418 418
419 419 <!--- REPO END CONTEXT BAR -->
420 420
421 421 </%def>
422 422
423 423 <%def name="repo_group_page_title(repo_group_instance)">
424 424 <div class="title-content">
425 425 <div class="title-main">
426 426 ## Repository Group icon
427 427 <i class="icon-repo-group"></i>
428 428
429 429 ## repo name with group name
430 430 ${h.breadcrumb_repo_group_link(repo_group_instance)}
431 431 </div>
432 432
433 433 <%namespace name="dt" file="/data_table/_dt_elements.mako"/>
434 434 <div class="repo-group-desc discreet">
435 435 ${dt.repo_group_desc(repo_group_instance.description_safe, repo_group_instance.personal, c.visual.stylify_metatags)}
436 436 </div>
437 437
438 438 </div>
439 439 </%def>
440 440
441 441
442 442 <%def name="repo_group_menu(active=None)">
443 443 <%
444 444 gr_name = c.repo_group.group_name if c.repo_group else None
445 445 # create repositories with write permission on group is set to true
446 446 group_admin = h.HasRepoGroupPermissionAny('group.admin')(gr_name, 'group admin index page')
447 447
448 448 %>
449 449
450 450
451 451 <!--- REPO GROUP CONTEXT BAR -->
452 452 <div id="context-bar">
453 453 <div class="wrapper">
454 454 <div class="title">
455 455 ${self.repo_group_page_title(c.repo_group)}
456 456 </div>
457 457
458 458 <ul id="context-pages" class="navigation horizontal-list">
459 459 <li class="${h.is_active('home', active)}">
460 460 <a class="menulink" href="${h.route_path('repo_group_home', repo_group_name=c.repo_group.group_name)}"><div class="menulabel">${_('Group Home')}</div></a>
461 461 </li>
462 462 % if c.is_super_admin or group_admin:
463 463 <li class="${h.is_active('settings', active)}">
464 464 <a class="menulink" href="${h.route_path('edit_repo_group',repo_group_name=c.repo_group.group_name)}" title="${_('You have admin right to this group, and can edit it')}"><div class="menulabel">${_('Group Settings')}</div></a>
465 465 </li>
466 466 % endif
467 467
468 468 </ul>
469 469 </div>
470 470 <div class="clear"></div>
471 471 </div>
472 472
473 473 <!--- REPO GROUP CONTEXT BAR -->
474 474
475 475 </%def>
476 476
477 477
478 478 <%def name="usermenu(active=False)">
479 479 <%
480 480 not_anonymous = c.rhodecode_user.username != h.DEFAULT_USER
481 481
482 482 gr_name = c.repo_group.group_name if (hasattr(c, 'repo_group') and c.repo_group) else None
483 483 # create repositories with write permission on group is set to true
484 484
485 485 can_fork = c.is_super_admin or h.HasPermissionAny('hg.fork.repository')()
486 486 create_on_write = h.HasPermissionAny('hg.create.write_on_repogroup.true')()
487 487 group_write = h.HasRepoGroupPermissionAny('group.write')(gr_name, 'can write into group index page')
488 488 group_admin = h.HasRepoGroupPermissionAny('group.admin')(gr_name, 'group admin index page')
489 489
490 490 can_create_repos = c.is_super_admin or c.can_create_repo
491 491 can_create_repo_groups = c.is_super_admin or c.can_create_repo_group
492 492
493 493 can_create_repos_in_group = c.is_super_admin or group_admin or (group_write and create_on_write)
494 494 can_create_repo_groups_in_group = c.is_super_admin or group_admin
495 495 %>
496 496
497 497 % if not_anonymous:
498 498 <%
499 499 default_target_group = dict()
500 500 if c.rhodecode_user.personal_repo_group:
501 501 default_target_group = dict(parent_group=c.rhodecode_user.personal_repo_group.group_id)
502 502 %>
503 503
504 504 ## create action
505 505 <li>
506 506 <a href="#create-actions" onclick="return false;" class="menulink childs">
507 507 <i class="tooltip icon-plus-circled" title="${_('Create')}"></i>
508 508 </a>
509 509
510 510 <div class="action-menu submenu">
511 511
512 512 <ol>
513 513 ## scope of within a repository
514 514 % if hasattr(c, 'rhodecode_db_repo') and c.rhodecode_db_repo:
515 515 <li class="submenu-title">${_('This Repository')}</li>
516 516 <li>
517 517 <a href="${h.route_path('pullrequest_new',repo_name=c.repo_name)}">${_('Create Pull Request')}</a>
518 518 </li>
519 519 % if can_fork:
520 520 <li>
521 521 <a href="${h.route_path('repo_fork_new',repo_name=c.repo_name,_query=default_target_group)}">${_('Fork this repository')}</a>
522 522 </li>
523 523 % endif
524 524 % endif
525 525
526 526 ## scope of within repository groups
527 527 % if hasattr(c, 'repo_group') and c.repo_group and (can_create_repos_in_group or can_create_repo_groups_in_group):
528 528 <li class="submenu-title">${_('This Repository Group')}</li>
529 529
530 530 % if can_create_repos_in_group:
531 531 <li>
532 532 <a href="${h.route_path('repo_new',_query=dict(parent_group=c.repo_group.group_id))}">${_('New Repository')}</a>
533 533 </li>
534 534 % endif
535 535
536 536 % if can_create_repo_groups_in_group:
537 537 <li>
538 538 <a href="${h.route_path('repo_group_new',_query=dict(parent_group=c.repo_group.group_id))}">${_(u'New Repository Group')}</a>
539 539 </li>
540 540 % endif
541 541 % endif
542 542
543 543 ## personal group
544 544 % if c.rhodecode_user.personal_repo_group:
545 545 <li class="submenu-title">Personal Group</li>
546 546
547 547 <li>
548 548 <a href="${h.route_path('repo_new',_query=dict(parent_group=c.rhodecode_user.personal_repo_group.group_id))}" >${_('New Repository')} </a>
549 549 </li>
550 550
551 551 <li>
552 552 <a href="${h.route_path('repo_group_new',_query=dict(parent_group=c.rhodecode_user.personal_repo_group.group_id))}">${_('New Repository Group')} </a>
553 553 </li>
554 554 % endif
555 555
556 556 ## Global actions
557 557 <li class="submenu-title">RhodeCode</li>
558 558 % if can_create_repos:
559 559 <li>
560 560 <a href="${h.route_path('repo_new')}" >${_('New Repository')}</a>
561 561 </li>
562 562 % endif
563 563
564 564 % if can_create_repo_groups:
565 565 <li>
566 566 <a href="${h.route_path('repo_group_new')}" >${_(u'New Repository Group')}</a>
567 567 </li>
568 568 % endif
569 569
570 570 <li>
571 571 <a href="${h.route_path('gists_new')}">${_(u'New Gist')}</a>
572 572 </li>
573 573
574 574 </ol>
575 575
576 576 </div>
577 577 </li>
578 578
579 579 ## notifications
580 580 <li>
581 581 <a class="${('empty' if c.unread_notifications == 0 else '')}" href="${h.route_path('notifications_show_all')}">
582 582 ${c.unread_notifications}
583 583 </a>
584 584 </li>
585 585 % endif
586 586
587 587 ## USER MENU
588 588 <li id="quick_login_li" class="${'active' if active else ''}">
589 589 % if c.rhodecode_user.username == h.DEFAULT_USER:
590 590 <a id="quick_login_link" class="menulink childs" href="${h.route_path('login', _query={'came_from': h.current_route_path(request)})}">
591 591 ${gravatar(c.rhodecode_user.email, 20)}
592 592 <span class="user">
593 593 <span>${_('Sign in')}</span>
594 594 </span>
595 595 </a>
596 596 % else:
597 597 ## logged in user
598 598 <a id="quick_login_link" class="menulink childs">
599 599 ${gravatar(c.rhodecode_user.email, 20)}
600 600 <span class="user">
601 601 <span class="menu_link_user">${c.rhodecode_user.username}</span>
602 602 <div class="show_more"></div>
603 603 </span>
604 604 </a>
605 605 ## subnav with menu for logged in user
606 606 <div class="user-menu submenu">
607 607 <div id="quick_login">
608 608 %if c.rhodecode_user.username != h.DEFAULT_USER:
609 609 <div class="">
610 610 <div class="big_gravatar">${gravatar(c.rhodecode_user.email, 48)}</div>
611 611 <div class="full_name">${c.rhodecode_user.full_name_or_username}</div>
612 612 <div class="email">${c.rhodecode_user.email}</div>
613 613 </div>
614 614 <div class="">
615 615 <ol class="links">
616 616 <li>${h.link_to(_(u'My account'),h.route_path('my_account_profile'))}</li>
617 617 % if c.rhodecode_user.personal_repo_group:
618 618 <li>${h.link_to(_(u'My personal group'), h.route_path('repo_group_home', repo_group_name=c.rhodecode_user.personal_repo_group.group_name))}</li>
619 619 % endif
620 620 <li>${h.link_to(_(u'Pull Requests'), h.route_path('my_account_pullrequests'))}</li>
621 621
622 622 % if c.debug_style:
623 623 <li>
624 624 <a class="menulink" title="${_('Style')}" href="${h.route_path('debug_style_home')}">
625 625 <div class="menulabel">${_('[Style]')}</div>
626 626 </a>
627 627 </li>
628 628 % endif
629 629
630 630 ## bookmark-items
631 631 <li class="bookmark-items">
632 632 ${_('Bookmarks')}
633 633 <div class="pull-right">
634 634 <a href="${h.route_path('my_account_bookmarks')}">
635 635
636 636 <i class="icon-cog"></i>
637 637 </a>
638 638 </div>
639 639 </li>
640 640 % if not c.bookmark_items:
641 641 <li>
642 642 <a href="${h.route_path('my_account_bookmarks')}">${_('No Bookmarks yet.')}</a>
643 643 </li>
644 644 % endif
645 645 % for item in c.bookmark_items:
646 646 <li>
647 647 % if item.repository:
648 648 <div>
649 649 <a class="bookmark-item" href="${h.route_path('my_account_goto_bookmark', bookmark_id=item.position)}">
650 650 <code>${item.position}</code>
651 651 % if item.repository.repo_type == 'hg':
652 652 <i class="icon-hg" title="${_('Repository')}" style="font-size: 16px"></i>
653 653 % elif item.repository.repo_type == 'git':
654 654 <i class="icon-git" title="${_('Repository')}" style="font-size: 16px"></i>
655 655 % elif item.repository.repo_type == 'svn':
656 656 <i class="icon-svn" title="${_('Repository')}" style="font-size: 16px"></i>
657 657 % endif
658 658 ${(item.title or h.shorter(item.repository.repo_name, 30))}
659 659 </a>
660 660 </div>
661 661 % elif item.repository_group:
662 662 <div>
663 663 <a class="bookmark-item" href="${h.route_path('my_account_goto_bookmark', bookmark_id=item.position)}">
664 664 <code>${item.position}</code>
665 665 <i class="icon-repo-group" title="${_('Repository group')}" style="font-size: 14px"></i>
666 666 ${(item.title or h.shorter(item.repository_group.group_name, 30))}
667 667 </a>
668 668 </div>
669 669 % else:
670 670 <a class="bookmark-item" href="${h.route_path('my_account_goto_bookmark', bookmark_id=item.position)}">
671 671 <code>${item.position}</code>
672 672 ${item.title}
673 673 </a>
674 674 % endif
675 675 </li>
676 676 % endfor
677 677
678 678 <li class="logout">
679 679 ${h.secure_form(h.route_path('logout'), request=request)}
680 680 ${h.submit('log_out', _(u'Sign Out'),class_="btn btn-primary")}
681 681 ${h.end_form()}
682 682 </li>
683 683 </ol>
684 684 </div>
685 685 %endif
686 686 </div>
687 687 </div>
688 688
689 689 % endif
690 690 </li>
691 691 </%def>
692 692
693 693 <%def name="menu_items(active=None)">
694 694
695 695 <ul id="quick" class="main_nav navigation horizontal-list">
696 696 ## notice box for important system messages
697 697 <li style="display: none">
698 698 <a class="notice-box" href="#openNotice" onclick="return false">
699 699 <div class="menulabel-notice" >
700 700 0
701 701 </div>
702 702 </a>
703 703 </li>
704 704
705 705 ## Main filter
706 706 <li>
707 707 <div class="menulabel main_filter_box">
708 708 <div class="main_filter_input_box">
709 709 <ul class="searchItems">
710 710
711 711 <li class="searchTag searchTagIcon">
712 712 <i class="icon-search"></i>
713 713 </li>
714 714
715 715 % if c.template_context['search_context']['repo_id']:
716 716 <li class="searchTag searchTagFilter searchTagHidable" >
717 717 ##<a href="${h.route_path('search_repo',repo_name=c.template_context['search_context']['repo_name'])}">
718 718 <span class="tag">
719 719 This repo
720 720 <a href="#removeGoToFilter" onclick="removeGoToFilter(); return false"><i class="icon-cancel-circled"></i></a>
721 721 </span>
722 722 ##</a>
723 723 </li>
724 724 % elif c.template_context['search_context']['repo_group_id']:
725 725 <li class="searchTag searchTagFilter searchTagHidable">
726 726 ##<a href="${h.route_path('search_repo_group',repo_group_name=c.template_context['search_context']['repo_group_name'])}">
727 727 <span class="tag">
728 728 This group
729 729 <a href="#removeGoToFilter" onclick="removeGoToFilter(); return false"><i class="icon-cancel-circled"></i></a>
730 730 </span>
731 731 ##</a>
732 732 </li>
733 733 % endif
734 734
735 735 <li class="searchTagInput">
736 736 <input class="main_filter_input" id="main_filter" size="25" type="text" name="main_filter" placeholder="${_('search / go to...')}" value="" />
737 737 </li>
738 738 <li class="searchTag searchTagHelp">
739 739 <a href="#showFilterHelp" onclick="showMainFilterBox(); return false">?</a>
740 740 </li>
741 741 </ul>
742 742 </div>
743 743 </div>
744 744
745 745 <div id="main_filter_help" style="display: none">
746 746 - Use '/' key to quickly access this field.
747 747
748 748 - Enter a name of repository, or repository group for quick search.
749 749
750 750 - Prefix query to allow special search:
751 751
752 752 user:admin, to search for usernames, always global
753 753
754 754 user_group:devops, to search for user groups, always global
755 755
756 756 commit:efced4, to search for commits, scoped to repositories or groups
757 757
758 758 file:models.py, to search for file paths, scoped to repositories or groups
759 759
760 760 % if c.template_context['search_context']['repo_id']:
761 761 For advanced full text search visit: <a href="${h.route_path('search_repo',repo_name=c.template_context['search_context']['repo_name'])}">repository search</a>
762 762 % elif c.template_context['search_context']['repo_group_id']:
763 763 For advanced full text search visit: <a href="${h.route_path('search_repo_group',repo_group_name=c.template_context['search_context']['repo_group_name'])}">repository group search</a>
764 764 % else:
765 765 For advanced full text search visit: <a href="${h.route_path('search')}">global search</a>
766 766 % endif
767 767 </div>
768 768 </li>
769 769
770 770 ## ROOT MENU
771 771 <li class="${h.is_active('home', active)}">
772 772 <a class="menulink" title="${_('Home')}" href="${h.route_path('home')}">
773 773 <div class="menulabel">${_('Home')}</div>
774 774 </a>
775 775 </li>
776 776
777 777 %if c.rhodecode_user.username != h.DEFAULT_USER:
778 778 <li class="${h.is_active('journal', active)}">
779 779 <a class="menulink" title="${_('Show activity journal')}" href="${h.route_path('journal')}">
780 780 <div class="menulabel">${_('Journal')}</div>
781 781 </a>
782 782 </li>
783 783 %else:
784 784 <li class="${h.is_active('journal', active)}">
785 785 <a class="menulink" title="${_('Show Public activity journal')}" href="${h.route_path('journal_public')}">
786 786 <div class="menulabel">${_('Public journal')}</div>
787 787 </a>
788 788 </li>
789 789 %endif
790 790
791 791 <li class="${h.is_active('gists', active)}">
792 792 <a class="menulink childs" title="${_('Show Gists')}" href="${h.route_path('gists_show')}">
793 793 <div class="menulabel">${_('Gists')}</div>
794 794 </a>
795 795 </li>
796 796
797 797 % if c.is_super_admin or c.is_delegated_admin:
798 798 <li class="${h.is_active('admin', active)}">
799 799 <a class="menulink childs" title="${_('Admin settings')}" href="${h.route_path('admin_home')}">
800 800 <div class="menulabel">${_('Admin')} </div>
801 801 </a>
802 802 </li>
803 803 % endif
804 804
805 805 ## render extra user menu
806 806 ${usermenu(active=(active=='my_account'))}
807 807
808 808 </ul>
809 809
810 810 <script type="text/javascript">
811 811 var visualShowPublicIcon = "${c.visual.show_public_icon}" == "True";
812 812
813 813 var formatRepoResult = function(result, container, query, escapeMarkup) {
814 814 return function(data, escapeMarkup) {
815 815 if (!data.repo_id){
816 816 return data.text; // optgroup text Repositories
817 817 }
818 818
819 819 var tmpl = '';
820 820 var repoType = data['repo_type'];
821 821 var repoName = data['text'];
822 822
823 823 if(data && data.type == 'repo'){
824 824 if(repoType === 'hg'){
825 825 tmpl += '<i class="icon-hg"></i> ';
826 826 }
827 827 else if(repoType === 'git'){
828 828 tmpl += '<i class="icon-git"></i> ';
829 829 }
830 830 else if(repoType === 'svn'){
831 831 tmpl += '<i class="icon-svn"></i> ';
832 832 }
833 833 if(data['private']){
834 834 tmpl += '<i class="icon-lock" ></i> ';
835 835 }
836 836 else if(visualShowPublicIcon){
837 837 tmpl += '<i class="icon-unlock-alt"></i> ';
838 838 }
839 839 }
840 840 tmpl += escapeMarkup(repoName);
841 841 return tmpl;
842 842
843 843 }(result, escapeMarkup);
844 844 };
845 845
846 846 var formatRepoGroupResult = function(result, container, query, escapeMarkup) {
847 847 return function(data, escapeMarkup) {
848 848 if (!data.repo_group_id){
849 849 return data.text; // optgroup text Repositories
850 850 }
851 851
852 852 var tmpl = '';
853 853 var repoGroupName = data['text'];
854 854
855 855 if(data){
856 856
857 857 tmpl += '<i class="icon-repo-group"></i> ';
858 858
859 859 }
860 860 tmpl += escapeMarkup(repoGroupName);
861 861 return tmpl;
862 862
863 863 }(result, escapeMarkup);
864 864 };
865 865
866 866 var escapeRegExChars = function (value) {
867 867 return value.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g, "\\$&");
868 868 };
869 869
870 870 var getRepoIcon = function(repo_type) {
871 871 if (repo_type === 'hg') {
872 872 return '<i class="icon-hg"></i> ';
873 873 }
874 874 else if (repo_type === 'git') {
875 875 return '<i class="icon-git"></i> ';
876 876 }
877 877 else if (repo_type === 'svn') {
878 878 return '<i class="icon-svn"></i> ';
879 879 }
880 880 return ''
881 881 };
882 882
883 883 var autocompleteMainFilterFormatResult = function (data, value, org_formatter) {
884 884
885 885 if (value.split(':').length === 2) {
886 886 value = value.split(':')[1]
887 887 }
888 888
889 889 var searchType = data['type'];
890 890 var searchSubType = data['subtype'];
891 891 var valueDisplay = data['value_display'];
892 892 var valueIcon = data['value_icon'];
893 893
894 894 var pattern = '(' + escapeRegExChars(value) + ')';
895 895
896 896 valueDisplay = Select2.util.escapeMarkup(valueDisplay);
897 897
898 898 // highlight match
899 899 if (searchType != 'text') {
900 900 valueDisplay = valueDisplay.replace(new RegExp(pattern, 'gi'), '<strong>$1<\/strong>');
901 901 }
902 902
903 903 var icon = '';
904 904
905 905 if (searchType === 'hint') {
906 906 icon += '<i class="icon-repo-group"></i> ';
907 907 }
908 908 // full text search/hints
909 909 else if (searchType === 'search') {
910 910 if (valueIcon === undefined) {
911 911 icon += '<i class="icon-more"></i> ';
912 912 } else {
913 913 icon += valueIcon + ' ';
914 914 }
915 915
916 916 if (searchSubType !== undefined && searchSubType == 'repo') {
917 917 valueDisplay += '<div class="pull-right tag">repository</div>';
918 918 }
919 919 else if (searchSubType !== undefined && searchSubType == 'repo_group') {
920 920 valueDisplay += '<div class="pull-right tag">repo group</div>';
921 921 }
922 922 }
923 923 // repository
924 924 else if (searchType === 'repo') {
925 925
926 926 var repoIcon = getRepoIcon(data['repo_type']);
927 927 icon += repoIcon;
928 928
929 929 if (data['private']) {
930 930 icon += '<i class="icon-lock" ></i> ';
931 931 }
932 932 else if (visualShowPublicIcon) {
933 933 icon += '<i class="icon-unlock-alt"></i> ';
934 934 }
935 935 }
936 936 // repository groups
937 937 else if (searchType === 'repo_group') {
938 938 icon += '<i class="icon-repo-group"></i> ';
939 939 }
940 940 // user group
941 941 else if (searchType === 'user_group') {
942 942 icon += '<i class="icon-group"></i> ';
943 943 }
944 944 // user
945 945 else if (searchType === 'user') {
946 946 icon += '<img class="gravatar" src="{0}"/>'.format(data['icon_link']);
947 947 }
948 948 // commit
949 949 else if (searchType === 'commit') {
950 950 var repo_data = data['repo_data'];
951 951 var repoIcon = getRepoIcon(repo_data['repository_type']);
952 952 if (repoIcon) {
953 953 icon += repoIcon;
954 954 } else {
955 955 icon += '<i class="icon-tag"></i>';
956 956 }
957 957 }
958 958 // file
959 959 else if (searchType === 'file') {
960 960 var repo_data = data['repo_data'];
961 961 var repoIcon = getRepoIcon(repo_data['repository_type']);
962 962 if (repoIcon) {
963 963 icon += repoIcon;
964 964 } else {
965 965 icon += '<i class="icon-tag"></i>';
966 966 }
967 967 }
968 968 // generic text
969 969 else if (searchType === 'text') {
970 970 icon = '';
971 971 }
972 972
973 973 var tmpl = '<div class="ac-container-wrap">{0}{1}</div>';
974 974 return tmpl.format(icon, valueDisplay);
975 975 };
976 976
977 977 var handleSelect = function(element, suggestion) {
978 978 if (suggestion.type === "hint") {
979 979 // we skip action
980 980 $('#main_filter').focus();
981 981 }
982 982 else if (suggestion.type === "text") {
983 983 // we skip action
984 984 $('#main_filter').focus();
985 985
986 986 } else {
987 987 window.location = suggestion['url'];
988 988 }
989 989 };
990 990
991 991 var autocompleteMainFilterResult = function (suggestion, originalQuery, queryLowerCase) {
992 992 if (queryLowerCase.split(':').length === 2) {
993 993 queryLowerCase = queryLowerCase.split(':')[1]
994 994 }
995 995 if (suggestion.type === "text") {
996 996 // special case we don't want to "skip" display for
997 997 return true
998 998 }
999 999 return suggestion.value_display.toLowerCase().indexOf(queryLowerCase) !== -1;
1000 1000 };
1001 1001
1002 1002 var cleanContext = {
1003 1003 repo_view_type: null,
1004 1004
1005 1005 repo_id: null,
1006 1006 repo_name: "",
1007 1007
1008 1008 repo_group_id: null,
1009 1009 repo_group_name: null
1010 1010 };
1011 1011 var removeGoToFilter = function () {
1012 1012 $('.searchTagHidable').hide();
1013 1013 $('#main_filter').autocomplete(
1014 1014 'setOptions', {params:{search_context: cleanContext}});
1015 1015 };
1016 1016
1017 1017 $('#main_filter').autocomplete({
1018 1018 serviceUrl: pyroutes.url('goto_switcher_data'),
1019 1019 params: {
1020 1020 "search_context": templateContext.search_context
1021 1021 },
1022 1022 minChars:2,
1023 1023 maxHeight:400,
1024 1024 deferRequestBy: 300, //miliseconds
1025 1025 tabDisabled: true,
1026 1026 autoSelectFirst: false,
1027 1027 containerClass: 'autocomplete-qfilter-suggestions',
1028 1028 formatResult: autocompleteMainFilterFormatResult,
1029 1029 lookupFilter: autocompleteMainFilterResult,
1030 1030 onSelect: function (element, suggestion) {
1031 1031 handleSelect(element, suggestion);
1032 1032 return false;
1033 1033 },
1034 1034 onSearchError: function (element, query, jqXHR, textStatus, errorThrown) {
1035 1035 if (jqXHR !== 'abort') {
1036 1036 alert("Error during search.\nError code: {0}".format(textStatus));
1037 1037 window.location = '';
1038 1038 }
1039 1039 },
1040 1040 onSearchStart: function (params) {
1041 1041 $('.searchTag.searchTagIcon').html('<i class="icon-spin animate-spin"></i>')
1042 1042 },
1043 1043 onSearchComplete: function (query, suggestions) {
1044 1044 $('.searchTag.searchTagIcon').html('<i class="icon-search"></i>')
1045 1045 },
1046 1046 });
1047 1047
1048 1048 showMainFilterBox = function () {
1049 1049 $('#main_filter_help').toggle();
1050 1050 };
1051 1051
1052 1052 $('#main_filter').on('keydown.autocomplete', function (e) {
1053 1053
1054 1054 var BACKSPACE = 8;
1055 1055 var el = $(e.currentTarget);
1056 1056 if(e.which === BACKSPACE){
1057 1057 var inputVal = el.val();
1058 1058 if (inputVal === ""){
1059 1059 removeGoToFilter()
1060 1060 }
1061 1061 }
1062 1062 });
1063 1063
1064 1064 </script>
1065 1065 <script src="${h.asset('js/rhodecode/base/keyboard-bindings.js', ver=c.rhodecode_version_hash)}"></script>
1066 1066 </%def>
1067 1067
1068 1068 <div class="modal" id="help_kb" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
1069 1069 <div class="modal-dialog">
1070 1070 <div class="modal-content">
1071 1071 <div class="modal-header">
1072 1072 <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
1073 1073 <h4 class="modal-title" id="myModalLabel">${_('Keyboard shortcuts')}</h4>
1074 1074 </div>
1075 1075 <div class="modal-body">
1076 1076 <div class="block-left">
1077 1077 <table class="keyboard-mappings">
1078 1078 <tbody>
1079 1079 <tr>
1080 1080 <th></th>
1081 1081 <th>${_('Site-wide shortcuts')}</th>
1082 1082 </tr>
1083 1083 <%
1084 1084 elems = [
1085 1085 ('/', 'Use quick search box'),
1086 1086 ('g h', 'Goto home page'),
1087 1087 ('g g', 'Goto my private gists page'),
1088 1088 ('g G', 'Goto my public gists page'),
1089 1089 ('g 0-9', 'Goto bookmarked items from 0-9'),
1090 1090 ('n r', 'New repository page'),
1091 1091 ('n g', 'New gist page'),
1092 1092 ]
1093 1093 %>
1094 1094 %for key, desc in elems:
1095 1095 <tr>
1096 1096 <td class="keys">
1097 1097 <span class="key tag">${key}</span>
1098 1098 </td>
1099 1099 <td>${desc}</td>
1100 1100 </tr>
1101 1101 %endfor
1102 1102 </tbody>
1103 1103 </table>
1104 1104 </div>
1105 1105 <div class="block-left">
1106 1106 <table class="keyboard-mappings">
1107 1107 <tbody>
1108 1108 <tr>
1109 1109 <th></th>
1110 1110 <th>${_('Repositories')}</th>
1111 1111 </tr>
1112 1112 <%
1113 1113 elems = [
1114 1114 ('g s', 'Goto summary page'),
1115 1115 ('g c', 'Goto changelog page'),
1116 1116 ('g f', 'Goto files page'),
1117 1117 ('g F', 'Goto files page with file search activated'),
1118 1118 ('g p', 'Goto pull requests page'),
1119 1119 ('g o', 'Goto repository settings'),
1120 1120 ('g O', 'Goto repository access permissions settings'),
1121 1121 ]
1122 1122 %>
1123 1123 %for key, desc in elems:
1124 1124 <tr>
1125 1125 <td class="keys">
1126 1126 <span class="key tag">${key}</span>
1127 1127 </td>
1128 1128 <td>${desc}</td>
1129 1129 </tr>
1130 1130 %endfor
1131 1131 </tbody>
1132 1132 </table>
1133 1133 </div>
1134 1134 </div>
1135 1135 <div class="modal-footer">
1136 1136 </div>
1137 1137 </div><!-- /.modal-content -->
1138 1138 </div><!-- /.modal-dialog -->
1139 1139 </div><!-- /.modal -->
@@ -1,372 +1,372 b''
1 1 ## snippet for displaying permissions overview for users
2 2 ## usage:
3 3 ## <%namespace name="p" file="/base/perms_summary.mako"/>
4 4 ## ${p.perms_summary(c.perm_user.permissions)}
5 5
6 6 <%def name="perms_summary(permissions, show_all=False, actions=True, side_link=None)">
7 7 <% section_to_label = {
8 8 'global': 'Global Permissions',
9 9 'repository_branches': 'Repository Branch Rules',
10 10 'repositories': 'Repository Access Permissions',
11 11 'user_groups': 'User Group Permissions',
12 12 'repositories_groups': 'Repository Group Permissions',
13 13 } %>
14 14
15 15 <div id="perms" class="table fields">
16 16 %for section in sorted(permissions.keys(), key=lambda item: {'global': 0, 'repository_branches': 1}.get(item, 1000)):
17 17 <% total_counter = 0 %>
18 18
19 19 <div class="panel panel-default">
20 20 <div class="panel-heading" id="${section.replace("_","-")}-permissions">
21 21 <h3 class="panel-title">${section_to_label.get(section, section)} - <span id="total_count_${section}"></span>
22 22 <a class="permalink" href="#${section.replace("_","-")}-permissions"> ΒΆ</a>
23 23 </h3>
24 24 % if side_link:
25 25 <div class="pull-right">
26 26 <a href="${side_link}">${_('in JSON format')}</a>
27 27 </div>
28 28 % endif
29 29 </div>
30 30 <div class="panel-body">
31 31 <div class="perms_section_head field">
32 32 <div class="radios">
33 33 % if section == 'repository_branches':
34 34 <span class="permissions_boxes">
35 35 <span class="desc">${_('show')}: </span>
36 36 ${h.checkbox('perms_filter_none_%s' % section, 'none', 'checked', class_='perm_filter filter_%s' % section, section=section, perm_type='none')} <label for="${'perms_filter_none_{}'.format(section)}"><span class="perm_tag none">${_('none')}</span></label>
37 37 ${h.checkbox('perms_filter_merge_%s' % section, 'merge', 'checked', class_='perm_filter filter_%s' % section, section=section, perm_type='merge')} <label for="${'perms_filter_merge_{}'.format(section)}"><span class="perm_tag merge">${_('merge')}</span></label>
38 38 ${h.checkbox('perms_filter_push_%s' % section, 'push', 'checked', class_='perm_filter filter_%s' % section, section=section, perm_type='push')} <label for="${'perms_filter_push_{}'.format(section)}"> <span class="perm_tag push">${_('push')}</span></label>
39 39 ${h.checkbox('perms_filter_push_force_%s' % section, 'push_force', 'checked', class_='perm_filter filter_%s' % section, section=section, perm_type='push_force')} <label for="${'perms_filter_push_force_{}'.format(section)}"><span class="perm_tag push_force">${_('push force')}</span></label>
40 40 </span>
41 41 % elif section != 'global':
42 42 <span class="permissions_boxes">
43 43 <span class="desc">${_('show')}: </span>
44 44 ${h.checkbox('perms_filter_none_%s' % section, 'none', '', class_='perm_filter filter_%s' % section, section=section, perm_type='none')} <label for="${'perms_filter_none_{}'.format(section)}"><span class="perm_tag none">${_('none')}</span></label>
45 45 ${h.checkbox('perms_filter_read_%s' % section, 'read', 'checked', class_='perm_filter filter_%s' % section, section=section, perm_type='read')} <label for="${'perms_filter_read_{}'.format(section)}"><span class="perm_tag read">${_('read')}</span></label>
46 46 ${h.checkbox('perms_filter_write_%s' % section, 'write', 'checked', class_='perm_filter filter_%s' % section, section=section, perm_type='write')} <label for="${'perms_filter_write_{}'.format(section)}"> <span class="perm_tag write">${_('write')}</span></label>
47 47 ${h.checkbox('perms_filter_admin_%s' % section, 'admin', 'checked', class_='perm_filter filter_%s' % section, section=section, perm_type='admin')} <label for="${'perms_filter_admin_{}'.format(section)}"><span class="perm_tag admin">${_('admin')}</span></label>
48 48 </span>
49 49 % endif
50 50
51 51 </div>
52 52 </div>
53 53 <div class="field">
54 54 %if not permissions[section]:
55 55 <p class="empty_data help-block">${_('No permissions defined')}</p>
56 56 %else:
57 57 <div id='tbl_list_wrap_${section}'>
58 58 <table id="tbl_list_${section}" class="rctable">
59 59 ## global permission box
60 60 %if section == 'global':
61 61 <thead>
62 62 <tr>
63 63 <th colspan="2" class="left">${_('Permission')}</th>
64 64 %if actions:
65 65 <th colspan="2">${_('Edit Permission')}</th>
66 66 %endif
67 67 </thead>
68 68 <tbody>
69 69
70 70 <%
71 71 def get_section_perms(prefix, opts):
72 72 _selected = []
73 73 for op in opts:
74 74 if op.startswith(prefix) and not op.startswith('hg.create.write_on_repogroup'):
75 75 _selected.append(op)
76 76 admin = 'hg.admin' in opts
77 77 _selected_vals = [x.partition(prefix)[-1] for x in _selected]
78 78 return admin, _selected_vals, _selected
79 79 %>
80 80
81 81 <%def name="glob(lbl, val, val_lbl=None, edit_url=None, edit_global_url=None)">
82 82 <tr>
83 83 <td class="td-tags">
84 84 ${lbl}
85 85 </td>
86 86 <td class="td-tags">
87 87 %if val[0]:
88 88 %if not val_lbl:
89 ## super admin case
89 ## super-admin case
90 90 True
91 91 %else:
92 92 <span class="perm_tag admin">${val_lbl}.admin</span>
93 93 %endif
94 94 %else:
95 95 %if not val_lbl:
96 96 ${{'false': False,
97 97 'true': True,
98 98 'none': False,
99 99 'repository': True}.get(val[1][0] if 0 < len(val[1]) else 'false')}
100 100 %else:
101 101 <span class="perm_tag ${val[1][0]}">${val_lbl}.${val[1][0]}</span>
102 102 %endif
103 103 %endif
104 104 </td>
105 105 %if actions:
106 106
107 107 % if edit_url or edit_global_url:
108 108
109 109 <td class="td-action">
110 110 % if edit_url:
111 111 <a href="${edit_url}">${_('edit')}</a>
112 112 % else:
113 113 -
114 114 % endif
115 115 </td>
116 116
117 117 <td class="td-action">
118 118 % if edit_global_url:
119 119 <a href="${edit_global_url}">${_('edit global')}</a>
120 120 % else:
121 121 -
122 122 % endif
123 123 </td>
124 124
125 125 % else:
126 126 <td class="td-action"></td>
127 127 <td class="td-action">
128 128 <a href="${h.route_path('admin_permissions_global')}">${_('edit global')}</a>
129 129 <td class="td-action">
130 130 % endif
131 131
132 132 %endif
133 133 </tr>
134 134 </%def>
135 135
136 136 ${glob(_('Repository default permission'), get_section_perms('repository.', permissions[section]), 'repository',
137 137 edit_url=None, edit_global_url=h.route_path('admin_permissions_object'))}
138 138
139 139 ${glob(_('Repository group default permission'), get_section_perms('group.', permissions[section]), 'group',
140 140 edit_url=None, edit_global_url=h.route_path('admin_permissions_object'))}
141 141
142 142 ${glob(_('User group default permission'), get_section_perms('usergroup.', permissions[section]), 'usergroup',
143 143 edit_url=None, edit_global_url=h.route_path('admin_permissions_object'))}
144 144
145 ${glob(_('Super admin'), get_section_perms('hg.admin', permissions[section]),
145 ${glob(_('Super-admin'), get_section_perms('hg.admin', permissions[section]),
146 146 edit_url=h.route_path('user_edit', user_id=c.user.user_id, _anchor='admin'), edit_global_url=None)}
147 147
148 148 ${glob(_('Inherit permissions'), get_section_perms('hg.inherit_default_perms.', permissions[section]),
149 149 edit_url=h.route_path('user_edit_global_perms', user_id=c.user.user_id), edit_global_url=None)}
150 150
151 151 ${glob(_('Create repositories'), get_section_perms('hg.create.', permissions[section]),
152 152 edit_url=h.route_path('user_edit_global_perms', user_id=c.user.user_id), edit_global_url=h.route_path('admin_permissions_object'))}
153 153
154 154 ${glob(_('Fork repositories'), get_section_perms('hg.fork.', permissions[section]),
155 155 edit_url=h.route_path('user_edit_global_perms', user_id=c.user.user_id), edit_global_url=h.route_path('admin_permissions_object'))}
156 156
157 157 ${glob(_('Create repository groups'), get_section_perms('hg.repogroup.create.', permissions[section]),
158 158 edit_url=h.route_path('user_edit_global_perms', user_id=c.user.user_id), edit_global_url=h.route_path('admin_permissions_object'))}
159 159
160 160 ${glob(_('Create user groups'), get_section_perms('hg.usergroup.create.', permissions[section]),
161 161 edit_url=h.route_path('user_edit_global_perms', user_id=c.user.user_id), edit_global_url=h.route_path('admin_permissions_object'))}
162 162
163 163 </tbody>
164 164 ## Branch perms
165 165 %elif section == 'repository_branches':
166 166 <thead>
167 167 <tr>
168 168 <th>${_('Name')}</th>
169 169 <th>${_('Pattern')}</th>
170 170 <th>${_('Permission')}</th>
171 171 %if actions:
172 172 <th>${_('Edit Branch Permission')}</th>
173 173 %endif
174 174 </thead>
175 175 <tbody class="section_${section}">
176 176 <%
177 177 def name_sorter(permissions):
178 178 def custom_sorter(item):
179 179 return item[0]
180 180 return sorted(permissions, key=custom_sorter)
181 181
182 182 def branch_sorter(permissions):
183 183 def custom_sorter(item):
184 184 ## none, merge, push, push_force
185 185 section = item[1].split('.')[-1]
186 186 section_importance = {'none': u'0',
187 187 'merge': u'1',
188 188 'push': u'2',
189 189 'push_force': u'3'}.get(section)
190 190 ## sort by importance + name
191 191 return section_importance + item[0]
192 192 return sorted(permissions, key=custom_sorter)
193 193 %>
194 194 %for k, section_perms in name_sorter(permissions[section].items()):
195 195 ## for display purposes, for non super-admins we need to check if shown
196 196 ## repository is actually accessible for user
197 197 <% repo_perm = permissions['repositories'][k] %>
198 198 % if repo_perm == 'repository.none' and not c.rhodecode_user.is_admin:
199 199 ## skip this entry
200 200 <% continue %>
201 201 % endif
202 202
203 203 <% total_counter +=1 %>
204 204 % for pattern, perm in branch_sorter(section_perms.items()):
205 205 <tr class="perm_row ${'{}_{}'.format(section, perm.split('.')[-1])}">
206 206 <td class="td-name">
207 207 <a href="${h.route_path('repo_summary',repo_name=k)}">${k}</a>
208 208 </td>
209 209 <td>${pattern}</td>
210 210 <td class="td-tags">
211 211 ## TODO: calculate origin somehow
212 212 ## % for i, ((_pat, perm), origin) in enumerate((permissions[section].perm_origin_stack[k])):
213 213
214 214 <div>
215 215 <% i = 0 %>
216 216 <% origin = 'unknown' %>
217 217 <% _css_class = i > 0 and 'perm_overriden' or '' %>
218 218
219 219 <span class="${_css_class} perm_tag ${perm.split('.')[-1]}">
220 220 ${perm}
221 221 ##(${origin})
222 222 </span>
223 223 </div>
224 224 ## % endfor
225 225 </td>
226 226 %if actions:
227 227 <td class="td-action">
228 228 <a href="${h.route_path('edit_repo_perms_branch',repo_name=k)}">${_('edit')}</a>
229 229 </td>
230 230 %endif
231 231 </tr>
232 232 % endfor
233 233 %endfor
234 234 </tbody>
235 235
236 236 ## Repos/Repo Groups/users groups perms
237 237 %else:
238 238
239 239 ## none/read/write/admin permissions on groups/repos etc
240 240 <thead>
241 241 <tr>
242 242 <th>${_('Name')}</th>
243 243 <th>${_('Permission')}</th>
244 244 %if actions:
245 245 <th>${_('Edit Permission')}</th>
246 246 %endif
247 247 </thead>
248 248 <tbody class="section_${section}">
249 249 <%
250 250 def sorter(permissions):
251 251 def custom_sorter(item):
252 252 ## read/write/admin
253 253 section = item[1].split('.')[-1]
254 254 section_importance = {'none': u'0',
255 255 'read': u'1',
256 256 'write':u'2',
257 257 'admin':u'3'}.get(section)
258 258 ## sort by group importance+name
259 259 return section_importance+item[0]
260 260 return sorted(permissions, key=custom_sorter)
261 261 %>
262 262 %for k, section_perm in sorter(permissions[section].items()):
263 263 <% perm_value = section_perm.split('.')[-1] %>
264 264 <% _css_class = 'display:none' if perm_value in ['none'] else '' %>
265 265
266 266 %if perm_value != 'none' or show_all:
267 267 <tr class="perm_row ${'{}_{}'.format(section, section_perm.split('.')[-1])}" style="${_css_class}">
268 268 <td class="td-name">
269 269 %if section == 'repositories':
270 270 <a href="${h.route_path('repo_summary',repo_name=k)}">${k}</a>
271 271 %elif section == 'repositories_groups':
272 272 <a href="${h.route_path('repo_group_home', repo_group_name=k)}">${k}</a>
273 273 %elif section == 'user_groups':
274 274 ##<a href="${h.route_path('edit_user_group',user_group_id=k)}">${k}</a>
275 275 ${k}
276 276 %endif
277 277 </td>
278 278 <td class="td-tags">
279 279 %if hasattr(permissions[section], 'perm_origin_stack'):
280 280 <div>
281 281 %for i, (perm, origin) in enumerate(reversed(permissions[section].perm_origin_stack[k])):
282 282 <% _css_class = i > 0 and 'perm_overriden' or '' %>
283 283 % if i > 0:
284 284 <div style="color: #979797">
285 285 <i class="icon-arrow_up"></i>
286 286 ${_('overridden by')}
287 287 <i class="icon-arrow_up"></i>
288 288 </div>
289 289 % endif
290 290
291 291 <div>
292 292 <span class="${_css_class} perm_tag ${perm.split('.')[-1]}">
293 293 ${perm} (${origin})
294 294 </span>
295 295 </div>
296 296
297 297 %endfor
298 298 </div>
299 299 %else:
300 300 <span class="perm_tag ${section_perm.split('.')[-1]}">${section_perm}</span>
301 301 %endif
302 302 </td>
303 303 %if actions:
304 304 <td class="td-action">
305 305 %if section == 'repositories':
306 306 <a href="${h.route_path('edit_repo_perms',repo_name=k,_anchor='permissions_manage')}">${_('edit')}</a>
307 307 %elif section == 'repositories_groups':
308 308 <a href="${h.route_path('edit_repo_group_perms',repo_group_name=k,_anchor='permissions_manage')}">${_('edit')}</a>
309 309 %elif section == 'user_groups':
310 310 ##<a href="${h.route_path('edit_user_group',user_group_id=k)}">${_('edit')}</a>
311 311 %endif
312 312 </td>
313 313 %endif
314 314 </tr>
315 315 <% total_counter +=1 %>
316 316 %endif
317 317
318 318 %endfor
319 319
320 320 <tr id="empty_${section}" class="noborder" style="display:none;">
321 321 <td colspan="6">${_('No matching permission defined')}</td>
322 322 </tr>
323 323
324 324 </tbody>
325 325 %endif
326 326 </table>
327 327 </div>
328 328 %endif
329 329 </div>
330 330 </div>
331 331 </div>
332 332
333 333 <script>
334 334 $('#total_count_${section}').html(${total_counter})
335 335 </script>
336 336
337 337 %endfor
338 338 </div>
339 339
340 340 <script>
341 341 $(document).ready(function(){
342 342 var showEmpty = function(section){
343 343 var visible = $('.section_{0} tr.perm_row:visible'.format(section)).length;
344 344 if(visible === 0){
345 345 $('#empty_{0}'.format(section)).show();
346 346 }
347 347 else{
348 348 $('#empty_{0}'.format(section)).hide();
349 349 }
350 350 };
351 351
352 352 $('.perm_filter').on('change', function(e){
353 353 var self = this;
354 354 var section = $(this).attr('section');
355 355
356 356 var opts = {};
357 357 var elems = $('.filter_' + section).each(function(el){
358 358 var perm_type = $(this).attr('perm_type');
359 359 var checked = this.checked;
360 360 opts[perm_type] = checked;
361 361 if(checked){
362 362 $('.'+section+'_'+perm_type).show();
363 363 }
364 364 else{
365 365 $('.'+section+'_'+perm_type).hide();
366 366 }
367 367 });
368 368 showEmpty(section);
369 369 })
370 370 })
371 371 </script>
372 372 </%def>
@@ -1,93 +1,93 b''
1 1 ## -*- coding: utf-8 -*-
2 2 <!DOCTYPE html>
3 3 <html xmlns="http://www.w3.org/1999/xhtml">
4 4 <head>
5 5 <title>Error - ${c.error_message}</title>
6 6 <meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
7 7 <meta name="robots" content="index, nofollow"/>
8 8
9 9 <meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
10 10 %if c.redirect_time:
11 11 <meta http-equiv="refresh" content="${c.redirect_time}; url=${c.url_redirect}"/>
12 12 %endif
13 13
14 14 <link id="favicon" rel="shortcut icon" type="image/png" href="data:image/png;base64,AAABAAIAEBAAAAEAIABoBAAAJgAAACAgAAABACAAqBAAAI4EAAAoAAAAEAAAACAAAAABACAAAAAAAAAAAAAAAAAAAAA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QxMTGDNjY2qzMzM88zMzP1MzMz/zMzM/8zMzP/MzMz/zMzM/8zMzP/MzMz6TMzM5wzMzM/MzMzADMzMwAzMzMAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAMgAAAHQAAACvAAAA5QAAAP8AAAD/AAAA/wAAAP8AAAD/AgIC/zExMf82Njb/MzMz/zMzM/8zMzP/MzMz/zMzM+UzMzOvMzMzdjMzMzQzMzMAMzMzADMzMwAzMzMAMzMzADMzMwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAIgAAAFEAAAB7AAAAowAAAMYCAgLqMTEx6zY2NsczMzOkMzMzfDMzM1EzMzMjMzMzADMzMwAzMzMAMzMzADMzMwAzMzMAMzMzADMzMwAzMzMAMzMzAP/+f////D////gf///wD///4Af//8AD//+AAf//AAD//gAAf/wAAD/8AAA/+AAAH/AAAY/wAA/P4AA/x+AA/+fAA//jwA//88Af//OAP5FxgP+FcYH/jHkB/5T4A/+N+Af///iP///5j///8YP//8HAP/wD8AAAD/8AAP//+B//">
15 15 <script src="${h.asset('js/vendors/webcomponentsjs/custom-elements-es5-adapter.js', ver=c.rhodecode_version_hash)}"></script>
16 16 <script src="${h.asset('js/vendors/webcomponentsjs/webcomponents-bundle.js', ver=c.rhodecode_version_hash)}"></script>
17 17
18 18 <link rel="stylesheet" type="text/css" href="${h.asset('css/style.css', ver=c.rhodecode_version_hash)}" media="screen"/>
19 19 <style>body { background:#eeeeee; }</style>
20 20 <script type="text/javascript">
21 21 // register templateContext to pass template variables to JS
22 22 var templateContext = {timeago: {}};
23 23 </script>
24 24 <script type="text/javascript" src="${h.asset('js/scripts.min.js', ver=c.rhodecode_version_hash)}"></script>
25 25 </head>
26 26 <body>
27 27
28 28 <div class="wrapper error_page">
29 29 <div class="sidebar">
30 30 <a href="${h.route_path('home')}"><img class="error-page-logo" src="${h.asset('images/RhodeCode_Logo_Black.png')}" alt="RhodeCode"/></a>
31 31 </div>
32 32 <div class="main-content">
33 33 <h1>
34 34 <span class="error-branding">
35 35 ${h.branding(c.rhodecode_name)}
36 36 </span><br/>
37 37 ${c.error_message}
38 38 <br/>
39 39 <span class="error_message">${c.error_explanation}</span>
40 40 </h1>
41 41 % if c.messages:
42 42 % for message in c.messages:
43 43 <div class="alert alert-${message.category}">${message}</div>
44 44 % endfor
45 45 % endif
46 46 %if c.redirect_time:
47 47 <p>${_('You will be redirected to %s in %s seconds') % (c.redirect_module,c.redirect_time)}</p>
48 48 %endif
49 49 <div class="inner-column">
50 50 <h4>Possible Causes</h4>
51 51 <ul>
52 52 % if c.causes:
53 53 %for cause in c.causes:
54 54 <li>${cause}</li>
55 55 %endfor
56 56 %else:
57 57 <li>The resource may have been deleted.</li>
58 58 <li>You may not have access to this repository.</li>
59 59 <li>The link may be incorrect.</li>
60 60 %endif
61 61 </ul>
62 62 </div>
63 63 <div class="inner-column">
64 64 <h4>Support</h4>
65 65 <p>For help and support, go to the <a href="${c.visual.rhodecode_support_url}" target="_blank">${_('Support Page')}</a>.
66 66 It may be useful to include your log file; see the log file locations <a href="${h.route_url('enterprise_log_file_locations')}">here</a>.
67 67 </p>
68 68
69 69 </div>
70 70 <div class="inner-column">
71 71 <h4>Documentation</h4>
72 72 <p>For more information, see <a href="${h.route_url('enterprise_docs')}">docs.rhodecode.com</a>.</p>
73 73 </div>
74 74 </div>
75 75
76 76 % if c.show_exception_id:
77 77 <div class="sidebar" style="width: 130px">
78 78
79 79 </div>
80 80 <div class="main-content">
81 81 <p>
82 82 <strong>Exception ID: <code><a href="${c.exception_id_url}">${c.exception_id}</a></code> </strong> <br/>
83 83
84 Super Admins can see detailed traceback information from this exception by checking the below Exception ID.<br/>
84 Super-admins can see detailed traceback information from this exception by checking the below Exception ID.<br/>
85 85 Please include the above link for further details of this exception.
86 86 </p>
87 87 </div>
88 88 % endif
89 89 </div>
90 90
91 91 </body>
92 92
93 93 </html>
General Comments 0
You need to be logged in to leave comments. Login now