From 03fc3ab5704edafc114c2c31aca4561ba7bed8c8 Mon Sep 17 00:00:00 2001 From: ievgenii vdovenko Date: Thu, 31 Jul 2025 09:08:19 +0200 Subject: [PATCH] feature: adds warning message to FE --- rhodecode/i18n/rhodecode.pot | 4 +- rhodecode/model/repo.py | 2 +- .../admin/repos/repo_edit_advanced.mako | 41 +++++++++---------- 3 files changed, 23 insertions(+), 24 deletions(-) diff --git a/rhodecode/i18n/rhodecode.pot b/rhodecode/i18n/rhodecode.pot index 5822ba2c..bdcf3c3e 100644 --- a/rhodecode/i18n/rhodecode.pot +++ b/rhodecode/i18n/rhodecode.pot @@ -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 diff --git a/rhodecode/model/repo.py b/rhodecode/model/repo.py index f7a033db..e63932d5 100644 --- a/rhodecode/model/repo.py +++ b/rhodecode/model/repo.py @@ -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, diff --git a/rhodecode/templates/admin/repos/repo_edit_advanced.mako b/rhodecode/templates/admin/repos/repo_edit_advanced.mako index ffdc45fe..1ddfca2d 100644 --- a/rhodecode/templates/admin/repos/repo_edit_advanced.mako +++ b/rhodecode/templates/admin/repos/repo_edit_advanced.mako @@ -200,49 +200,53 @@
${h.secure_form(h.route_path('edit_repo_advanced_delete', repo_name=c.repo_name), request=request)} + <% forks = c.rhodecode_db_repo.forks.count() %> + % if forks: + % 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: - - - % endif <% attached_artifacts = len(c.rhodecode_db_repo.artifacts) %> % if attached_artifacts: - - - % endif + + +
- ${_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} - %if c.rhodecode_db_repo.forks.count(): + %if forks: %endif - %if c.rhodecode_db_repo.forks.count(): + %if forks: %endif
+ ${_ungettext('This repository has %s attached pull request.', 'This repository has %s attached pull requests.', attached_prs) % attached_prs} -
-
- ${_('Consider to archive this repository instead.')}
+ ${_ungettext('This repository has %s attached artifact.', 'This repository has %s attached artifacts.', attached_artifacts) % attached_artifacts} -
-
- ${_('Consider to archive this repository instead.')}
+ % if attached_artifacts or attached_prs or forks: +
+
+ % endif + + ${_('Warning: You are about to delete the repository. This action cannot be undone!')} + +
@@ -254,11 +258,6 @@ ${_('Delete this repository')}
-
- - ${_('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.')} - -
${h.end_form()}