##// END OF EJS Templates
templates: expose IDs of objects in advanced views. Usefull for API or ishell.
marcink -
r3332:16216d98 default
parent child Browse files
Show More
@@ -1,64 +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 (_('Owner'), lambda:base.gravatar_with_user(c.repo_group.user.email), '', ''),
6 (_('Owner'), lambda:base.gravatar_with_user(c.repo_group.user.email), '', ''),
6 (_('Created on'), h.format_date(c.repo_group.created_on), '', ''),
7 (_('Created on'), h.format_date(c.repo_group.created_on), '', ''),
7 (_('Is Personal Group'), c.repo_group.personal or False, '', ''),
8 (_('Is Personal Group'), c.repo_group.personal or False, '', ''),
8
9
9 (_('Total repositories'), c.repo_group.repositories_recursive_count, '', ''),
10 (_('Total repositories'), c.repo_group.repositories_recursive_count, '', ''),
10 (_('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()),
11
12
12 (_('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()),
13 ]
14 ]
14 %>
15 %>
15
16
16 <div class="panel panel-default">
17 <div class="panel panel-default">
17 <div class="panel-heading">
18 <div class="panel-heading">
18 <h3 class="panel-title">${_('Repository Group: %s') % c.repo_group.group_name}</h3>
19 <h3 class="panel-title">${_('Repository Group: %s') % c.repo_group.group_name}</h3>
19 </div>
20 </div>
20 <div class="panel-body">
21 <div class="panel-body">
21 ${base.dt_info_panel(elems)}
22 ${base.dt_info_panel(elems)}
22 </div>
23 </div>
23
24
24 </div>
25 </div>
25
26
26 <div class="panel panel-danger">
27 <div class="panel panel-danger">
27 <div class="panel-heading">
28 <div class="panel-heading">
28 <h3 class="panel-title">${_('Delete repository group')}</h3>
29 <h3 class="panel-title">${_('Delete repository group')}</h3>
29 </div>
30 </div>
30 <div class="panel-body">
31 <div class="panel-body">
31 ${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)}
32 <table class="display">
33 <table class="display">
33
34
34 <tr>
35 <tr>
35 <td>
36 <td>
36 ${_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()}
37 </td>
38 </td>
38 <td>
39 <td>
39 </td>
40 </td>
40 <td>
41 <td>
41 </td>
42 </td>
42 </tr>
43 </tr>
43 <tr>
44 <tr>
44 <td>
45 <td>
45 ${_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}
46 </td>
47 </td>
47 <td>
48 <td>
48 </td>
49 </td>
49 <td>
50 <td>
50 </td>
51 </td>
51 </tr>
52 </tr>
52
53
53 </table>
54 </table>
54 <div style="margin: 0 0 20px 0" class="fake-space"></div>
55 <div style="margin: 0 0 20px 0" class="fake-space"></div>
55
56
56 <button class="btn btn-small btn-danger" type="submit"
57 <button class="btn btn-small btn-danger" type="submit"
57 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)}');">
58 ${_('Delete this repository group')}
59 ${_('Delete this repository group')}
59 </button>
60 </button>
60 ${h.end_form()}
61 ${h.end_form()}
61 </div>
62 </div>
62 </div>
63 </div>
63
64
64
65
@@ -1,254 +1,255 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 ID'), c.rhodecode_db_repo.repo_id, '', ''),
5 (_('Owner'), lambda:base.gravatar_with_user(c.rhodecode_db_repo.user.email), '', ''),
6 (_('Owner'), lambda:base.gravatar_with_user(c.rhodecode_db_repo.user.email), '', ''),
6 (_('Created on'), h.format_date(c.rhodecode_db_repo.created_on), '', ''),
7 (_('Created on'), h.format_date(c.rhodecode_db_repo.created_on), '', ''),
7 (_('Updated on'), h.format_date(c.rhodecode_db_repo.updated_on), '', ''),
8 (_('Updated on'), h.format_date(c.rhodecode_db_repo.updated_on), '', ''),
8 (_('Cached Commit id'), lambda: h.link_to(c.rhodecode_db_repo.changeset_cache.get('short_id'), h.route_path('repo_commit',repo_name=c.repo_name,commit_id=c.rhodecode_db_repo.changeset_cache.get('raw_id'))), '', ''),
9 (_('Cached Commit id'), lambda: h.link_to(c.rhodecode_db_repo.changeset_cache.get('short_id'), h.route_path('repo_commit',repo_name=c.repo_name,commit_id=c.rhodecode_db_repo.changeset_cache.get('raw_id'))), '', ''),
9 (_('Attached scoped tokens'), len(c.rhodecode_db_repo.scoped_tokens), '', [x.user for x in c.rhodecode_db_repo.scoped_tokens]),
10 (_('Attached scoped tokens'), len(c.rhodecode_db_repo.scoped_tokens), '', [x.user for x in c.rhodecode_db_repo.scoped_tokens]),
10 (_('Pull requests source'), len(c.rhodecode_db_repo.pull_requests_source), '', ['pr_id:{}, repo:{}'.format(x.pull_request_id,x.source_repo.repo_name) for x in c.rhodecode_db_repo.pull_requests_source]),
11 (_('Pull requests source'), len(c.rhodecode_db_repo.pull_requests_source), '', ['pr_id:{}, repo:{}'.format(x.pull_request_id,x.source_repo.repo_name) for x in c.rhodecode_db_repo.pull_requests_source]),
11 (_('Pull requests target'), len(c.rhodecode_db_repo.pull_requests_target), '', ['pr_id:{}, repo:{}'.format(x.pull_request_id,x.target_repo.repo_name) for x in c.rhodecode_db_repo.pull_requests_target]),
12 (_('Pull requests target'), len(c.rhodecode_db_repo.pull_requests_target), '', ['pr_id:{}, repo:{}'.format(x.pull_request_id,x.target_repo.repo_name) for x in c.rhodecode_db_repo.pull_requests_target]),
12 ]
13 ]
13 %>
14 %>
14
15
15 <div class="panel panel-default">
16 <div class="panel panel-default">
16 <div class="panel-heading" id="advanced-info" >
17 <div class="panel-heading" id="advanced-info" >
17 <h3 class="panel-title">${_('Repository: %s') % c.rhodecode_db_repo.repo_name} <a class="permalink" href="#advanced-info"> ΒΆ</a></h3>
18 <h3 class="panel-title">${_('Repository: %s') % c.rhodecode_db_repo.repo_name} <a class="permalink" href="#advanced-info"> ΒΆ</a></h3>
18 </div>
19 </div>
19 <div class="panel-body">
20 <div class="panel-body">
20 ${base.dt_info_panel(elems)}
21 ${base.dt_info_panel(elems)}
21 </div>
22 </div>
22 </div>
23 </div>
23
24
24
25
25 <div class="panel panel-default">
26 <div class="panel panel-default">
26 <div class="panel-heading" id="advanced-fork">
27 <div class="panel-heading" id="advanced-fork">
27 <h3 class="panel-title">${_('Fork Reference')} <a class="permalink" href="#advanced-fork"> ΒΆ</a></h3>
28 <h3 class="panel-title">${_('Fork Reference')} <a class="permalink" href="#advanced-fork"> ΒΆ</a></h3>
28 </div>
29 </div>
29 <div class="panel-body">
30 <div class="panel-body">
30 ${h.secure_form(h.route_path('edit_repo_advanced_fork', repo_name=c.rhodecode_db_repo.repo_name), request=request)}
31 ${h.secure_form(h.route_path('edit_repo_advanced_fork', repo_name=c.rhodecode_db_repo.repo_name), request=request)}
31
32
32 % if c.rhodecode_db_repo.fork:
33 % if c.rhodecode_db_repo.fork:
33 <div class="panel-body-title-text">${h.literal(_('This repository is a fork of %(repo_link)s') % {'repo_link': h.link_to_if(c.has_origin_repo_read_perm,c.rhodecode_db_repo.fork.repo_name, h.route_path('repo_summary', repo_name=c.rhodecode_db_repo.fork.repo_name))})}
34 <div class="panel-body-title-text">${h.literal(_('This repository is a fork of %(repo_link)s') % {'repo_link': h.link_to_if(c.has_origin_repo_read_perm,c.rhodecode_db_repo.fork.repo_name, h.route_path('repo_summary', repo_name=c.rhodecode_db_repo.fork.repo_name))})}
34 | <button class="btn btn-link btn-danger" type="submit">Remove fork reference</button></div>
35 | <button class="btn btn-link btn-danger" type="submit">Remove fork reference</button></div>
35 % endif
36 % endif
36
37
37 <div class="field">
38 <div class="field">
38 ${h.hidden('id_fork_of')}
39 ${h.hidden('id_fork_of')}
39 ${h.submit('set_as_fork_%s' % c.rhodecode_db_repo.repo_name,_('Set'),class_="btn btn-small",)}
40 ${h.submit('set_as_fork_%s' % c.rhodecode_db_repo.repo_name,_('Set'),class_="btn btn-small",)}
40 </div>
41 </div>
41 <div class="field">
42 <div class="field">
42 <span class="help-block">${_('Manually set this repository as a fork of another from the list')}</span>
43 <span class="help-block">${_('Manually set this repository as a fork of another from the list')}</span>
43 </div>
44 </div>
44 ${h.end_form()}
45 ${h.end_form()}
45 </div>
46 </div>
46 </div>
47 </div>
47
48
48
49
49 <div class="panel panel-default">
50 <div class="panel panel-default">
50 <div class="panel-heading" id="advanced-journal">
51 <div class="panel-heading" id="advanced-journal">
51 <h3 class="panel-title">${_('Public Journal Visibility')} <a class="permalink" href="#advanced-journal"> ΒΆ</a></h3>
52 <h3 class="panel-title">${_('Public Journal Visibility')} <a class="permalink" href="#advanced-journal"> ΒΆ</a></h3>
52 </div>
53 </div>
53 <div class="panel-body">
54 <div class="panel-body">
54 ${h.secure_form(h.route_path('edit_repo_advanced_journal', repo_name=c.rhodecode_db_repo.repo_name), request=request)}
55 ${h.secure_form(h.route_path('edit_repo_advanced_journal', repo_name=c.rhodecode_db_repo.repo_name), request=request)}
55 <div class="field">
56 <div class="field">
56 %if c.in_public_journal:
57 %if c.in_public_journal:
57 <button class="btn btn-small" type="submit">
58 <button class="btn btn-small" type="submit">
58 ${_('Remove from Public Journal')}
59 ${_('Remove from Public Journal')}
59 </button>
60 </button>
60 %else:
61 %else:
61 <button class="btn btn-small" type="submit">
62 <button class="btn btn-small" type="submit">
62 ${_('Add to Public Journal')}
63 ${_('Add to Public Journal')}
63 </button>
64 </button>
64 %endif
65 %endif
65 </div>
66 </div>
66 <div class="field" >
67 <div class="field" >
67 <span class="help-block">${_('All actions made on this repository will be visible to everyone following the public journal.')}</span>
68 <span class="help-block">${_('All actions made on this repository will be visible to everyone following the public journal.')}</span>
68 </div>
69 </div>
69 ${h.end_form()}
70 ${h.end_form()}
70 </div>
71 </div>
71 </div>
72 </div>
72
73
73
74
74 <div class="panel panel-default">
75 <div class="panel panel-default">
75 <div class="panel-heading" id="advanced-locking">
76 <div class="panel-heading" id="advanced-locking">
76 <h3 class="panel-title">${_('Locking state')} <a class="permalink" href="#advanced-locking"> ΒΆ</a></h3>
77 <h3 class="panel-title">${_('Locking state')} <a class="permalink" href="#advanced-locking"> ΒΆ</a></h3>
77 </div>
78 </div>
78 <div class="panel-body">
79 <div class="panel-body">
79 ${h.secure_form(h.route_path('edit_repo_advanced_locking', repo_name=c.rhodecode_db_repo.repo_name), request=request)}
80 ${h.secure_form(h.route_path('edit_repo_advanced_locking', repo_name=c.rhodecode_db_repo.repo_name), request=request)}
80
81
81 %if c.rhodecode_db_repo.locked[0]:
82 %if c.rhodecode_db_repo.locked[0]:
82 <div class="panel-body-title-text">${'Locked by %s on %s. Lock reason: %s' % (h.person_by_id(c.rhodecode_db_repo.locked[0]),
83 <div class="panel-body-title-text">${'Locked by %s on %s. Lock reason: %s' % (h.person_by_id(c.rhodecode_db_repo.locked[0]),
83 h.format_date(h. time_to_datetime(c.rhodecode_db_repo.locked[1])), c.rhodecode_db_repo.locked[2])}</div>
84 h.format_date(h. time_to_datetime(c.rhodecode_db_repo.locked[1])), c.rhodecode_db_repo.locked[2])}</div>
84 %else:
85 %else:
85 <div class="panel-body-title-text">${_('This Repository is not currently locked.')}</div>
86 <div class="panel-body-title-text">${_('This Repository is not currently locked.')}</div>
86 %endif
87 %endif
87
88
88 <div class="field" >
89 <div class="field" >
89 %if c.rhodecode_db_repo.locked[0]:
90 %if c.rhodecode_db_repo.locked[0]:
90 ${h.hidden('set_unlock', '1')}
91 ${h.hidden('set_unlock', '1')}
91 <button class="btn btn-small" type="submit"
92 <button class="btn btn-small" type="submit"
92 onclick="return confirm('${_('Confirm to unlock repository.')}');">
93 onclick="return confirm('${_('Confirm to unlock repository.')}');">
93 <i class="icon-unlock"></i>
94 <i class="icon-unlock"></i>
94 ${_('Unlock repository')}
95 ${_('Unlock repository')}
95 </button>
96 </button>
96 %else:
97 %else:
97 ${h.hidden('set_lock', '1')}
98 ${h.hidden('set_lock', '1')}
98 <button class="btn btn-small" type="submit"
99 <button class="btn btn-small" type="submit"
99 onclick="return confirm('${_('Confirm to lock repository.')}');">
100 onclick="return confirm('${_('Confirm to lock repository.')}');">
100 <i class="icon-lock"></i>
101 <i class="icon-lock"></i>
101 ${_('Lock repository')}
102 ${_('Lock repository')}
102 </button>
103 </button>
103 %endif
104 %endif
104 </div>
105 </div>
105 <div class="field" >
106 <div class="field" >
106 <span class="help-block">
107 <span class="help-block">
107 ${_('Force repository locking. This only works when anonymous access is disabled. Pulling from the repository locks the repository to that user until the same user pushes to that repository again.')}
108 ${_('Force repository locking. This only works when anonymous access is disabled. Pulling from the repository locks the repository to that user until the same user pushes to that repository again.')}
108 </span>
109 </span>
109 </div>
110 </div>
110 ${h.end_form()}
111 ${h.end_form()}
111 </div>
112 </div>
112 </div>
113 </div>
113
114
114
115
115 <div class="panel panel-warning">
116 <div class="panel panel-warning">
116 <div class="panel-heading" id="advanced-archive">
117 <div class="panel-heading" id="advanced-archive">
117 <h3 class="panel-title">${_('Archive repository')} <a class="permalink" href="#advanced-archive"> ΒΆ</a></h3>
118 <h3 class="panel-title">${_('Archive repository')} <a class="permalink" href="#advanced-archive"> ΒΆ</a></h3>
118 </div>
119 </div>
119 <div class="panel-body">
120 <div class="panel-body">
120 ${h.secure_form(h.route_path('edit_repo_advanced_archive', repo_name=c.repo_name), request=request)}
121 ${h.secure_form(h.route_path('edit_repo_advanced_archive', repo_name=c.repo_name), request=request)}
121
122
122 <div style="margin: 0 0 20px 0" class="fake-space"></div>
123 <div style="margin: 0 0 20px 0" class="fake-space"></div>
123
124
124 <div class="field">
125 <div class="field">
125 <button class="btn btn-small btn-danger" type="submit"
126 <button class="btn btn-small btn-danger" type="submit"
126 onclick="return confirm('${_('Confirm to archive this repository: %s') % c.repo_name}');">
127 onclick="return confirm('${_('Confirm to archive this repository: %s') % c.repo_name}');">
127 <i class="icon-remove-sign"></i>
128 <i class="icon-remove-sign"></i>
128 ${_('Archive this repository')}
129 ${_('Archive this repository')}
129 </button>
130 </button>
130 </div>
131 </div>
131 <div class="field">
132 <div class="field">
132 <span class="help-block">
133 <span class="help-block">
133 ${_('Archiving the repository will make it entirely read-only. The repository cannot be committed to.'
134 ${_('Archiving the repository will make it entirely read-only. The repository cannot be committed to.'
134 'It is hidden from the search results and dashboard. ')}
135 'It is hidden from the search results and dashboard. ')}
135 </span>
136 </span>
136 </div>
137 </div>
137
138
138 ${h.end_form()}
139 ${h.end_form()}
139 </div>
140 </div>
140 </div>
141 </div>
141
142
142
143
143 <div class="panel panel-danger">
144 <div class="panel panel-danger">
144 <div class="panel-heading" id="advanced-delete">
145 <div class="panel-heading" id="advanced-delete">
145 <h3 class="panel-title">${_('Delete repository')} <a class="permalink" href="#advanced-delete"> ΒΆ</a></h3>
146 <h3 class="panel-title">${_('Delete repository')} <a class="permalink" href="#advanced-delete"> ΒΆ</a></h3>
146 </div>
147 </div>
147 <div class="panel-body">
148 <div class="panel-body">
148 ${h.secure_form(h.route_path('edit_repo_advanced_delete', repo_name=c.repo_name), request=request)}
149 ${h.secure_form(h.route_path('edit_repo_advanced_delete', repo_name=c.repo_name), request=request)}
149 <table class="display">
150 <table class="display">
150 <tr>
151 <tr>
151 <td>
152 <td>
152 ${_ungettext('This repository has %s fork.', 'This repository has %s forks.', c.rhodecode_db_repo.forks.count()) % c.rhodecode_db_repo.forks.count()}
153 ${_ungettext('This repository has %s fork.', 'This repository has %s forks.', c.rhodecode_db_repo.forks.count()) % c.rhodecode_db_repo.forks.count()}
153 </td>
154 </td>
154 <td>
155 <td>
155 %if c.rhodecode_db_repo.forks.count():
156 %if c.rhodecode_db_repo.forks.count():
156 <input type="radio" name="forks" value="detach_forks" checked="checked"/> <label for="forks">${_('Detach forks')}</label>
157 <input type="radio" name="forks" value="detach_forks" checked="checked"/> <label for="forks">${_('Detach forks')}</label>
157 %endif
158 %endif
158 </td>
159 </td>
159 <td>
160 <td>
160 %if c.rhodecode_db_repo.forks.count():
161 %if c.rhodecode_db_repo.forks.count():
161 <input type="radio" name="forks" value="delete_forks"/> <label for="forks">${_('Delete forks')}</label>
162 <input type="radio" name="forks" value="delete_forks"/> <label for="forks">${_('Delete forks')}</label>
162 %endif
163 %endif
163 </td>
164 </td>
164 </tr>
165 </tr>
165 <% attached_prs = len(c.rhodecode_db_repo.pull_requests_source + c.rhodecode_db_repo.pull_requests_target) %>
166 <% attached_prs = len(c.rhodecode_db_repo.pull_requests_source + c.rhodecode_db_repo.pull_requests_target) %>
166 % if c.rhodecode_db_repo.pull_requests_source or c.rhodecode_db_repo.pull_requests_target:
167 % if c.rhodecode_db_repo.pull_requests_source or c.rhodecode_db_repo.pull_requests_target:
167 <tr>
168 <tr>
168 <td>
169 <td>
169 ${_ungettext('This repository has %s attached pull request.', 'This repository has %s attached pull requests.', attached_prs) % attached_prs}
170 ${_ungettext('This repository has %s attached pull request.', 'This repository has %s attached pull requests.', attached_prs) % attached_prs}
170 <br/>
171 <br/>
171 ${_('Consider to archive this repository instead.')}
172 ${_('Consider to archive this repository instead.')}
172 </td>
173 </td>
173 <td></td>
174 <td></td>
174 <td></td>
175 <td></td>
175 </tr>
176 </tr>
176 % endif
177 % endif
177 </table>
178 </table>
178 <div style="margin: 0 0 20px 0" class="fake-space"></div>
179 <div style="margin: 0 0 20px 0" class="fake-space"></div>
179
180
180 <div class="field">
181 <div class="field">
181 <button class="btn btn-small btn-danger" type="submit"
182 <button class="btn btn-small btn-danger" type="submit"
182 onclick="return confirm('${_('Confirm to delete this repository: %s') % c.repo_name}');">
183 onclick="return confirm('${_('Confirm to delete this repository: %s') % c.repo_name}');">
183 <i class="icon-remove-sign"></i>
184 <i class="icon-remove-sign"></i>
184 ${_('Delete this repository')}
185 ${_('Delete this repository')}
185 </button>
186 </button>
186 </div>
187 </div>
187 <div class="field">
188 <div class="field">
188 <span class="help-block">
189 <span class="help-block">
189 ${_('This repository will be renamed in a special way in order to make it inaccessible to RhodeCode Enterprise and its VCS systems. If you need to fully delete it from the file system, please do it manually, or with rhodecode-cleanup-repos command available in rhodecode-tools.')}
190 ${_('This repository will be renamed in a special way in order to make it inaccessible to RhodeCode Enterprise and its VCS systems. If you need to fully delete it from the file system, please do it manually, or with rhodecode-cleanup-repos command available in rhodecode-tools.')}
190 </span>
191 </span>
191 </div>
192 </div>
192
193
193 ${h.end_form()}
194 ${h.end_form()}
194 </div>
195 </div>
195 </div>
196 </div>
196
197
197
198
198 <script>
199 <script>
199
200
200 var currentRepoId = ${c.rhodecode_db_repo.repo_id};
201 var currentRepoId = ${c.rhodecode_db_repo.repo_id};
201
202
202 var repoTypeFilter = function(data) {
203 var repoTypeFilter = function(data) {
203 var results = [];
204 var results = [];
204
205
205 if (!data.results[0]) {
206 if (!data.results[0]) {
206 return data
207 return data
207 }
208 }
208
209
209 $.each(data.results[0].children, function() {
210 $.each(data.results[0].children, function() {
210 // filter out the SAME repo, it cannot be used as fork of itself
211 // filter out the SAME repo, it cannot be used as fork of itself
211 if (this.repo_id != currentRepoId) {
212 if (this.repo_id != currentRepoId) {
212 this.id = this.repo_id;
213 this.id = this.repo_id;
213 results.push(this)
214 results.push(this)
214 }
215 }
215 });
216 });
216 data.results[0].children = results;
217 data.results[0].children = results;
217 return data;
218 return data;
218 };
219 };
219
220
220 $("#id_fork_of").select2({
221 $("#id_fork_of").select2({
221 cachedDataSource: {},
222 cachedDataSource: {},
222 minimumInputLength: 2,
223 minimumInputLength: 2,
223 placeholder: "${_('Change repository') if c.rhodecode_db_repo.fork else _('Pick repository')}",
224 placeholder: "${_('Change repository') if c.rhodecode_db_repo.fork else _('Pick repository')}",
224 dropdownAutoWidth: true,
225 dropdownAutoWidth: true,
225 containerCssClass: "drop-menu",
226 containerCssClass: "drop-menu",
226 dropdownCssClass: "drop-menu-dropdown",
227 dropdownCssClass: "drop-menu-dropdown",
227 formatResult: formatRepoResult,
228 formatResult: formatRepoResult,
228 query: $.debounce(250, function(query){
229 query: $.debounce(250, function(query){
229 self = this;
230 self = this;
230 var cacheKey = query.term;
231 var cacheKey = query.term;
231 var cachedData = self.cachedDataSource[cacheKey];
232 var cachedData = self.cachedDataSource[cacheKey];
232
233
233 if (cachedData) {
234 if (cachedData) {
234 query.callback({results: cachedData.results});
235 query.callback({results: cachedData.results});
235 } else {
236 } else {
236 $.ajax({
237 $.ajax({
237 url: pyroutes.url('repo_list_data'),
238 url: pyroutes.url('repo_list_data'),
238 data: {'query': query.term, repo_type: '${c.rhodecode_db_repo.repo_type}'},
239 data: {'query': query.term, repo_type: '${c.rhodecode_db_repo.repo_type}'},
239 dataType: 'json',
240 dataType: 'json',
240 type: 'GET',
241 type: 'GET',
241 success: function(data) {
242 success: function(data) {
242 data = repoTypeFilter(data);
243 data = repoTypeFilter(data);
243 self.cachedDataSource[cacheKey] = data;
244 self.cachedDataSource[cacheKey] = data;
244 query.callback({results: data.results});
245 query.callback({results: data.results});
245 },
246 },
246 error: function(data, textStatus, errorThrown) {
247 error: function(data, textStatus, errorThrown) {
247 alert("Error while fetching entries.\nError code {0} ({1}).".format(data.status, data.statusText));
248 alert("Error while fetching entries.\nError code {0} ({1}).".format(data.status, data.statusText));
248 }
249 }
249 })
250 })
250 }
251 }
251 })
252 })
252 });
253 });
253 </script>
254 </script>
254
255
@@ -1,84 +1,85 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 (_('User Group ID'), c.user_group.users_group_id, '', ''),
5 (_('Owner'), lambda:base.gravatar_with_user(c.user_group.user.email), '', ''),
6 (_('Owner'), lambda:base.gravatar_with_user(c.user_group.user.email), '', ''),
6 (_('Created on'), h.format_date(c.user_group.created_on), '', '',),
7 (_('Created on'), h.format_date(c.user_group.created_on), '', '',),
7
8
8 (_('Members'), len(c.group_members_obj),'', [x for x in c.group_members_obj]),
9 (_('Members'), len(c.group_members_obj),'', [x for x in c.group_members_obj]),
9 (_('Automatic member sync'), 'Yes' if c.user_group.group_data.get('extern_type') else 'No', '', '',),
10 (_('Automatic member sync'), 'Yes' if c.user_group.group_data.get('extern_type') else 'No', '', '',),
10
11
11 (_('Assigned to repositories'), len(c.group_to_repos),'', [x for x in c.group_to_repos]),
12 (_('Assigned to repositories'), len(c.group_to_repos),'', [x for x in c.group_to_repos]),
12 (_('Assigned to repo groups'), len(c.group_to_repo_groups), '', [x for x in c.group_to_repo_groups]),
13 (_('Assigned to repo groups'), len(c.group_to_repo_groups), '', [x for x in c.group_to_repo_groups]),
13
14
14 (_('Assigned to review rules'), len(c.group_to_review_rules), '', [x for x in c.group_to_review_rules]),
15 (_('Assigned to review rules'), len(c.group_to_review_rules), '', [x for x in c.group_to_review_rules]),
15 ]
16 ]
16 %>
17 %>
17
18
18 <div class="panel panel-default">
19 <div class="panel panel-default">
19 <div class="panel-heading">
20 <div class="panel-heading">
20 <h3 class="panel-title">${_('User Group: %s') % c.user_group.users_group_name}</h3>
21 <h3 class="panel-title">${_('User Group: %s') % c.user_group.users_group_name}</h3>
21 </div>
22 </div>
22 <div class="panel-body">
23 <div class="panel-body">
23 ${base.dt_info_panel(elems)}
24 ${base.dt_info_panel(elems)}
24 </div>
25 </div>
25
26
26 </div>
27 </div>
27
28
28 <div class="panel panel-default">
29 <div class="panel panel-default">
29 <div class="panel-heading">
30 <div class="panel-heading">
30 <h3 class="panel-title">${_('Group members sync')}</h3>
31 <h3 class="panel-title">${_('Group members sync')}</h3>
31 </div>
32 </div>
32 <div class="panel-body">
33 <div class="panel-body">
33 <% sync_type = c.user_group.group_data.get('extern_type') %>
34 <% sync_type = c.user_group.group_data.get('extern_type') %>
34
35
35 % if sync_type:
36 % if sync_type:
36 <p>
37 <p>
37 ${_('This group is set to be automatically synchronised.')}<br/>
38 ${_('This group is set to be automatically synchronised.')}<br/>
38 ${_('This group synchronization was set by')}: <strong>${sync_type}</strong>
39 ${_('This group synchronization was set by')}: <strong>${sync_type}</strong>
39 </p>
40 </p>
40 % else:
41 % else:
41 <p>
42 <p>
42 ${_('This group is not set to be automatically synchronised')}
43 ${_('This group is not set to be automatically synchronised')}
43 </p>
44 </p>
44 % endif
45 % endif
45
46
46 <div>
47 <div>
47 ${h.secure_form(h.route_path('edit_user_group_advanced_sync', user_group_id=c.user_group.users_group_id), request=request)}
48 ${h.secure_form(h.route_path('edit_user_group_advanced_sync', user_group_id=c.user_group.users_group_id), request=request)}
48 <div class="field">
49 <div class="field">
49 <button class="btn btn-default" type="submit">
50 <button class="btn btn-default" type="submit">
50 %if sync_type:
51 %if sync_type:
51 ${_('Disable synchronization')}
52 ${_('Disable synchronization')}
52 %else:
53 %else:
53 ${_('Enable synchronization')}
54 ${_('Enable synchronization')}
54 %endif
55 %endif
55 </button>
56 </button>
56 </div>
57 </div>
57 <div class="field">
58 <div class="field">
58 <span class="help-block">
59 <span class="help-block">
59 ${_('Users will be added or removed from this group when they authenticate with RhodeCode system, based on LDAP group membership. '
60 ${_('Users will be added or removed from this group when they authenticate with RhodeCode system, based on LDAP group membership. '
60 'This requires `LDAP+User group` authentication plugin to be configured and enabled. (EE only feature)')}
61 'This requires `LDAP+User group` authentication plugin to be configured and enabled. (EE only feature)')}
61 </span>
62 </span>
62 </div>
63 </div>
63 ${h.end_form()}
64 ${h.end_form()}
64 </div>
65 </div>
65
66
66 </div>
67 </div>
67 </div>
68 </div>
68
69
69
70
70 <div class="panel panel-danger">
71 <div class="panel panel-danger">
71 <div class="panel-heading">
72 <div class="panel-heading">
72 <h3 class="panel-title">${_('Delete User Group')}</h3>
73 <h3 class="panel-title">${_('Delete User Group')}</h3>
73 </div>
74 </div>
74 <div class="panel-body">
75 <div class="panel-body">
75 ${h.secure_form(h.route_path('user_groups_delete', user_group_id=c.user_group.users_group_id), request=request)}
76 ${h.secure_form(h.route_path('user_groups_delete', user_group_id=c.user_group.users_group_id), request=request)}
76 ${h.hidden('force', 1)}
77 ${h.hidden('force', 1)}
77 <button class="btn btn-small btn-danger" type="submit"
78 <button class="btn btn-small btn-danger" type="submit"
78 onclick="return confirm('${_('Confirm to delete user group `%(ugroup)s` with all permission assignments') % {'ugroup': c.user_group.users_group_name}}');">
79 onclick="return confirm('${_('Confirm to delete user group `%(ugroup)s` with all permission assignments') % {'ugroup': c.user_group.users_group_name}}');">
79 <i class="icon-remove-sign"></i>
80 <i class="icon-remove-sign"></i>
80 ${_('Delete This User Group')}
81 ${_('Delete This User Group')}
81 </button>
82 </button>
82 ${h.end_form()}
83 ${h.end_form()}
83 </div>
84 </div>
84 </div>
85 </div>
@@ -1,161 +1,162 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 (_('User ID'), c.user.user_id, '', ''),
5 (_('Created on'), h.format_date(c.user.created_on), '', ''),
6 (_('Created on'), h.format_date(c.user.created_on), '', ''),
6 (_('Source of Record'), c.user.extern_type, '', ''),
7 (_('Source of Record'), c.user.extern_type, '', ''),
7
8
8 (_('Last login'), c.user.last_login or '-', '', ''),
9 (_('Last login'), c.user.last_login or '-', '', ''),
9 (_('Last activity'), c.user.last_activity, '', ''),
10 (_('Last activity'), c.user.last_activity, '', ''),
10
11
11 (_('Repositories'), len(c.user.repositories), '', [x.repo_name for x in c.user.repositories]),
12 (_('Repositories'), len(c.user.repositories), '', [x.repo_name for x in c.user.repositories]),
12 (_('Repository groups'), len(c.user.repository_groups), '', [x.group_name for x in c.user.repository_groups]),
13 (_('Repository groups'), len(c.user.repository_groups), '', [x.group_name for x in c.user.repository_groups]),
13 (_('User groups'), len(c.user.user_groups), '', [x.users_group_name for x in c.user.user_groups]),
14 (_('User groups'), len(c.user.user_groups), '', [x.users_group_name for x in c.user.user_groups]),
14
15
15 (_('Reviewer of pull requests'), len(c.user.reviewer_pull_requests), '', ['Pull Request #{}'.format(x.pull_request.pull_request_id) for x in c.user.reviewer_pull_requests]),
16 (_('Reviewer of pull requests'), len(c.user.reviewer_pull_requests), '', ['Pull Request #{}'.format(x.pull_request.pull_request_id) for x in c.user.reviewer_pull_requests]),
16 (_('Assigned to review rules'), len(c.user_to_review_rules), '', [x for x in c.user_to_review_rules]),
17 (_('Assigned to review rules'), len(c.user_to_review_rules), '', [x for x in c.user_to_review_rules]),
17
18
18 (_('Member of User groups'), len(c.user.group_member), '', [x.users_group.users_group_name for x in c.user.group_member]),
19 (_('Member of User groups'), len(c.user.group_member), '', [x.users_group.users_group_name for x in c.user.group_member]),
19 (_('Force password change'), c.user.user_data.get('force_password_change', 'False'), '', ''),
20 (_('Force password change'), c.user.user_data.get('force_password_change', 'False'), '', ''),
20 ]
21 ]
21 %>
22 %>
22
23
23 <div class="panel panel-default">
24 <div class="panel panel-default">
24 <div class="panel-heading">
25 <div class="panel-heading">
25 <h3 class="panel-title">${_('User: %s') % c.user.username}</h3>
26 <h3 class="panel-title">${_('User: %s') % c.user.username}</h3>
26 </div>
27 </div>
27 <div class="panel-body">
28 <div class="panel-body">
28 ${base.dt_info_panel(elems)}
29 ${base.dt_info_panel(elems)}
29 </div>
30 </div>
30 </div>
31 </div>
31
32
32 <div class="panel panel-default">
33 <div class="panel panel-default">
33 <div class="panel-heading">
34 <div class="panel-heading">
34 <h3 class="panel-title">${_('Force Password Reset')}</h3>
35 <h3 class="panel-title">${_('Force Password Reset')}</h3>
35 </div>
36 </div>
36 <div class="panel-body">
37 <div class="panel-body">
37 ${h.secure_form(h.route_path('user_force_password_reset', user_id=c.user.user_id), request=request)}
38 ${h.secure_form(h.route_path('user_force_password_reset', user_id=c.user.user_id), request=request)}
38 <div class="field">
39 <div class="field">
39 <button class="btn btn-default" type="submit">
40 <button class="btn btn-default" type="submit">
40 <i class="icon-lock"></i>
41 <i class="icon-lock"></i>
41 %if c.user.user_data.get('force_password_change'):
42 %if c.user.user_data.get('force_password_change'):
42 ${_('Disable forced password reset')}
43 ${_('Disable forced password reset')}
43 %else:
44 %else:
44 ${_('Enable forced password reset')}
45 ${_('Enable forced password reset')}
45 %endif
46 %endif
46 </button>
47 </button>
47 </div>
48 </div>
48 <div class="field">
49 <div class="field">
49 <span class="help-block">
50 <span class="help-block">
50 ${_("When this is enabled user will have to change they password when they next use RhodeCode system. This will also forbid vcs operations until someone makes a password change in the web interface")}
51 ${_("When this is enabled user will have to change they password when they next use RhodeCode system. This will also forbid vcs operations until someone makes a password change in the web interface")}
51 </span>
52 </span>
52 </div>
53 </div>
53 ${h.end_form()}
54 ${h.end_form()}
54 </div>
55 </div>
55 </div>
56 </div>
56
57
57 <div class="panel panel-default">
58 <div class="panel panel-default">
58 <div class="panel-heading">
59 <div class="panel-heading">
59 <h3 class="panel-title">${_('Personal Repository Group')}</h3>
60 <h3 class="panel-title">${_('Personal Repository Group')}</h3>
60 </div>
61 </div>
61 <div class="panel-body">
62 <div class="panel-body">
62 ${h.secure_form(h.route_path('user_create_personal_repo_group', user_id=c.user.user_id), request=request)}
63 ${h.secure_form(h.route_path('user_create_personal_repo_group', user_id=c.user.user_id), request=request)}
63
64
64 %if c.personal_repo_group:
65 %if c.personal_repo_group:
65 <div class="panel-body-title-text">${_('Users personal repository group')} : ${h.link_to(c.personal_repo_group.group_name, h.route_path('repo_group_home', repo_group_name=c.personal_repo_group.group_name))}</div>
66 <div class="panel-body-title-text">${_('Users personal repository group')} : ${h.link_to(c.personal_repo_group.group_name, h.route_path('repo_group_home', repo_group_name=c.personal_repo_group.group_name))}</div>
66 %else:
67 %else:
67 <div class="panel-body-title-text">
68 <div class="panel-body-title-text">
68 ${_('This user currently does not have a personal repository group')}
69 ${_('This user currently does not have a personal repository group')}
69 <br/>
70 <br/>
70 ${_('New group will be created at: `/%(path)s`') % {'path': c.personal_repo_group_name}}
71 ${_('New group will be created at: `/%(path)s`') % {'path': c.personal_repo_group_name}}
71 </div>
72 </div>
72 %endif
73 %endif
73 <button class="btn btn-default" type="submit" ${'disabled="disabled"' if c.personal_repo_group else ''}>
74 <button class="btn btn-default" type="submit" ${'disabled="disabled"' if c.personal_repo_group else ''}>
74 <i class="icon-folder-close"></i>
75 <i class="icon-folder-close"></i>
75 ${_('Create personal repository group')}
76 ${_('Create personal repository group')}
76 </button>
77 </button>
77 ${h.end_form()}
78 ${h.end_form()}
78 </div>
79 </div>
79 </div>
80 </div>
80
81
81
82
82 <div class="panel panel-danger">
83 <div class="panel panel-danger">
83 <div class="panel-heading">
84 <div class="panel-heading">
84 <h3 class="panel-title">${_('Delete User')}</h3>
85 <h3 class="panel-title">${_('Delete User')}</h3>
85 </div>
86 </div>
86 <div class="panel-body">
87 <div class="panel-body">
87 ${h.secure_form(h.route_path('user_delete', user_id=c.user.user_id), request=request)}
88 ${h.secure_form(h.route_path('user_delete', user_id=c.user.user_id), request=request)}
88
89
89 <table class="display">
90 <table class="display">
90 <tr>
91 <tr>
91 <td>
92 <td>
92 ${_ungettext('This user owns %s repository.', 'This user owns %s repositories.', len(c.user.repositories)) % len(c.user.repositories)}
93 ${_ungettext('This user owns %s repository.', 'This user owns %s repositories.', len(c.user.repositories)) % len(c.user.repositories)}
93 </td>
94 </td>
94 <td>
95 <td>
95 %if len(c.user.repositories) > 0:
96 %if len(c.user.repositories) > 0:
96 <input type="radio" id="user_repos_1" name="user_repos" value="detach" checked="checked"/> <label for="user_repos_1">${_('Detach repositories')}</label>
97 <input type="radio" id="user_repos_1" name="user_repos" value="detach" checked="checked"/> <label for="user_repos_1">${_('Detach repositories')}</label>
97 %endif
98 %endif
98 </td>
99 </td>
99 <td>
100 <td>
100 %if len(c.user.repositories) > 0:
101 %if len(c.user.repositories) > 0:
101 <input type="radio" id="user_repos_2" name="user_repos" value="delete" /> <label for="user_repos_2">${_('Delete repositories')}</label>
102 <input type="radio" id="user_repos_2" name="user_repos" value="delete" /> <label for="user_repos_2">${_('Delete repositories')}</label>
102 %endif
103 %endif
103 </td>
104 </td>
104 </tr>
105 </tr>
105
106
106 <tr>
107 <tr>
107 <td>
108 <td>
108 ${_ungettext('This user owns %s repository group.', 'This user owns %s repository groups.', len(c.user.repository_groups)) % len(c.user.repository_groups)}
109 ${_ungettext('This user owns %s repository group.', 'This user owns %s repository groups.', len(c.user.repository_groups)) % len(c.user.repository_groups)}
109 </td>
110 </td>
110 <td>
111 <td>
111 %if len(c.user.repository_groups) > 0:
112 %if len(c.user.repository_groups) > 0:
112 <input type="radio" id="user_repo_groups_1" name="user_repo_groups" value="detach" checked="checked"/> <label for="user_repo_groups_1">${_('Detach repository groups')}</label>
113 <input type="radio" id="user_repo_groups_1" name="user_repo_groups" value="detach" checked="checked"/> <label for="user_repo_groups_1">${_('Detach repository groups')}</label>
113 %endif
114 %endif
114 </td>
115 </td>
115 <td>
116 <td>
116 %if len(c.user.repository_groups) > 0:
117 %if len(c.user.repository_groups) > 0:
117 <input type="radio" id="user_repo_groups_2" name="user_repo_groups" value="delete" /> <label for="user_repo_groups_2">${_('Delete repositories')}</label>
118 <input type="radio" id="user_repo_groups_2" name="user_repo_groups" value="delete" /> <label for="user_repo_groups_2">${_('Delete repositories')}</label>
118 %endif
119 %endif
119 </td>
120 </td>
120 </tr>
121 </tr>
121
122
122 <tr>
123 <tr>
123 <td>
124 <td>
124 ${_ungettext('This user owns %s user group.', 'This user owns %s user groups.', len(c.user.user_groups)) % len(c.user.user_groups)}
125 ${_ungettext('This user owns %s user group.', 'This user owns %s user groups.', len(c.user.user_groups)) % len(c.user.user_groups)}
125 </td>
126 </td>
126 <td>
127 <td>
127 %if len(c.user.user_groups) > 0:
128 %if len(c.user.user_groups) > 0:
128 <input type="radio" id="user_user_groups_1" name="user_user_groups" value="detach" checked="checked"/> <label for="user_user_groups_1">${_('Detach user groups')}</label>
129 <input type="radio" id="user_user_groups_1" name="user_user_groups" value="detach" checked="checked"/> <label for="user_user_groups_1">${_('Detach user groups')}</label>
129 %endif
130 %endif
130 </td>
131 </td>
131 <td>
132 <td>
132 %if len(c.user.user_groups) > 0:
133 %if len(c.user.user_groups) > 0:
133 <input type="radio" id="user_user_groups_2" name="user_user_groups" value="delete" /> <label for="user_user_groups_2">${_('Delete repositories')}</label>
134 <input type="radio" id="user_user_groups_2" name="user_user_groups" value="delete" /> <label for="user_user_groups_2">${_('Delete repositories')}</label>
134 %endif
135 %endif
135 </td>
136 </td>
136 </tr>
137 </tr>
137 </table>
138 </table>
138 <div style="margin: 0 0 20px 0" class="fake-space"></div>
139 <div style="margin: 0 0 20px 0" class="fake-space"></div>
139
140
140 <div class="field">
141 <div class="field">
141 <button class="btn btn-small btn-danger" type="submit"
142 <button class="btn btn-small btn-danger" type="submit"
142 onclick="return confirm('${_('Confirm to delete this user: %s') % c.user.username}');"
143 onclick="return confirm('${_('Confirm to delete this user: %s') % c.user.username}');"
143 ${"disabled" if not c.can_delete_user else ""}>
144 ${"disabled" if not c.can_delete_user else ""}>
144 ${_('Delete this user')}
145 ${_('Delete this user')}
145 </button>
146 </button>
146 </div>
147 </div>
147 % if c.can_delete_user_message:
148 % if c.can_delete_user_message:
148 <p class="help-block pre-formatting">${c.can_delete_user_message}</p>
149 <p class="help-block pre-formatting">${c.can_delete_user_message}</p>
149 % endif
150 % endif
150
151
151 <div class="field">
152 <div class="field">
152 <span class="help-block">
153 <span class="help-block">
153 %if len(c.user.repositories) > 0 or len(c.user.repository_groups) > 0 or len(c.user.user_groups) > 0:
154 %if len(c.user.repositories) > 0 or len(c.user.repository_groups) > 0 or len(c.user.user_groups) > 0:
154 <p class="help-block">${_("When selecting the detach option, the depending objects owned by this user will be assigned to the `%s` super admin in the system. The delete option will delete the user's repositories!") % (c.first_admin.full_name)}</p>
155 <p class="help-block">${_("When selecting the detach option, the depending objects owned by this user will be assigned to the `%s` super admin in the system. The delete option will delete the user's repositories!") % (c.first_admin.full_name)}</p>
155 %endif
156 %endif
156 </span>
157 </span>
157 </div>
158 </div>
158
159
159 ${h.end_form()}
160 ${h.end_form()}
160 </div>
161 </div>
161 </div>
162 </div>
General Comments 0
You need to be logged in to leave comments. Login now