##// END OF EJS Templates
repo-groups: make panel titles more consistent
marcink -
r3590:0be41339 new-ui
parent child Browse files
Show More
@@ -1,222 +1,222 b''
1 ## -*- coding: utf-8 -*-
1 ## -*- coding: utf-8 -*-
2 <%inherit file="base.mako"/>
2 <%inherit file="base.mako"/>
3
3
4 <%def name="breadcrumbs_links()">
4 <%def name="breadcrumbs_links()">
5 %if c.repo:
5 %if c.repo:
6 ${h.link_to('Settings',h.route_path('edit_repo', repo_name=c.repo.repo_name))}
6 ${h.link_to('Settings',h.route_path('edit_repo', repo_name=c.repo.repo_name))}
7 %elif c.repo_group:
7 %elif c.repo_group:
8 ${h.link_to(_('Admin'),h.route_path('admin_home'))}
8 ${h.link_to(_('Admin'),h.route_path('admin_home'))}
9 &raquo;
9 &raquo;
10 ${h.link_to(_('Repository Groups'),h.route_path('repo_groups'))}
10 ${h.link_to(_('Repository Groups'),h.route_path('repo_groups'))}
11 &raquo;
11 &raquo;
12 ${h.link_to(c.repo_group.group_name,h.route_path('edit_repo_group', repo_group_name=c.repo_group.group_name))}
12 ${h.link_to(c.repo_group.group_name,h.route_path('edit_repo_group', repo_group_name=c.repo_group.group_name))}
13 %else:
13 %else:
14 ${h.link_to(_('Admin'),h.route_path('admin_home'))}
14 ${h.link_to(_('Admin'),h.route_path('admin_home'))}
15 &raquo;
15 &raquo;
16 ${h.link_to(_('Settings'),h.route_path('admin_settings'))}
16 ${h.link_to(_('Settings'),h.route_path('admin_settings'))}
17 %endif
17 %endif
18 %if c.current_IntegrationType:
18 %if c.current_IntegrationType:
19 &raquo;
19 &raquo;
20 %if c.repo:
20 %if c.repo:
21 ${h.link_to(_('Integrations'),
21 ${h.link_to(_('Integrations'),
22 request.route_path(route_name='repo_integrations_home',
22 request.route_path(route_name='repo_integrations_home',
23 repo_name=c.repo.repo_name))}
23 repo_name=c.repo.repo_name))}
24 %elif c.repo_group:
24 %elif c.repo_group:
25 ${h.link_to(_('Integrations'),
25 ${h.link_to(_('Integrations'),
26 request.route_path(route_name='repo_group_integrations_home',
26 request.route_path(route_name='repo_group_integrations_home',
27 repo_group_name=c.repo_group.group_name))}
27 repo_group_name=c.repo_group.group_name))}
28 %else:
28 %else:
29 ${h.link_to(_('Integrations'),
29 ${h.link_to(_('Integrations'),
30 request.route_path(route_name='global_integrations_home'))}
30 request.route_path(route_name='global_integrations_home'))}
31 %endif
31 %endif
32 &raquo;
32 &raquo;
33 ${c.current_IntegrationType.display_name}
33 ${c.current_IntegrationType.display_name}
34 %else:
34 %else:
35 &raquo;
35 &raquo;
36 ${_('Integrations')}
36 ${_('Integrations')}
37 %endif
37 %endif
38 </%def>
38 </%def>
39
39
40 <div class="panel panel-default">
40 <div class="panel panel-default">
41 <div class="panel-heading">
41 <div class="panel-heading">
42 <h3 class="panel-title">
42 <h3 class="panel-title">
43 %if c.repo:
43 %if c.repo:
44 ${_('Current Integrations for Repository: {repo_name}').format(repo_name=c.repo.repo_name)}
44 ${_('Current Integrations for Repository: {repo_name}').format(repo_name=c.repo.repo_name)}
45 %elif c.repo_group:
45 %elif c.repo_group:
46 ${_('Current Integrations for repository group: {repo_group_name}').format(repo_group_name=c.repo_group.group_name)}
46 ${_('Repository Group Integrations: {}').format(c.repo_group.group_name)}</h3>
47 %else:
47 %else:
48 ${_('Current Integrations')}
48 ${_('Current Integrations')}
49 %endif
49 %endif
50 </h3>
50 </h3>
51 </div>
51 </div>
52 <div class="panel-body">
52 <div class="panel-body">
53
53
54 <%
54 <%
55 integration_type = c.current_IntegrationType and c.current_IntegrationType.display_name or ''
55 integration_type = c.current_IntegrationType and c.current_IntegrationType.display_name or ''
56
56
57 if c.repo:
57 if c.repo:
58 create_url = h.route_path('repo_integrations_new', repo_name=c.repo.repo_name)
58 create_url = h.route_path('repo_integrations_new', repo_name=c.repo.repo_name)
59 elif c.repo_group:
59 elif c.repo_group:
60 create_url = h.route_path('repo_group_integrations_new', repo_group_name=c.repo_group.group_name)
60 create_url = h.route_path('repo_group_integrations_new', repo_group_name=c.repo_group.group_name)
61 else:
61 else:
62 create_url = h.route_path('global_integrations_new')
62 create_url = h.route_path('global_integrations_new')
63 %>
63 %>
64 <p class="pull-right">
64 <p class="pull-right">
65 <a href="${create_url}" class="btn btn-small btn-success">${_(u'Create new integration')}</a>
65 <a href="${create_url}" class="btn btn-small btn-success">${_(u'Create new integration')}</a>
66 </p>
66 </p>
67
67
68 <table class="rctable integrations">
68 <table class="rctable integrations">
69 <thead>
69 <thead>
70 <tr>
70 <tr>
71 <th><a href="?sort=enabled:${c.rev_sort_dir}">${_('Enabled')}</a></th>
71 <th><a href="?sort=enabled:${c.rev_sort_dir}">${_('Enabled')}</a></th>
72 <th><a href="?sort=name:${c.rev_sort_dir}">${_('Name')}</a></th>
72 <th><a href="?sort=name:${c.rev_sort_dir}">${_('Name')}</a></th>
73 <th colspan="2"><a href="?sort=integration_type:${c.rev_sort_dir}">${_('Type')}</a></th>
73 <th colspan="2"><a href="?sort=integration_type:${c.rev_sort_dir}">${_('Type')}</a></th>
74 <th><a href="?sort=scope:${c.rev_sort_dir}">${_('Scope')}</a></th>
74 <th><a href="?sort=scope:${c.rev_sort_dir}">${_('Scope')}</a></th>
75 <th>${_('Actions')}</th>
75 <th>${_('Actions')}</th>
76 <th></th>
76 <th></th>
77 </tr>
77 </tr>
78 </thead>
78 </thead>
79 <tbody>
79 <tbody>
80 %if not c.integrations_list:
80 %if not c.integrations_list:
81 <tr>
81 <tr>
82 <td colspan="7">
82 <td colspan="7">
83
83
84 %if c.repo:
84 %if c.repo:
85 ${_('No {type} integrations for repo {repo} exist yet.').format(type=integration_type, repo=c.repo.repo_name)}
85 ${_('No {type} integrations for repo {repo} exist yet.').format(type=integration_type, repo=c.repo.repo_name)}
86 %elif c.repo_group:
86 %elif c.repo_group:
87 ${_('No {type} integrations for repogroup {repogroup} exist yet.').format(type=integration_type, repogroup=c.repo_group.group_name)}
87 ${_('No {type} integrations for repogroup {repogroup} exist yet.').format(type=integration_type, repogroup=c.repo_group.group_name)}
88 %else:
88 %else:
89 ${_('No {type} integrations exist yet.').format(type=integration_type)}
89 ${_('No {type} integrations exist yet.').format(type=integration_type)}
90 %endif
90 %endif
91
91
92 %if c.current_IntegrationType:
92 %if c.current_IntegrationType:
93 <%
93 <%
94 if c.repo:
94 if c.repo:
95 create_url = h.route_path('repo_integrations_create', repo_name=c.repo.repo_name, integration=c.current_IntegrationType.key)
95 create_url = h.route_path('repo_integrations_create', repo_name=c.repo.repo_name, integration=c.current_IntegrationType.key)
96 elif c.repo_group:
96 elif c.repo_group:
97 create_url = h.route_path('repo_group_integrations_create', repo_group_name=c.repo_group.group_name, integration=c.current_IntegrationType.key)
97 create_url = h.route_path('repo_group_integrations_create', repo_group_name=c.repo_group.group_name, integration=c.current_IntegrationType.key)
98 else:
98 else:
99 create_url = h.route_path('global_integrations_create', integration=c.current_IntegrationType.key)
99 create_url = h.route_path('global_integrations_create', integration=c.current_IntegrationType.key)
100 %>
100 %>
101 %endif
101 %endif
102
102
103 <a href="${create_url}">${_(u'Create one')}</a>
103 <a href="${create_url}">${_(u'Create one')}</a>
104 </td>
104 </td>
105 </tr>
105 </tr>
106 %endif
106 %endif
107 %for IntegrationType, integration in c.integrations_list:
107 %for IntegrationType, integration in c.integrations_list:
108 <tr id="integration_${integration.integration_id}">
108 <tr id="integration_${integration.integration_id}">
109 <td class="td-enabled">
109 <td class="td-enabled">
110 %if integration.enabled:
110 %if integration.enabled:
111 <div class="flag_status approved pull-left"></div>
111 <div class="flag_status approved pull-left"></div>
112 %else:
112 %else:
113 <div class="flag_status rejected pull-left"></div>
113 <div class="flag_status rejected pull-left"></div>
114 %endif
114 %endif
115 </td>
115 </td>
116 <td class="td-description">
116 <td class="td-description">
117 ${integration.name}
117 ${integration.name}
118 </td>
118 </td>
119 <td class="td-icon">
119 <td class="td-icon">
120 %if integration.integration_type in c.available_integrations:
120 %if integration.integration_type in c.available_integrations:
121 <div class="integration-icon">
121 <div class="integration-icon">
122 ${c.available_integrations[integration.integration_type].icon()|n}
122 ${c.available_integrations[integration.integration_type].icon()|n}
123 </div>
123 </div>
124 %else:
124 %else:
125 ?
125 ?
126 %endif
126 %endif
127 </td>
127 </td>
128 <td class="td-type">
128 <td class="td-type">
129 ${integration.integration_type}
129 ${integration.integration_type}
130 </td>
130 </td>
131 <td class="td-scope">
131 <td class="td-scope">
132 %if integration.repo:
132 %if integration.repo:
133 <a href="${h.route_path('repo_summary', repo_name=integration.repo.repo_name)}">
133 <a href="${h.route_path('repo_summary', repo_name=integration.repo.repo_name)}">
134 ${_('repo')}:${integration.repo.repo_name}
134 ${_('repo')}:${integration.repo.repo_name}
135 </a>
135 </a>
136 %elif integration.repo_group:
136 %elif integration.repo_group:
137 <a href="${h.route_path('repo_group_home', repo_group_name=integration.repo_group.group_name)}">
137 <a href="${h.route_path('repo_group_home', repo_group_name=integration.repo_group.group_name)}">
138 ${_('repogroup')}:${integration.repo_group.group_name}
138 ${_('repogroup')}:${integration.repo_group.group_name}
139 %if integration.child_repos_only:
139 %if integration.child_repos_only:
140 ${_('child repos only')}
140 ${_('child repos only')}
141 %else:
141 %else:
142 ${_('cascade to all')}
142 ${_('cascade to all')}
143 %endif
143 %endif
144 </a>
144 </a>
145 %else:
145 %else:
146 %if integration.child_repos_only:
146 %if integration.child_repos_only:
147 ${_('top level repos only')}
147 ${_('top level repos only')}
148 %else:
148 %else:
149 ${_('global')}
149 ${_('global')}
150 %endif
150 %endif
151 </td>
151 </td>
152 %endif
152 %endif
153 <td class="td-action">
153 <td class="td-action">
154 %if not IntegrationType:
154 %if not IntegrationType:
155 ${_('unknown integration')}
155 ${_('unknown integration')}
156 %else:
156 %else:
157 <%
157 <%
158 if c.repo:
158 if c.repo:
159 edit_url = request.route_path('repo_integrations_edit',
159 edit_url = request.route_path('repo_integrations_edit',
160 repo_name=c.repo.repo_name,
160 repo_name=c.repo.repo_name,
161 integration=integration.integration_type,
161 integration=integration.integration_type,
162 integration_id=integration.integration_id)
162 integration_id=integration.integration_id)
163 elif c.repo_group:
163 elif c.repo_group:
164 edit_url = request.route_path('repo_group_integrations_edit',
164 edit_url = request.route_path('repo_group_integrations_edit',
165 repo_group_name=c.repo_group.group_name,
165 repo_group_name=c.repo_group.group_name,
166 integration=integration.integration_type,
166 integration=integration.integration_type,
167 integration_id=integration.integration_id)
167 integration_id=integration.integration_id)
168 else:
168 else:
169 edit_url = request.route_path('global_integrations_edit',
169 edit_url = request.route_path('global_integrations_edit',
170 integration=integration.integration_type,
170 integration=integration.integration_type,
171 integration_id=integration.integration_id)
171 integration_id=integration.integration_id)
172 %>
172 %>
173 <div class="grid_edit">
173 <div class="grid_edit">
174 <a href="${edit_url}">${_('Edit')}</a>
174 <a href="${edit_url}">${_('Edit')}</a>
175 </div>
175 </div>
176 <div class="grid_delete">
176 <div class="grid_delete">
177 <a href="${edit_url}"
177 <a href="${edit_url}"
178 class="btn btn-link btn-danger delete_integration_entry"
178 class="btn btn-link btn-danger delete_integration_entry"
179 data-desc="${integration.name}"
179 data-desc="${integration.name}"
180 data-uid="${integration.integration_id}">
180 data-uid="${integration.integration_id}">
181 ${_('Delete')}
181 ${_('Delete')}
182 </a>
182 </a>
183 </div>
183 </div>
184 %endif
184 %endif
185 </td>
185 </td>
186 </tr>
186 </tr>
187 %endfor
187 %endfor
188 <tr id="last-row"></tr>
188 <tr id="last-row"></tr>
189 </tbody>
189 </tbody>
190 </table>
190 </table>
191 <div class="integrations-paginator">
191 <div class="integrations-paginator">
192 <div class="pagination-wh pagination-left">
192 <div class="pagination-wh pagination-left">
193 ${c.integrations_list.pager('$link_previous ~2~ $link_next')}
193 ${c.integrations_list.pager('$link_previous ~2~ $link_next')}
194 </div>
194 </div>
195 </div>
195 </div>
196 </div>
196 </div>
197 </div>
197 </div>
198 <script type="text/javascript">
198 <script type="text/javascript">
199 var delete_integration = function(entry) {
199 var delete_integration = function(entry) {
200 if (confirm("Confirm to remove this integration: "+$(entry).data('desc'))) {
200 if (confirm("Confirm to remove this integration: "+$(entry).data('desc'))) {
201 var request = $.ajax({
201 var request = $.ajax({
202 type: "POST",
202 type: "POST",
203 url: $(entry).attr('href'),
203 url: $(entry).attr('href'),
204 data: {
204 data: {
205 'delete': 'delete',
205 'delete': 'delete',
206 'csrf_token': CSRF_TOKEN
206 'csrf_token': CSRF_TOKEN
207 },
207 },
208 success: function(){
208 success: function(){
209 location.reload();
209 location.reload();
210 },
210 },
211 error: function(data, textStatus, errorThrown){
211 error: function(data, textStatus, errorThrown){
212 alert("Error while deleting entry.\nError code {0} ({1}). URL: {2}".format(data.status,data.statusText,$(entry)[0].url));
212 alert("Error while deleting entry.\nError code {0} ({1}). URL: {2}".format(data.status,data.statusText,$(entry)[0].url));
213 }
213 }
214 });
214 });
215 };
215 };
216 };
216 };
217
217
218 $('.delete_integration_entry').on('click', function(e){
218 $('.delete_integration_entry').on('click', function(e){
219 e.preventDefault();
219 e.preventDefault();
220 delete_integration(this);
220 delete_integration(this);
221 });
221 });
222 </script> No newline at end of file
222 </script>
@@ -1,65 +1,65 b''
1 <%namespace name="base" file="/base/base.mako"/>
1 <%namespace name="base" file="/base/base.mako"/>
2
2
3 <%
3 <%
4 elems = [
4 elems = [
5 (_('Repository Group ID'), c.repo_group.group_id, '', ''),
5 (_('Repository Group ID'), c.repo_group.group_id, '', ''),
6 (_('Owner'), lambda:base.gravatar_with_user(c.repo_group.user.email), '', ''),
6 (_('Owner'), lambda:base.gravatar_with_user(c.repo_group.user.email), '', ''),
7 (_('Created on'), h.format_date(c.repo_group.created_on), '', ''),
7 (_('Created on'), h.format_date(c.repo_group.created_on), '', ''),
8 (_('Is Personal Group'), c.repo_group.personal or False, '', ''),
8 (_('Is Personal Group'), c.repo_group.personal or False, '', ''),
9
9
10 (_('Total repositories'), c.repo_group.repositories_recursive_count, '', ''),
10 (_('Total repositories'), c.repo_group.repositories_recursive_count, '', ''),
11 (_('Top level repositories'), c.repo_group.repositories.count(), '', c.repo_group.repositories.all()),
11 (_('Top level repositories'), c.repo_group.repositories.count(), '', c.repo_group.repositories.all()),
12
12
13 (_('Children groups'), c.repo_group.children.count(), '', c.repo_group.children.all()),
13 (_('Children groups'), c.repo_group.children.count(), '', c.repo_group.children.all()),
14 ]
14 ]
15 %>
15 %>
16
16
17 <div class="panel panel-default">
17 <div class="panel panel-default">
18 <div class="panel-heading">
18 <div class="panel-heading">
19 <h3 class="panel-title">${_('Repository Group: %s') % c.repo_group.group_name}</h3>
19 <h3 class="panel-title">${_('Repository Group Advanced: {}').format(c.repo_group.name)}</h3>
20 </div>
20 </div>
21 <div class="panel-body">
21 <div class="panel-body">
22 ${base.dt_info_panel(elems)}
22 ${base.dt_info_panel(elems)}
23 </div>
23 </div>
24
24
25 </div>
25 </div>
26
26
27 <div class="panel panel-danger">
27 <div class="panel panel-danger">
28 <div class="panel-heading">
28 <div class="panel-heading">
29 <h3 class="panel-title">${_('Delete repository group')}</h3>
29 <h3 class="panel-title">${_('Delete repository group')}</h3>
30 </div>
30 </div>
31 <div class="panel-body">
31 <div class="panel-body">
32 ${h.secure_form(h.route_path('edit_repo_group_advanced_delete', repo_group_name=c.repo_group.group_name), request=request)}
32 ${h.secure_form(h.route_path('edit_repo_group_advanced_delete', repo_group_name=c.repo_group.group_name), request=request)}
33 <table class="display">
33 <table class="display">
34
34
35 <tr>
35 <tr>
36 <td>
36 <td>
37 ${_ungettext('This repository group includes %s children repository group.', 'This repository group includes %s children repository groups.', c.repo_group.children.count()) % c.repo_group.children.count()}
37 ${_ungettext('This repository group includes %s children repository group.', 'This repository group includes %s children repository groups.', c.repo_group.children.count()) % c.repo_group.children.count()}
38 </td>
38 </td>
39 <td>
39 <td>
40 </td>
40 </td>
41 <td>
41 <td>
42 </td>
42 </td>
43 </tr>
43 </tr>
44 <tr>
44 <tr>
45 <td>
45 <td>
46 ${_ungettext('This repository group includes %s repository.', 'This repository group includes %s repositories.', c.repo_group.repositories_recursive_count) % c.repo_group.repositories_recursive_count}
46 ${_ungettext('This repository group includes %s repository.', 'This repository group includes %s repositories.', c.repo_group.repositories_recursive_count) % c.repo_group.repositories_recursive_count}
47 </td>
47 </td>
48 <td>
48 <td>
49 </td>
49 </td>
50 <td>
50 <td>
51 </td>
51 </td>
52 </tr>
52 </tr>
53
53
54 </table>
54 </table>
55 <div style="margin: 0 0 20px 0" class="fake-space"></div>
55 <div style="margin: 0 0 20px 0" class="fake-space"></div>
56
56
57 <button class="btn btn-small btn-danger" type="submit"
57 <button class="btn btn-small btn-danger" type="submit"
58 onclick="return confirm('${_('Confirm to delete this group: %s') % (c.repo_group.group_name)}');">
58 onclick="return confirm('${_('Confirm to delete this group: %s') % (c.repo_group.group_name)}');">
59 ${_('Delete this repository group')}
59 ${_('Delete this repository group')}
60 </button>
60 </button>
61 ${h.end_form()}
61 ${h.end_form()}
62 </div>
62 </div>
63 </div>
63 </div>
64
64
65
65
@@ -1,219 +1,219 b''
1 <%namespace name="base" file="/base/base.mako"/>
1 <%namespace name="base" file="/base/base.mako"/>
2
2
3 <div class="panel panel-default">
3 <div class="panel panel-default">
4 <div class="panel-heading">
4 <div class="panel-heading">
5 <h3 class="panel-title">${_('Repository Group Permissions')}</h3>
5 <h3 class="panel-title">${_('Repository Group Permissions: {}').format(c.repo_group.name)}</h3>
6 </div>
6 </div>
7 <div class="panel-body">
7 <div class="panel-body">
8 ${h.secure_form(h.route_path('edit_repo_group_perms_update', repo_group_name=c.repo_group.group_name), request=request)}
8 ${h.secure_form(h.route_path('edit_repo_group_perms_update', repo_group_name=c.repo_group.group_name), request=request)}
9 <table id="permissions_manage" class="rctable permissions">
9 <table id="permissions_manage" class="rctable permissions">
10 <tr>
10 <tr>
11 <th class="td-radio">${_('None')}</th>
11 <th class="td-radio">${_('None')}</th>
12 <th class="td-radio">${_('Read')}</th>
12 <th class="td-radio">${_('Read')}</th>
13 <th class="td-radio">${_('Write')}</th>
13 <th class="td-radio">${_('Write')}</th>
14 <th class="td-radio">${_('Admin')}</th>
14 <th class="td-radio">${_('Admin')}</th>
15 <th class="td-owner">${_('User/User Group')}</th>
15 <th class="td-owner">${_('User/User Group')}</th>
16 <th class="td-action"></th>
16 <th class="td-action"></th>
17 <th class="td-action"></th>
17 <th class="td-action"></th>
18 </tr>
18 </tr>
19 ## USERS
19 ## USERS
20 %for _user in c.repo_group.permissions():
20 %for _user in c.repo_group.permissions():
21 ## super admin/owner row
21 ## super admin/owner row
22 %if getattr(_user, 'admin_row', None) or getattr(_user, 'owner_row', None):
22 %if getattr(_user, 'admin_row', None) or getattr(_user, 'owner_row', None):
23 <tr class="perm_admin_row">
23 <tr class="perm_admin_row">
24 <td class="td-radio">${h.radio('admin_perm_%s' % _user.user_id,'repository.none', disabled="disabled")}</td>
24 <td class="td-radio">${h.radio('admin_perm_%s' % _user.user_id,'repository.none', disabled="disabled")}</td>
25 <td class="td-radio">${h.radio('admin_perm_%s' % _user.user_id,'repository.read', disabled="disabled")}</td>
25 <td class="td-radio">${h.radio('admin_perm_%s' % _user.user_id,'repository.read', disabled="disabled")}</td>
26 <td class="td-radio">${h.radio('admin_perm_%s' % _user.user_id,'repository.write', disabled="disabled")}</td>
26 <td class="td-radio">${h.radio('admin_perm_%s' % _user.user_id,'repository.write', disabled="disabled")}</td>
27 <td class="td-radio">${h.radio('admin_perm_%s' % _user.user_id,'repository.admin', 'repository.admin', disabled="disabled")}</td>
27 <td class="td-radio">${h.radio('admin_perm_%s' % _user.user_id,'repository.admin', 'repository.admin', disabled="disabled")}</td>
28 <td class="td-user">
28 <td class="td-user">
29 ${base.gravatar(_user.email, 16)}
29 ${base.gravatar(_user.email, 16)}
30 ${h.link_to_user(_user.username)}
30 ${h.link_to_user(_user.username)}
31 %if getattr(_user, 'admin_row', None):
31 %if getattr(_user, 'admin_row', None):
32 (${_('super admin')})
32 (${_('super admin')})
33 %endif
33 %endif
34 %if getattr(_user, 'owner_row', None):
34 %if getattr(_user, 'owner_row', None):
35 (${_('owner')})
35 (${_('owner')})
36 %endif
36 %endif
37 </td>
37 </td>
38 <td></td>
38 <td></td>
39 <td class="quick_repo_menu">
39 <td class="quick_repo_menu">
40 % if c.rhodecode_user.is_admin:
40 % if c.rhodecode_user.is_admin:
41 <i class="icon-more"></i>
41 <i class="icon-more"></i>
42 <div class="menu_items_container" style="display: none;">
42 <div class="menu_items_container" style="display: none;">
43 <ul class="menu_items">
43 <ul class="menu_items">
44 <li>
44 <li>
45 ${h.link_to('show permissions', h.route_path('edit_user_perms_summary', user_id=_user.user_id, _anchor='repositories-groups-permissions'))}
45 ${h.link_to('show permissions', h.route_path('edit_user_perms_summary', user_id=_user.user_id, _anchor='repositories-groups-permissions'))}
46 </li>
46 </li>
47 </ul>
47 </ul>
48 </div>
48 </div>
49 % endif
49 % endif
50 </td>
50 </td>
51 </tr>
51 </tr>
52 %else:
52 %else:
53 <tr>
53 <tr>
54 ##forbid revoking permission from yourself, except if you're an super admin
54 ##forbid revoking permission from yourself, except if you're an super admin
55 %if c.rhodecode_user.user_id != _user.user_id or c.rhodecode_user.is_admin:
55 %if c.rhodecode_user.user_id != _user.user_id or c.rhodecode_user.is_admin:
56 <td class="td-radio">${h.radio('u_perm_%s' % _user.user_id,'group.none', checked=_user.permission=='group.none')}</td>
56 <td class="td-radio">${h.radio('u_perm_%s' % _user.user_id,'group.none', checked=_user.permission=='group.none')}</td>
57 <td class="td-radio">${h.radio('u_perm_%s' % _user.user_id,'group.read', checked=_user.permission=='group.read')}</td>
57 <td class="td-radio">${h.radio('u_perm_%s' % _user.user_id,'group.read', checked=_user.permission=='group.read')}</td>
58 <td class="td-radio">${h.radio('u_perm_%s' % _user.user_id,'group.write', checked=_user.permission=='group.write')}</td>
58 <td class="td-radio">${h.radio('u_perm_%s' % _user.user_id,'group.write', checked=_user.permission=='group.write')}</td>
59 <td class="td-radio">${h.radio('u_perm_%s' % _user.user_id,'group.admin', checked=_user.permission=='group.admin')}</td>
59 <td class="td-radio">${h.radio('u_perm_%s' % _user.user_id,'group.admin', checked=_user.permission=='group.admin')}</td>
60 <td class="td-user">
60 <td class="td-user">
61 ${base.gravatar(_user.email, 16)}
61 ${base.gravatar(_user.email, 16)}
62 <span class="user">
62 <span class="user">
63 % if _user.username == h.DEFAULT_USER:
63 % if _user.username == h.DEFAULT_USER:
64 ${h.DEFAULT_USER} <span class="user-perm-help-text"> - ${_('permission for all other users')}</span>
64 ${h.DEFAULT_USER} <span class="user-perm-help-text"> - ${_('permission for all other users')}</span>
65 % else:
65 % else:
66 ${h.link_to_user(_user.username)}
66 ${h.link_to_user(_user.username)}
67 %if getattr(_user, 'duplicate_perm', None):
67 %if getattr(_user, 'duplicate_perm', None):
68 (${_('inactive duplicate')})
68 (${_('inactive duplicate')})
69 %endif
69 %endif
70 % endif
70 % endif
71 </span>
71 </span>
72 </td>
72 </td>
73 <td class="td-action">
73 <td class="td-action">
74 %if _user.username != h.DEFAULT_USER:
74 %if _user.username != h.DEFAULT_USER:
75 <span class="btn btn-link btn-danger revoke_perm"
75 <span class="btn btn-link btn-danger revoke_perm"
76 member="${_user.user_id}" member_type="user">
76 member="${_user.user_id}" member_type="user">
77 ${_('Remove')}
77 ${_('Remove')}
78 </span>
78 </span>
79 %endif
79 %endif
80 </td>
80 </td>
81 <td class="quick_repo_menu">
81 <td class="quick_repo_menu">
82 % if c.rhodecode_user.is_admin:
82 % if c.rhodecode_user.is_admin:
83 <i class="icon-more"></i>
83 <i class="icon-more"></i>
84 <div class="menu_items_container" style="display: none;">
84 <div class="menu_items_container" style="display: none;">
85 <ul class="menu_items">
85 <ul class="menu_items">
86 <li>
86 <li>
87 % if _user.username == h.DEFAULT_USER:
87 % if _user.username == h.DEFAULT_USER:
88 ${h.link_to('show permissions', h.route_path('admin_permissions_overview', _anchor='repositories-groups-permissions'))}
88 ${h.link_to('show permissions', h.route_path('admin_permissions_overview', _anchor='repositories-groups-permissions'))}
89 % else:
89 % else:
90 ${h.link_to('show permissions', h.route_path('edit_user_perms_summary', user_id=_user.user_id, _anchor='repositories-groups-permissions'))}
90 ${h.link_to('show permissions', h.route_path('edit_user_perms_summary', user_id=_user.user_id, _anchor='repositories-groups-permissions'))}
91 % endif
91 % endif
92 </li>
92 </li>
93 </ul>
93 </ul>
94 </div>
94 </div>
95 % endif
95 % endif
96 </td>
96 </td>
97 %else:
97 %else:
98 ## special case for currently logged-in user permissions, we make sure he cannot take his own permissions
98 ## special case for currently logged-in user permissions, we make sure he cannot take his own permissions
99 <td class="td-radio">${h.radio('u_perm_%s' % _user.user_id,'group.none', disabled="disabled")}</td>
99 <td class="td-radio">${h.radio('u_perm_%s' % _user.user_id,'group.none', disabled="disabled")}</td>
100 <td class="td-radio">${h.radio('u_perm_%s' % _user.user_id,'group.read', disabled="disabled")}</td>
100 <td class="td-radio">${h.radio('u_perm_%s' % _user.user_id,'group.read', disabled="disabled")}</td>
101 <td class="td-radio">${h.radio('u_perm_%s' % _user.user_id,'group.write', disabled="disabled")}</td>
101 <td class="td-radio">${h.radio('u_perm_%s' % _user.user_id,'group.write', disabled="disabled")}</td>
102 <td class="td-radio">${h.radio('u_perm_%s' % _user.user_id,'group.admin', disabled="disabled")}</td>
102 <td class="td-radio">${h.radio('u_perm_%s' % _user.user_id,'group.admin', disabled="disabled")}</td>
103 <td class="td-user">
103 <td class="td-user">
104 ${base.gravatar(_user.email, 16)}
104 ${base.gravatar(_user.email, 16)}
105 <span class="user">
105 <span class="user">
106 % if _user.username == h.DEFAULT_USER:
106 % if _user.username == h.DEFAULT_USER:
107 ${h.DEFAULT_USER} <span class="user-perm-help-text"> - ${_('permission for all other users')}</span>
107 ${h.DEFAULT_USER} <span class="user-perm-help-text"> - ${_('permission for all other users')}</span>
108 % else:
108 % else:
109 ${h.link_to_user(_user.username)}
109 ${h.link_to_user(_user.username)}
110 %if getattr(_user, 'duplicate_perm', None):
110 %if getattr(_user, 'duplicate_perm', None):
111 (${_('inactive duplicate')})
111 (${_('inactive duplicate')})
112 %endif
112 %endif
113 % endif
113 % endif
114 <span class="user-perm-help-text">(${_('delegated admin')})</span>
114 <span class="user-perm-help-text">(${_('delegated admin')})</span>
115 </span>
115 </span>
116 </td>
116 </td>
117 <td></td>
117 <td></td>
118 <td class="quick_repo_menu">
118 <td class="quick_repo_menu">
119 % if c.rhodecode_user.is_admin:
119 % if c.rhodecode_user.is_admin:
120 <i class="icon-more"></i>
120 <i class="icon-more"></i>
121 <div class="menu_items_container" style="display: none;">
121 <div class="menu_items_container" style="display: none;">
122 <ul class="menu_items">
122 <ul class="menu_items">
123 <li>
123 <li>
124 ${h.link_to('show permissions', h.route_path('edit_user_perms_summary', user_id=_user.user_id, _anchor='repositories-groups-permissions'))}
124 ${h.link_to('show permissions', h.route_path('edit_user_perms_summary', user_id=_user.user_id, _anchor='repositories-groups-permissions'))}
125 </li>
125 </li>
126 </ul>
126 </ul>
127 </div>
127 </div>
128 % endif
128 % endif
129 </td>
129 </td>
130 %endif
130 %endif
131 </tr>
131 </tr>
132 %endif
132 %endif
133 %endfor
133 %endfor
134
134
135 ## USER GROUPS
135 ## USER GROUPS
136 %for _user_group in c.repo_group.permission_user_groups(with_members=True):
136 %for _user_group in c.repo_group.permission_user_groups(with_members=True):
137 <tr id="id${id(_user_group.users_group_name)}">
137 <tr id="id${id(_user_group.users_group_name)}">
138 <td class="td-radio">${h.radio('g_perm_%s' % _user_group.users_group_id,'group.none', checked=_user_group.permission=='group.none')}</td>
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 <td class="td-radio">${h.radio('g_perm_%s' % _user_group.users_group_id,'group.read', checked=_user_group.permission=='group.read')}</td>
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 <td class="td-radio">${h.radio('g_perm_%s' % _user_group.users_group_id,'group.write', checked=_user_group.permission=='group.write')}</td>
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 <td class="td-radio">${h.radio('g_perm_%s' % _user_group.users_group_id,'group.admin', checked=_user_group.permission=='group.admin')}</td>
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 <td class="td-componentname">
142 <td class="td-componentname">
143 <i class="icon-user-group"></i>
143 <i class="icon-user-group"></i>
144 %if c.is_super_admin:
144 %if c.is_super_admin:
145 <a href="${h.route_path('edit_user_group',user_group_id=_user_group.users_group_id)}">
145 <a href="${h.route_path('edit_user_group',user_group_id=_user_group.users_group_id)}">
146 ${_user_group.users_group_name}
146 ${_user_group.users_group_name}
147 </a>
147 </a>
148 %else:
148 %else:
149 ${h.link_to_group(_user_group.users_group_name)}
149 ${h.link_to_group(_user_group.users_group_name)}
150 %endif
150 %endif
151 (${_('members')}: ${len(_user_group.members)})
151 (${_('members')}: ${len(_user_group.members)})
152 </td>
152 </td>
153 <td class="td-action">
153 <td class="td-action">
154 <span class="btn btn-link btn-danger revoke_perm"
154 <span class="btn btn-link btn-danger revoke_perm"
155 member="${_user_group.users_group_id}" member_type="user_group">
155 member="${_user_group.users_group_id}" member_type="user_group">
156 ${_('Remove')}
156 ${_('Remove')}
157 </span>
157 </span>
158 </td>
158 </td>
159 <td class="quick_repo_menu">
159 <td class="quick_repo_menu">
160 % if c.rhodecode_user.is_admin:
160 % if c.rhodecode_user.is_admin:
161 <i class="icon-more"></i>
161 <i class="icon-more"></i>
162 <div class="menu_items_container" style="display: none;">
162 <div class="menu_items_container" style="display: none;">
163 <ul class="menu_items">
163 <ul class="menu_items">
164 <li>
164 <li>
165 ${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'))}
165 ${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'))}
166 </li>
166 </li>
167 </ul>
167 </ul>
168 </div>
168 </div>
169 % endif
169 % endif
170 </td>
170 </td>
171 </tr>
171 </tr>
172 %endfor
172 %endfor
173
173
174 <tr class="new_members" id="add_perm_input"></tr>
174 <tr class="new_members" id="add_perm_input"></tr>
175 <tr>
175 <tr>
176 <td></td>
176 <td></td>
177 <td></td>
177 <td></td>
178 <td></td>
178 <td></td>
179 <td></td>
179 <td></td>
180 <td></td>
180 <td></td>
181 <td>
181 <td>
182 <span id="add_perm" class="link">
182 <span id="add_perm" class="link">
183 ${_('Add user/user group')}
183 ${_('Add user/user group')}
184 </span>
184 </span>
185 </td>
185 </td>
186 <td></td>
186 <td></td>
187 </tr>
187 </tr>
188 </table>
188 </table>
189
189
190 <div class="fields">
190 <div class="fields">
191 <div class="field">
191 <div class="field">
192 <div class="label label-radio">
192 <div class="label label-radio">
193 ${_('Apply to children')}:
193 ${_('Apply to children')}:
194 </div>
194 </div>
195 <div class="radios">
195 <div class="radios">
196 ${h.radio('recursive', 'none', label=_('None'), checked="checked")}
196 ${h.radio('recursive', 'none', label=_('None'), checked="checked")}
197 ${h.radio('recursive', 'groups', label=_('Repository Groups'))}
197 ${h.radio('recursive', 'groups', label=_('Repository Groups'))}
198 ${h.radio('recursive', 'repos', label=_('Repositories'))}
198 ${h.radio('recursive', 'repos', label=_('Repositories'))}
199 ${h.radio('recursive', 'all', label=_('Both'))}
199 ${h.radio('recursive', 'all', label=_('Both'))}
200 <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>
200 <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>
201 </div>
201 </div>
202 </div>
202 </div>
203 </div>
203 </div>
204 <div class="buttons">
204 <div class="buttons">
205 ${h.submit('save',_('Save'),class_="btn btn-primary")}
205 ${h.submit('save',_('Save'),class_="btn btn-primary")}
206 ${h.reset('reset',_('Reset'),class_="btn btn-danger")}
206 ${h.reset('reset',_('Reset'),class_="btn btn-danger")}
207 </div>
207 </div>
208 ${h.end_form()}
208 ${h.end_form()}
209 </div>
209 </div>
210 </div>
210 </div>
211 <script type="text/javascript">
211 <script type="text/javascript">
212 $('#add_perm').on('click', function(e){
212 $('#add_perm').on('click', function(e){
213 addNewPermInput($(this), 'group');
213 addNewPermInput($(this), 'group');
214 });
214 });
215 $('.revoke_perm').on('click', function(e){
215 $('.revoke_perm').on('click', function(e){
216 markRevokePermInput($(this), 'group');
216 markRevokePermInput($(this), 'group');
217 });
217 });
218 quick_repo_menu();
218 quick_repo_menu();
219 </script>
219 </script>
@@ -1,95 +1,95 b''
1 ## -*- coding: utf-8 -*-
1 ## -*- coding: utf-8 -*-
2 <%namespace name="base" file="/base/base.mako"/>
2 <%namespace name="base" file="/base/base.mako"/>
3
3
4 <div class="panel panel-default">
4 <div class="panel panel-default">
5 <div class="panel-heading">
5 <div class="panel-heading">
6 <h3 class="panel-title">${_('Settings for Repository Group: %s') % c.repo_group.name}</h3>
6 <h3 class="panel-title">${_('Repository Group Settings: {}').format(c.repo_group.name)}</h3>
7 </div>
7 </div>
8 <div class="panel-body">
8 <div class="panel-body">
9 ${h.secure_form(h.route_path('edit_repo_group', repo_group_name=c.repo_group.group_name), request=request)}
9 ${h.secure_form(h.route_path('edit_repo_group', repo_group_name=c.repo_group.group_name), request=request)}
10 <div class="form">
10 <div class="form">
11 <!-- fields -->
11 <!-- fields -->
12 <div class="fields">
12 <div class="fields">
13 <div class="field">
13 <div class="field">
14 <div class="label">
14 <div class="label">
15 <label for="group_name">${_('Group name')}:</label>
15 <label for="group_name">${_('Group name')}:</label>
16 </div>
16 </div>
17 <div class="input">
17 <div class="input">
18 ${c.form['repo_group_name'].render(css_class='medium', oid='group_name')|n}
18 ${c.form['repo_group_name'].render(css_class='medium', oid='group_name')|n}
19 ${c.form.render_error(request, c.form['repo_group_name'])|n}
19 ${c.form.render_error(request, c.form['repo_group_name'])|n}
20 </div>
20 </div>
21 </div>
21 </div>
22
22
23 <div class="field">
23 <div class="field">
24 <div class="label">
24 <div class="label">
25 <label for="repo_group">${_('Repository group')}:</label>
25 <label for="repo_group">${_('Repository group')}:</label>
26 </div>
26 </div>
27 <div class="select">
27 <div class="select">
28 ${c.form['repo_group'].render(css_class='medium', oid='repo_group')|n}
28 ${c.form['repo_group'].render(css_class='medium', oid='repo_group')|n}
29 ${c.form.render_error(request, c.form['repo_group'])|n}
29 ${c.form.render_error(request, c.form['repo_group'])|n}
30
30
31 <p class="help-block">${_('Optional select a parent group to move this repository group into.')}</p>
31 <p class="help-block">${_('Optional select a parent group to move this repository group into.')}</p>
32 </div>
32 </div>
33 </div>
33 </div>
34
34
35 <div class="field badged-field">
35 <div class="field badged-field">
36 <div class="label">
36 <div class="label">
37 <label for="repo_group_owner">${_('Owner')}:</label>
37 <label for="repo_group_owner">${_('Owner')}:</label>
38 </div>
38 </div>
39 <div class="input">
39 <div class="input">
40 <div class="badge-input-container">
40 <div class="badge-input-container">
41 <div class="user-badge">
41 <div class="user-badge">
42 ${base.gravatar_with_user(c.repo_group.user.email, show_disabled=not c.repo_group.user.active)}
42 ${base.gravatar_with_user(c.repo_group.user.email, show_disabled=not c.repo_group.user.active)}
43 </div>
43 </div>
44 <div class="badge-input-wrap">
44 <div class="badge-input-wrap">
45 ${c.form['repo_group_owner'].render(css_class='medium', oid='repo_group_owner')|n}
45 ${c.form['repo_group_owner'].render(css_class='medium', oid='repo_group_owner')|n}
46 </div>
46 </div>
47 </div>
47 </div>
48 ${c.form.render_error(request, c.form['repo_group_owner'])|n}
48 ${c.form.render_error(request, c.form['repo_group_owner'])|n}
49 <p class="help-block">${_('Change owner of this repository group.')}</p>
49 <p class="help-block">${_('Change owner of this repository group.')}</p>
50 </div>
50 </div>
51 </div>
51 </div>
52
52
53 <div class="field">
53 <div class="field">
54 <div class="label label-textarea">
54 <div class="label label-textarea">
55 <label for="repo_group_description">${_('Description')}:</label>
55 <label for="repo_group_description">${_('Description')}:</label>
56 </div>
56 </div>
57 <div class="textarea text-area editor">
57 <div class="textarea text-area editor">
58 ${c.form['repo_group_description'].render(css_class='medium', oid='repo_group_description')|n}
58 ${c.form['repo_group_description'].render(css_class='medium', oid='repo_group_description')|n}
59 ${c.form.render_error(request, c.form['repo_group_description'])|n}
59 ${c.form.render_error(request, c.form['repo_group_description'])|n}
60
60
61 <% metatags_url = h.literal('''<a href="#metatagsShow" onclick="$('#meta-tags-desc').toggle();return false">meta-tags</a>''') %>
61 <% metatags_url = h.literal('''<a href="#metatagsShow" onclick="$('#meta-tags-desc').toggle();return false">meta-tags</a>''') %>
62 <span class="help-block">${_('Plain text format with support of {metatags}').format(metatags=metatags_url)|n}</span>
62 <span class="help-block">${_('Plain text format with support of {metatags}').format(metatags=metatags_url)|n}</span>
63 <span id="meta-tags-desc" style="display: none">
63 <span id="meta-tags-desc" style="display: none">
64 <%namespace name="dt" file="/data_table/_dt_elements.mako"/>
64 <%namespace name="dt" file="/data_table/_dt_elements.mako"/>
65 ${dt.metatags_help()}
65 ${dt.metatags_help()}
66 </span>
66 </span>
67 </div>
67 </div>
68 </div>
68 </div>
69
69
70 <div class="field">
70 <div class="field">
71 <div class="label label-checkbox">
71 <div class="label label-checkbox">
72 <label for="repo_group_enable_locking">${_('Enable Repository Locking')}:</label>
72 <label for="repo_group_enable_locking">${_('Enable Repository Locking')}:</label>
73 </div>
73 </div>
74 <div class="checkboxes">
74 <div class="checkboxes">
75 ${c.form['repo_group_enable_locking'].render(css_class='medium', oid='repo_group_enable_locking')|n}
75 ${c.form['repo_group_enable_locking'].render(css_class='medium', oid='repo_group_enable_locking')|n}
76 ${c.form.render_error(request, c.form['repo_group_enable_locking'])|n}
76 ${c.form.render_error(request, c.form['repo_group_enable_locking'])|n}
77
77
78 <span class="help-block">${_('Repository locking will be enabled on all subgroups and repositories inside this repository group. Pulling from a repository locks it, and it is unlocked by pushing back by the same user.')}</span>
78 <span class="help-block">${_('Repository locking will be enabled on all subgroups and repositories inside this repository group. Pulling from a repository locks it, and it is unlocked by pushing back by the same user.')}</span>
79 </div>
79 </div>
80 </div>
80 </div>
81
81
82 <div class="buttons">
82 <div class="buttons">
83 ${h.submit('save',_('Save'),class_="btn")}
83 ${h.submit('save',_('Save'),class_="btn")}
84 ${h.reset('reset',_('Reset'),class_="btn")}
84 ${h.reset('reset',_('Reset'),class_="btn")}
85 </div>
85 </div>
86 </div>
86 </div>
87 </div>
87 </div>
88 ${h.end_form()}
88 ${h.end_form()}
89 </div>
89 </div>
90 </div>
90 </div>
91 <script>
91 <script>
92 $(document).ready(function(){
92 $(document).ready(function(){
93 UsersAutoComplete('repo_group_owner', '${c.rhodecode_user.user_id}');
93 UsersAutoComplete('repo_group_owner', '${c.rhodecode_user.user_id}');
94 })
94 })
95 </script>
95 </script>
General Comments 0
You need to be logged in to leave comments. Login now