##// END OF EJS Templates
artifacts: show attached artifacts in advanced page, and delete them on repo deletion
marcink -
r3752:d8a6de0a new-ui
parent child Browse files
Show More

The requested changes are too big and content was truncated. Show full diff

1 NO CONTENT: modified file
The requested commit or file is too big and content was truncated. Show full diff
@@ -1,290 +1,291 b''
1 1 <%namespace name="base" file="/base/base.mako"/>
2 2
3 3 <%
4 4 elems = [
5 5 (_('Repository ID'), c.rhodecode_db_repo.repo_id, '', ''),
6 6 (_('Owner'), lambda:base.gravatar_with_user(c.rhodecode_db_repo.user.email), '', ''),
7 7 (_('Created on'), h.format_date(c.rhodecode_db_repo.created_on), '', ''),
8 8 (_('Updated on'), h.format_date(c.rhodecode_db_repo.updated_on), '', ''),
9 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'))), '', ''),
10 10 (_('Cached Commit date'), c.rhodecode_db_repo.changeset_cache.get('date'), '', ''),
11 11 (_('Attached scoped tokens'), len(c.rhodecode_db_repo.scoped_tokens), '', [x.user for x in c.rhodecode_db_repo.scoped_tokens]),
12 12 (_('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]),
13 13 (_('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]),
14 (_('Attached Artifacts'), len(c.rhodecode_db_repo.artifacts), '', ''),
14 15 ]
15 16 %>
16 17
17 18 <div class="panel panel-default">
18 19 <div class="panel-heading" id="advanced-info" >
19 20 <h3 class="panel-title">${_('Repository: %s') % c.rhodecode_db_repo.repo_name} <a class="permalink" href="#advanced-info"></a></h3>
20 21 </div>
21 22 <div class="panel-body">
22 23 ${base.dt_info_panel(elems)}
23 24 </div>
24 25 </div>
25 26
26 27
27 28 <div class="panel panel-default">
28 29 <div class="panel-heading" id="advanced-fork">
29 30 <h3 class="panel-title">${_('Fork Reference')} <a class="permalink" href="#advanced-fork"></a></h3>
30 31 </div>
31 32 <div class="panel-body">
32 33 ${h.secure_form(h.route_path('edit_repo_advanced_fork', repo_name=c.rhodecode_db_repo.repo_name), request=request)}
33 34
34 35 % if c.rhodecode_db_repo.fork:
35 36 <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))})}
36 37 | <button class="btn btn-link btn-danger" type="submit">Remove fork reference</button></div>
37 38 % endif
38 39
39 40 <div class="field">
40 41 ${h.hidden('id_fork_of')}
41 42 ${h.submit('set_as_fork_%s' % c.rhodecode_db_repo.repo_name,_('Set'),class_="btn btn-small",)}
42 43 </div>
43 44 <div class="field">
44 45 <span class="help-block">${_('Manually set this repository as a fork of another from the list')}</span>
45 46 </div>
46 47 ${h.end_form()}
47 48 </div>
48 49 </div>
49 50
50 51
51 52 <div class="panel panel-default">
52 53 <div class="panel-heading" id="advanced-journal">
53 54 <h3 class="panel-title">${_('Public Journal Visibility')} <a class="permalink" href="#advanced-journal"></a></h3>
54 55 </div>
55 56 <div class="panel-body">
56 57 ${h.secure_form(h.route_path('edit_repo_advanced_journal', repo_name=c.rhodecode_db_repo.repo_name), request=request)}
57 58 <div class="field">
58 59 %if c.in_public_journal:
59 60 <button class="btn btn-small" type="submit">
60 61 ${_('Remove from Public Journal')}
61 62 </button>
62 63 %else:
63 64 <button class="btn btn-small" type="submit">
64 65 ${_('Add to Public Journal')}
65 66 </button>
66 67 %endif
67 68 </div>
68 69 <div class="field" >
69 70 <span class="help-block">${_('All actions made on this repository will be visible to everyone following the public journal.')}</span>
70 71 </div>
71 72 ${h.end_form()}
72 73 </div>
73 74 </div>
74 75
75 76
76 77 <div class="panel panel-default">
77 78 <div class="panel-heading" id="advanced-locking">
78 79 <h3 class="panel-title">${_('Locking state')} <a class="permalink" href="#advanced-locking"></a></h3>
79 80 </div>
80 81 <div class="panel-body">
81 82 ${h.secure_form(h.route_path('edit_repo_advanced_locking', repo_name=c.rhodecode_db_repo.repo_name), request=request)}
82 83
83 84 %if c.rhodecode_db_repo.locked[0]:
84 85 <div class="panel-body-title-text">${'Locked by %s on %s. Lock reason: %s' % (h.person_by_id(c.rhodecode_db_repo.locked[0]),
85 86 h.format_date(h. time_to_datetime(c.rhodecode_db_repo.locked[1])), c.rhodecode_db_repo.locked[2])}</div>
86 87 %else:
87 88 <div class="panel-body-title-text">${_('This Repository is not currently locked.')}</div>
88 89 %endif
89 90
90 91 <div class="field" >
91 92 %if c.rhodecode_db_repo.locked[0]:
92 93 ${h.hidden('set_unlock', '1')}
93 94 <button class="btn btn-small" type="submit"
94 95 onclick="return confirm('${_('Confirm to unlock repository.')}');">
95 96 <i class="icon-unlock"></i>
96 97 ${_('Unlock repository')}
97 98 </button>
98 99 %else:
99 100 ${h.hidden('set_lock', '1')}
100 101 <button class="btn btn-small" type="submit"
101 102 onclick="return confirm('${_('Confirm to lock repository.')}');">
102 103 <i class="icon-lock"></i>
103 104 ${_('Lock repository')}
104 105 </button>
105 106 %endif
106 107 </div>
107 108 <div class="field" >
108 109 <span class="help-block">
109 110 ${_('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.')}
110 111 </span>
111 112 </div>
112 113 ${h.end_form()}
113 114 </div>
114 115 </div>
115 116
116 117
117 118 <div class="panel panel-default">
118 119 <div class="panel-heading" id="advanced-hooks">
119 120 <h3 class="panel-title">${_('Hooks')} <a class="permalink" href="#advanced-hooks"></a></h3>
120 121 </div>
121 122 <div class="panel-body">
122 123 <table class="rctable">
123 124 <th>${_('Hook type')}</th>
124 125 <th>${_('Hook version')}</th>
125 126 <th>${_('Current version')}</th>
126 127 % if c.ver_info_dict:
127 128 <tr>
128 129 <td>${_('PRE HOOK')}</td>
129 130 <td>${c.ver_info_dict['pre_version']}</td>
130 131 <td>${c.rhodecode_version}</td>
131 132 </tr>
132 133 <tr>
133 134 <td>${_('POST HOOK')}</td>
134 135 <td>${c.ver_info_dict['post_version']}</td>
135 136 <td>${c.rhodecode_version}</td>
136 137 </tr>
137 138 % else:
138 139 <tr>
139 140 <td>${_('Unable to read hook information from VCS Server')}</td>
140 141 </tr>
141 142 % endif
142 143 </table>
143 144
144 145 <a href="${h.route_path('edit_repo_advanced_hooks', repo_name=c.repo_name)}"
145 146 onclick="return confirm('${_('Confirm to reinstall hooks for this repository.')}');">
146 147 ${_('Update Hooks')}
147 148 </a>
148 149 </div>
149 150 </div>
150 151
151 152 <div class="panel panel-warning">
152 153 <div class="panel-heading" id="advanced-archive">
153 154 <h3 class="panel-title">${_('Archive repository')} <a class="permalink" href="#advanced-archive"></a></h3>
154 155 </div>
155 156 <div class="panel-body">
156 157 ${h.secure_form(h.route_path('edit_repo_advanced_archive', repo_name=c.repo_name), request=request)}
157 158
158 159 <div style="margin: 0 0 20px 0" class="fake-space"></div>
159 160
160 161 <div class="field">
161 162 <button class="btn btn-small btn-danger" type="submit"
162 163 onclick="return confirm('${_('Confirm to archive this repository: %s') % c.repo_name}');">
163 164 <i class="icon-remove-sign"></i>
164 165 ${_('Archive this repository')}
165 166 </button>
166 167 </div>
167 168 <div class="field">
168 169 <span class="help-block">
169 170 ${_('Archiving the repository will make it entirely read-only. The repository cannot be committed to.'
170 171 'It is hidden from the search results and dashboard. ')}
171 172 </span>
172 173 </div>
173 174
174 175 ${h.end_form()}
175 176 </div>
176 177 </div>
177 178
178 179
179 180 <div class="panel panel-danger">
180 181 <div class="panel-heading" id="advanced-delete">
181 182 <h3 class="panel-title">${_('Delete repository')} <a class="permalink" href="#advanced-delete"></a></h3>
182 183 </div>
183 184 <div class="panel-body">
184 185 ${h.secure_form(h.route_path('edit_repo_advanced_delete', repo_name=c.repo_name), request=request)}
185 186 <table class="display">
186 187 <tr>
187 188 <td>
188 189 ${_ungettext('This repository has %s fork.', 'This repository has %s forks.', c.rhodecode_db_repo.forks.count()) % c.rhodecode_db_repo.forks.count()}
189 190 </td>
190 191 <td>
191 192 %if c.rhodecode_db_repo.forks.count():
192 193 <input type="radio" name="forks" value="detach_forks" checked="checked"/> <label for="forks">${_('Detach forks')}</label>
193 194 %endif
194 195 </td>
195 196 <td>
196 197 %if c.rhodecode_db_repo.forks.count():
197 198 <input type="radio" name="forks" value="delete_forks"/> <label for="forks">${_('Delete forks')}</label>
198 199 %endif
199 200 </td>
200 201 </tr>
201 202 <% attached_prs = len(c.rhodecode_db_repo.pull_requests_source + c.rhodecode_db_repo.pull_requests_target) %>
202 203 % if c.rhodecode_db_repo.pull_requests_source or c.rhodecode_db_repo.pull_requests_target:
203 204 <tr>
204 205 <td>
205 206 ${_ungettext('This repository has %s attached pull request.', 'This repository has %s attached pull requests.', attached_prs) % attached_prs}
206 207 <br/>
207 208 ${_('Consider to archive this repository instead.')}
208 209 </td>
209 210 <td></td>
210 211 <td></td>
211 212 </tr>
212 213 % endif
213 214 </table>
214 215 <div style="margin: 0 0 20px 0" class="fake-space"></div>
215 216
216 217 <div class="field">
217 218 <button class="btn btn-small btn-danger" type="submit"
218 219 onclick="return confirm('${_('Confirm to delete this repository: %s') % c.repo_name}');">
219 220 <i class="icon-remove-sign"></i>
220 221 ${_('Delete this repository')}
221 222 </button>
222 223 </div>
223 224 <div class="field">
224 225 <span class="help-block">
225 226 ${_('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.')}
226 227 </span>
227 228 </div>
228 229
229 230 ${h.end_form()}
230 231 </div>
231 232 </div>
232 233
233 234
234 235 <script>
235 236
236 237 var currentRepoId = ${c.rhodecode_db_repo.repo_id};
237 238
238 239 var repoTypeFilter = function(data) {
239 240 var results = [];
240 241
241 242 if (!data.results[0]) {
242 243 return data
243 244 }
244 245
245 246 $.each(data.results[0].children, function() {
246 247 // filter out the SAME repo, it cannot be used as fork of itself
247 248 if (this.repo_id != currentRepoId) {
248 249 this.id = this.repo_id;
249 250 results.push(this)
250 251 }
251 252 });
252 253 data.results[0].children = results;
253 254 return data;
254 255 };
255 256
256 257 $("#id_fork_of").select2({
257 258 cachedDataSource: {},
258 259 minimumInputLength: 2,
259 260 placeholder: "${_('Change repository') if c.rhodecode_db_repo.fork else _('Pick repository')}",
260 261 dropdownAutoWidth: true,
261 262 containerCssClass: "drop-menu",
262 263 dropdownCssClass: "drop-menu-dropdown",
263 264 formatResult: formatRepoResult,
264 265 query: $.debounce(250, function(query){
265 266 self = this;
266 267 var cacheKey = query.term;
267 268 var cachedData = self.cachedDataSource[cacheKey];
268 269
269 270 if (cachedData) {
270 271 query.callback({results: cachedData.results});
271 272 } else {
272 273 $.ajax({
273 274 url: pyroutes.url('repo_list_data'),
274 275 data: {'query': query.term, repo_type: '${c.rhodecode_db_repo.repo_type}'},
275 276 dataType: 'json',
276 277 type: 'GET',
277 278 success: function(data) {
278 279 data = repoTypeFilter(data);
279 280 self.cachedDataSource[cacheKey] = data;
280 281 query.callback({results: data.results});
281 282 },
282 283 error: function(data, textStatus, errorThrown) {
283 284 alert("Error while fetching entries.\nError code {0} ({1}).".format(data.status, data.statusText));
284 285 }
285 286 })
286 287 }
287 288 })
288 289 });
289 290 </script>
290 291
General Comments 0
You need to be logged in to leave comments. Login now