From 5cbb2da3f4b14cdc6c2694fbbb318b6f848b597b Mon Sep 17 00:00:00 2001 From: Zettat123 Date: Mon, 19 Feb 2024 14:04:51 +0800 Subject: [PATCH 1/2] hide delete button --- .../view_content/comments_delete_time.tmpl | 32 ++++++++++--------- 1 file changed, 17 insertions(+), 15 deletions(-) diff --git a/templates/repo/issue/view_content/comments_delete_time.tmpl b/templates/repo/issue/view_content/comments_delete_time.tmpl index 7c01bb4228b8b..7e93ce93cb871 100644 --- a/templates/repo/issue/view_content/comments_delete_time.tmpl +++ b/templates/repo/issue/view_content/comments_delete_time.tmpl @@ -1,18 +1,20 @@ -{{if .comment.Time}} {{/* compatibility with time comments made before v1.14 */}} - {{if (not .comment.Time.Deleted)}} - {{if (or .ctxData.IsAdmin (and .ctxData.IsSigned (eq .ctxData.SignedUserID .comment.PosterID)))}} - - - - +{{if .ctxData.Repository.IsTimetrackerEnabled .ctxData.Context}} + {{if .comment.Time}} {{/* compatibility with time comments made before v1.14 */}} + {{if (not .comment.Time.Deleted)}} + {{if (or .ctxData.IsAdmin (and .ctxData.IsSigned (eq .ctxData.SignedUserID .comment.PosterID)))}} + + + + + {{end}} {{end}} {{end}} {{end}} From 8c8b7aff5e8ae180a38fb9b311a6e35204674614 Mon Sep 17 00:00:00 2001 From: Zettat123 Date: Tue, 20 Feb 2024 09:11:24 +0800 Subject: [PATCH 2/2] use and & fix ctx --- .../view_content/comments_delete_time.tmpl | 32 +++++++++---------- 1 file changed, 15 insertions(+), 17 deletions(-) diff --git a/templates/repo/issue/view_content/comments_delete_time.tmpl b/templates/repo/issue/view_content/comments_delete_time.tmpl index 7e93ce93cb871..95121b0dc7bc6 100644 --- a/templates/repo/issue/view_content/comments_delete_time.tmpl +++ b/templates/repo/issue/view_content/comments_delete_time.tmpl @@ -1,20 +1,18 @@ -{{if .ctxData.Repository.IsTimetrackerEnabled .ctxData.Context}} - {{if .comment.Time}} {{/* compatibility with time comments made before v1.14 */}} - {{if (not .comment.Time.Deleted)}} - {{if (or .ctxData.IsAdmin (and .ctxData.IsSigned (eq .ctxData.SignedUserID .comment.PosterID)))}} - - - - - {{end}} +{{if and .comment.Time (.ctxData.Repository.IsTimetrackerEnabled ctx)}} {{/* compatibility with time comments made before v1.14 */}} + {{if (not .comment.Time.Deleted)}} + {{if (or .ctxData.IsAdmin (and .ctxData.IsSigned (eq .ctxData.SignedUserID .comment.PosterID)))}} + + + + {{end}} {{end}} {{end}}