feature: adds warning message to FE

This commit is contained in:
ievgenii vdovenko 2025-07-31 09:08:19 +02:00
parent d4cb542581
commit 03fc3ab570
3 changed files with 23 additions and 24 deletions

View file

@ -7567,8 +7567,8 @@ msgstr ""
msgid "Delete this repository"
msgstr ""
#: rhodecode/templates/admin/repos/repo_edit_advanced.mako:242
msgid "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."
#: rhodecode/templates/admin/repos/repo_edit_advanced.mako:237
msgid "Warning: You are about to delete the repository. This action cannot be undone!"
msgstr ""
#: rhodecode/templates/admin/repos/repo_edit_advanced.mako:276

View file

@ -762,7 +762,7 @@ class RepoModel(BaseModel):
def delete(
self,
repo: Repository,
forks: ForkAction = None, # left for backward compatibility, do not use it
forks: ForkAction = None,
fs_remove: bool = True,
cur_user: User = None,
call_events: bool = True,

View file

@ -200,49 +200,53 @@
<div class="panel-body">
${h.secure_form(h.route_path('edit_repo_advanced_delete', repo_name=c.repo_name), request=request)}
<table class="display">
<% forks = c.rhodecode_db_repo.forks.count() %>
% if forks:
<tr>
<td>
${_ungettext('This repository has %s fork.', 'This repository has %s forks.', c.rhodecode_db_repo.forks.count()) % c.rhodecode_db_repo.forks.count()}
${_ungettext('This repository has %s fork.', 'This repository has %s forks.', forks) % forks}
</td>
<td>
%if c.rhodecode_db_repo.forks.count():
%if forks:
<input type="radio" name="forks" value="detach_forks" checked="checked"/> <label for="forks">${_('Detach forks')}</label>
%endif
</td>
<td>
%if c.rhodecode_db_repo.forks.count():
%if forks:
<input type="radio" name="forks" value="delete_forks"/> <label for="forks">${_('Delete forks')}</label>
%endif
</td>
</tr>
% endif
<% attached_prs = len(c.rhodecode_db_repo.pull_requests_source + c.rhodecode_db_repo.pull_requests_target) %>
% if c.rhodecode_db_repo.pull_requests_source or c.rhodecode_db_repo.pull_requests_target:
% if attached_prs:
<tr>
<td>
<td colspan="3">
${_ungettext('This repository has %s attached pull request.', 'This repository has %s attached pull requests.', attached_prs) % attached_prs}
<br/>
<br/>
<strong>${_('Consider to archive this repository instead.')}</strong>
</td>
<td></td>
<td></td>
</tr>
% endif
<% attached_artifacts = len(c.rhodecode_db_repo.artifacts) %>
% if attached_artifacts:
<tr>
<td>
<td colspan="3">
${_ungettext('This repository has %s attached artifact.', 'This repository has %s attached artifacts.', attached_artifacts) % attached_artifacts}
<br/>
<br/>
<strong>${_('Consider to archive this repository instead.')}</strong>
</td>
<td></td>
<td></td>
</tr>
% endif
<tr>
<td colspan="3">
% if attached_artifacts or attached_prs or forks:
<br/>
<br/>
% endif
<span class="alert-warning" style="padding: 10px">
<strong>${_('Warning: You are about to delete the repository. This action cannot be undone!')}</strong>
</span>
</td>
</tr>
</table>
<div style="margin: 0 0 20px 0" class="fake-space"></div>
@ -254,11 +258,6 @@
${_('Delete this repository')}
</button>
</div>
<div class="field">
<span class="help-block">
${_('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.')}
</span>
</div>
${h.end_form()}
</div>