From 43ed2000f5beeabfc030f4ea40d8615d719f99ef Mon Sep 17 00:00:00 2001 From: Lunny Xiao Date: Thu, 15 Jan 2026 10:56:12 -0800 Subject: [PATCH] Hide delete directory button for mirror or archive repository and disable the menu item if user have no permission --- templates/repo/view_content.tmpl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/templates/repo/view_content.tmpl b/templates/repo/view_content.tmpl index b31648fbbe..cbac675902 100644 --- a/templates/repo/view_content.tmpl +++ b/templates/repo/view_content.tmpl @@ -100,9 +100,9 @@ {{svg "octicon-link" 16}}{{ctx.Locale.Tr "repo.file_copy_permalink"}} - {{if and (.Permission.CanWrite ctx.Consts.RepoUnitTypeCode) (not .Repository.IsArchived) (not $isTreePathRoot)}} + {{if and (.Repository.CanContentChange) (not $isTreePathRoot)}}
- + {{svg "octicon-trash" 16}}{{ctx.Locale.Tr "repo.editor.delete_this_directory"}} {{end}}