From 9b0190884d88ad15cf67e1288a302d22e88d37aa Mon Sep 17 00:00:00 2001 From: wxiaoguang Date: Wed, 22 Mar 2023 04:35:02 +0800 Subject: [PATCH] Remove `id="comment-form"` dead code, fix tag (#23555) The code has been dead code since #5073 . `#5073` duplicated the code in a new `if` block. The dead code blocks * #23290 --- templates/repo/issue/view_content.tmpl | 68 ++++++-------------------- 1 file changed, 15 insertions(+), 53 deletions(-) diff --git a/templates/repo/issue/view_content.tmpl b/templates/repo/issue/view_content.tmpl index 1b3cbdbec..3e43701b6 100644 --- a/templates/repo/issue/view_content.tmpl +++ b/templates/repo/issue/view_content.tmpl @@ -17,15 +17,15 @@ {{$createdStr:= TimeSinceUnix .Issue.CreatedUnix $.locale}}
- +
- {{if .Issue.OriginalAuthor}} + {{if .Issue.OriginalAuthor}} - {{else}} + {{else}} {{avatar $.Context .Issue.Poster}} - {{end}} + {{end}}
@@ -97,6 +97,7 @@ {{if and .Issue.IsPull (not $.Repository.IsArchived)}} {{template "repo/issue/view_content/pull".}} {{end}} + {{if .IsSigned}} {{if and (or .IsRepoAdmin .HasIssuesOrPullsWritePermission (not .Issue.IsLocked)) (not .Repository.IsArchived)}}
@@ -142,61 +143,22 @@ {{end}}
{{end}} - {{else}} - {{if .Repository.IsArchived}} -
- {{if .Issue.IsPull}} - {{.locale.Tr "repo.archive.pull.nocomment"}} - {{else}} - {{.locale.Tr "repo.archive.issue.nocomment"}} - {{end}} -
- {{else}} - {{if .IsSigned}} - {{if .Repository.IsArchived}} -
- - {{avatar $.Context .SignedUser}} - -
-
- {{template "repo/issue/comment_tab" .}} - {{.CsrfTokenHtml}} - - -
-
+ {{else}} {{/* not .IsSigned */}} + {{if .Repository.IsArchived}} +
+ {{if .Issue.IsPull}} + {{.locale.Tr "repo.archive.pull.nocomment"}} + {{else}} + {{.locale.Tr "repo.archive.issue.nocomment"}} + {{end}}
- {{end}} {{else}}
{{.locale.Tr "repo.issues.sign_in_require_desc" (.SignInLink|Escape) | Safe}}
{{end}} - {{end}} - {{end}} - + {{end}}{{/* end if: .IsSigned */}} +
{{template "repo/issue/view_content/sidebar" .}}