Show More
@@ -286,6 +286,20 b' class ReposController(BaseRepoController' | |||
|
286 | 286 | h.not_mapped_error(repo_name) |
|
287 | 287 | return redirect(url('repos')) |
|
288 | 288 | try: |
|
289 | _forks = repo.forks.count() | |
|
290 | if _forks and request.POST.get('forks'): | |
|
291 | do = request.POST['forks'] | |
|
292 | if do == 'detach_forks': | |
|
293 | for r in repo.forks: | |
|
294 | log.debug('Detaching fork %s from repo %s' % (r, repo)) | |
|
295 | r.fork = None | |
|
296 | Session().add(r) | |
|
297 | h.flash(_('detached %s forks') % _forks, category='success') | |
|
298 | elif do == 'delete_forks': | |
|
299 | for r in repo.forks: | |
|
300 | log.debug('Deleting fork %s of repo %s' % (r, repo)) | |
|
301 | repo_model.delete(r) | |
|
302 | h.flash(_('deleted %s forks') % _forks, category='success') | |
|
289 | 303 | action_logger(self.rhodecode_user, 'admin_deleted_repo', |
|
290 | 304 | repo_name, self.ip_addr, self.sa) |
|
291 | 305 | repo_model.delete(repo) |
@@ -291,6 +291,11 b'' | |||
|
291 | 291 | <div class="form"> |
|
292 | 292 | <div class="fields"> |
|
293 | 293 | ${h.submit('remove_%s' % c.repo_info.repo_name,_('Remove this repository'),class_="ui-btn red",onclick="return confirm('"+_('Confirm to delete this repository')+"');")} |
|
294 | %if c.repo_info.forks.count(): | |
|
295 | - ${ungettext('this repository has %s fork', 'this repository has %s forks', c.repo_info.forks.count()) % c.repo_info.forks.count()} | |
|
296 | <input type="radio" name="forks" value="detach_forks" checked="checked"/> <label for="forks">${_('Detach forks')}</label> | |
|
297 | <input type="radio" name="forks" value="delete_forks" /> <label for="forks">${_('Delete forks')}</label> | |
|
298 | %endif | |
|
294 | 299 | </div> |
|
295 | 300 | <div class="field" style="border:none;color:#888"> |
|
296 | 301 | <ul> |
General Comments 0
You need to be logged in to leave comments.
Login now