From a1b0bffd0ccf223479626ed145c043ade91cee1d Mon Sep 17 00:00:00 2001 From: Lunny Xiao Date: Sun, 29 Mar 2026 01:51:29 -0700 Subject: [PATCH] Hide delete branch or tag buttons in mirror or archived repositories. (#37006) Fix #36995 --------- Co-authored-by: Giteabot --- templates/repo/branch/list.tmpl | 12 ++++++------ templates/repo/tag/list.tmpl | 2 +- templates/repo/view_content.tmpl | 2 +- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/templates/repo/branch/list.tmpl b/templates/repo/branch/list.tmpl index 5e0d07ed6d..5ae3393575 100644 --- a/templates/repo/branch/list.tmpl +++ b/templates/repo/branch/list.tmpl @@ -7,7 +7,7 @@ {{if .DefaultBranchBranch}}

{{ctx.Locale.Tr "repo.default_branch"}} - {{if and $.IsWriter (not $.Repository.IsArchived) (not .IsDeleted)}} + {{if and $.IsWriter $.Repository.CanContentChange (not .IsDeleted)}} {{svg "octicon-arrow-switch"}} @@ -31,7 +31,7 @@ {{/* FIXME: here and below, the tw-overflow-visible is not quite right but it is still needed the moment: to show the important buttons when the width is narrow */}} - {{if and $.IsWriter (not $.Repository.IsArchived) (not .IsDeleted)}} + {{if and $.IsWriter $.Repository.CanContentChange (not .IsDeleted)}}